query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
gets info for a particular asset
public function getAssets($assets) { $result = $this->newAPIRequest('GET', '/assets', ['assets' => implode(',', $assets)]); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAsset($asset)\n {\n $result = $this->newAPIRequest('GET', '/assets/'.$asset);\n return $result;\n }", "public function getAsset(Component $component, $asset) {}", "protected function retrieve(Asset $asset)\n {\n if (!$map = $this->getCache()->fetch((string) $asset)) {\n return null;\n }\n\n $identifier = isset($map[$this->getVendor()]) ? $map[$this->getVendor()] : null;\n\n $this->debug('Retrieve Asset identifier from vendor', [\n 'asset' => (string) $asset,\n 'vendor' => $this->getVendor(),\n 'identifier' => $identifier,\n ]);\n\n return $identifier;\n }", "function getAssets();", "public function getAsset()\n {\n return $this->hasOne(Asset::className(), ['id' => 'asset_id']);\n }", "public function testShowAsset()\n {\n // 1. Create mock\n $admin = $this->admin;\n // 2. Hit Api Endpoint\n $response = $this->actingAs($admin)->get(route('asset.show', $this->asset));\n // 3. Verify and Assertion\n $response->assertStatus(Response::HTTP_OK);\n }", "public function updateAsset() {\n try {\n if (!($this->asset instanceof Base_Model_ObtorLib_App_Core_Asset_Entity_Asset)) {\n throw new Base_Model_ObtorLib_App_Core_Asset_Exception(\" Asset Asset Entity not initialized\");\n } else {\n $objAsset = new Base_Model_ObtorLib_App_Core_Asset_Dao_Asset();\n $objAsset->asset = $this->asset;\n return $objAsset->updateAsset();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Asset_Exception($ex);\n }\n }", "public function getAsset()\n {\n return $this->hasOne(Asset::className(), ['asset_id' => 'asset_id']);\n }", "public function get_asset($id, $private = FALSE, $queryargs = array()) {\n return $this->get_item_of_type($id, 'asset', $private, $queryargs);\n }", "public function getAsset()\n {\n if ($this->asset === null) {\n $this->asset = AssetFacade::find($this->getAssetId());\n }\n\n return $this->asset;\n }", "protected function assets()\n\t{\n\t\tswitch($this->method)\n\t\t{\n\t\t\tcase 'GET':\n\t\t\t\t\n\t\t\t\t$ev = 'read';\n\t\t\t\t$evObj = array(\"assettype\"=>$this->verb,\"args\"=>$this->args);\n\t\t\tbreak;\n\t\t\tcase 'POST':\n\t\t\t\t\n\t\t\t\t$ev = 'update';\n\t\t\t\t$evObj = array('id'=>$this->verb,'args'=>$this->args);\n\t\t\tbreak;\n\t\t\tcase 'PUT':\t\t\t\t\n\t\t\t\t$ev = 'create';\n\t\t\t\t$evObj = array('args'=>$this->verb);\n\t\t\tbreak;\n\t\t\tcase 'DELETE':\n\t\t\t\t\n\t\t\t\t$ev = 'delete';\n\t\t\t\t$evObj = array('id'=>$this->verb,'args'=>$this->args);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$this->fireEvent($this->endpoint,$ev,\"before\",$evObj);\n\t\t$obj = $this->$ev();\n\t\t$evObj['results']=$obj;\n\t\t$this->fireEvent($this->endpoint,$ev,\"after\",$evObj);\n\t\treturn $obj;\n\t}", "function getAssetById($assetid)\n {\n global $conn;\n $query=\"SELECT * FROM tbl_asset where id=\".$assetid;\n $response=array();\n $result=mysqli_query($conn, $query);\n $rows=mysqli_num_rows($result);\n if($rows > 0){\n while($row = mysqli_fetch_assoc($result))\n {\n $response[]=$row;\n }\n }\n else{\n array_push($response,\"No Data Found\");\n }\n\n header('Content-Type: application/json');\n echo json_encode($response);\n }", "public static function getAsset() {\n if (Asset::$asset == null) {\n Asset::$asset = new Asset();\n }\n return Asset::$asset;\n }", "public function getAssetById($id)\n\t{\n\t\treturn craft()->elements->getElementById($id, ElementType::Asset);\n\t}", "public function getAsset($id)\n\t{\n\t\treturn $this->getResourceChildObject('assets', $id);\n\t}", "public function getInfo()\n\t{\n\t\treturn $this->resource->get($this->name)->getContent();\n\t}", "public function check(Asset $asset)\n { \n $url = $this->getPicscoutUrl($asset);\n $content = $this->callPicscout($url);\n \t\n \tif(isset($content['ids'][0])) { //check if we had reponse from picscout\n \t\t$img_id = $content['ids'][0];\n \n \t\t$getty_image_img = $this->getGettyImageId($img_id); \n if(!is_null($getty_image_img)) {\n \n $g = new GettyImage;\n $rs = $g->getImageDetails($getty_image_img);\n if($rs !== null) { \n if(empty($rs->Images) === false) { \n $getty_data['imageId'] = $getty_image_img;\n $getty_data['picScoutImageId'] = $img_id;\n\n $image = $rs->Images[0];\n $meta = array(\n 'artist' => $image->Artist,\n 'copyright' => $image->Artist . ' / ' . $image->CollectionName\n ); \n $asset->setMeta($meta);\n $asset->setFromGetty(true); \n $asset->setGettyData($getty_data);\n $this->dm->persist($asset);\n $this->dm->flush(); \n }\n }\n }\n\n \t}\n \n \t//no ids was found, we can use asset\n \treturn true;\n }", "public function getAsset($id) {\n try {\n $objAsset = new Base_Model_ObtorLib_App_Core_Asset_Dao_Asset();\n $asset = $objAsset->getAsset($id);\n return $asset;\n } catch (Exception $e) {\n throw new Base_Model_ObtorLib_App_Core_Asset_Exception($e);\n }\n }", "function get_asset_size($asset, $folder = NULL) {\n if($folder != NULL) $asset = $folder.'/'.$asset;\n $assetpath = assets_path($asset);\n $file_info = get_file_info($_SERVER['DOCUMENT_ROOT'].\"/\".$assetpath, array('size'));\n $filesize = $file_info[\"size\"] / 1024;\n \n return number_format($filesize, 1).\" KB\";\n}", "public function getAsset($type, $name)\n {\n return sprintf(\"%s/%s\", $this->$type, $name);\n }", "protected function _getAssetTitle()\n\t{\n\t\treturn $this->title;\n\t}", "protected function _getAssetTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function action_show() {\n\t\t$file = $this->request->param(\"file\");\n\t\t\n\t\t// sanitize file path: remove ../ and ./\n\t\t$file = preg_replace('/\\w+\\/\\.\\.\\//', '', $file);\n\t\t\n\t\t// find local, uncached file\n\t\t$localFile = static::find_file($file);\n\t\t\n\t\tif ( $localFile !== null ) {\n\t\t\n\t\t\t// Parse Info / Get Extension\n\t\t\t$path_parts = pathinfo($localFile);\n\t\t\t$ext = strtolower($path_parts[\"extension\"]);\n\t\t\t\n\t\t\t// check if asset is of correct type\n\t\t\tif ( array_search($ext, Kohana::$config->load(self::CONFIG)->get('suffixes', array())) === false ) {\n\t\t\t\tthrow new HTTP_Exception_404(\"Unable to find asset :file!\", array(\":file\" => $file));\n\t\t\t}\n\t\t\n\t\t\t// Determine Content Type\n\t\t\t$ctype = Kohana_File::mime_by_ext($ext);\n\t\t\tif ( $ctype === false ) {\n\t\t\t\t$ctype=\"application/force-download\";\n\t\t\t}\n\t\t\t\n\t\t\theader(\"Content-Type: $ctype\");\n\t\t\t\n\t\t\t// check if the asset should be loaded as VIEW to support query parameters\n\t\t\tif ( array_search($file, Kohana::$config->load(self::CONFIG)->get('load_as_view', array())) !== false ) {\n\t\t\t\t$view = new Seth_Asset_View($localFile);\n\t\t\t\t$this->response->headers(\"Content-Type\", $ctype);\n\t\t\t\t$this->response->body($view->render());\n\t\t\t} else {\n\t\t\t\tob_clean();\n\t\t\t\tflush();\n\t\t\t\treadfile($localFile);\n\t\t\t\t\n\t\t\t\t// copy the file to the asset cache directory\n\t\t\t\t$cache_dir = Kohana::$config->load(self::CONFIG)->get('cache_dir', null);\n\t\t\t\t$cachedFile = $cache_dir .\"/\". $file;\n\t\t\t\t\n\t\t\t\t// check if cache directory is set, no cached version is available or cached version is outdated => copy new cached version\n\t\t\t\tif ( $cache_dir !== null && (!file_exists($cachedFile) || filemtime($localFile) > filemtime($cachedFile)) ) {\n\t\t\t\t\t// depending on the settings, this will prevent any further scripts from checking the cached file's actuality: A manual\n\t\t\t\t\t// reset of all cached assets will be necessary\n\t\t\t\t\t// This can happen if any asset resource is accessed without Asset::get() and this action creates the cached version. In future,\n\t\t\t\t\t// the asset is accessed directly and without Asset::get(), no check against filemtime() is performed and the asset might\n\t\t\t\t\t// be outdated sometimes\n\t\t\t\t\tstatic::copy_to_cache($localFile, $cachedFile);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new HTTP_Exception_404(\"Unable to find asset :file!\", array(\":file\" => $file));\n\t\t}\n\t}", "protected function _getAssetTitle() {\n return $this->shortname;\n }", "public function getAssets();", "public function getAssets();", "public function getInfo() {}", "public function getInfo() {}", "protected function _getAssetTitle()\n {\n return $this->title;\n }", "protected function _getAssetTitle()\n {\n return $this->title;\n }", "public function getInfo();", "public function getAsset()\r\n\t{\r\n\t\treturn Yii::app()->assetManager->publish(YiiBase::getPathOfAlias('application.modules.dashboard.assets'), true, -1, YII_DEBUG);\r\n\t}", "public function getAssetResult()\n {\n return $this->readOneof(23);\n }", "public function getAssetTitle()\n\t{\n\t\treturn $this->title;\n\t}", "public function addAsset() {\n try {\n if (!($this->asset instanceof Base_Model_ObtorLib_App_Core_Asset_Entity_Asset)) {\n throw new Base_Model_ObtorLib_App_Core_Asset_Exception(\" Asset Asset Entity not initialized\");\n } else {\n $objAsset = new Base_Model_ObtorLib_App_Core_Asset_Dao_Asset();\n $objAsset->asset = $this->asset;\n return $objAsset->addAsset();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Asset_Exception($ex);\n }\n }", "protected function getContent($asset) {\n $filename = $this->config['assetPath'] . '/' . $asset;\n $fp = fopen($filename, 'r');\n $content = fread($fp, filesize($filename));\n fclose($fp);\n return $content;\n }", "function getAssetDatabaseId($asset=null){\n global $mysqli;\n $id = false;\n $results = $mysqli->query(\"SELECT id FROM assets WHERE asset='{$asset}' OR asset_longname='{$asset}' LIMIT 1\");\n if($results){\n $row = $results->fetch_assoc();\n $id = $row['id'];\n }\n return $id;\n}", "function createAsset( $asset=null, $block_index=null ){\n global $mysqli, $counterparty;\n // Get current information on this asset\n $info = $counterparty->execute('get_asset_info', array('assets' => array($asset)));\n // Create data object using asset info (if any)\n $data = (count($info)) ? (object) $info[0] : (object) [];\n $description = substr($data->description,0,250); // Truncate to 250 chars\n $data->asset_id = getAssetId($asset);\n $data->issuer_id = createAddress($data->issuer);\n $data->owner_id = createAddress($data->owner);\n $data->divisible = ($data->divisible) ? 1 : 0; // convert to boolean\n $data->locked = ($data->locked) ? 1 : 0 ; // convert to boolean\n $data->supply = intval($data->supply);\n $data->description = $mysqli->real_escape_string($description);\n $data->asset_longname = $mysqli->real_escape_string($data->asset_longname);\n // Set asset type (1=Named, 2=Numeric, 3=Subasset, 4=Failed issuance)\n $data->type = (substr($asset,0,1)=='A') ? 2 : 1;\n if($data->asset_longname!='')\n $data->type = 3;\n if(count($info)==0)\n $data->type = 4;\n // Force numeric values for special assets\n if(in_array($data->asset, array('XCP','BTC'))){\n $data->issuer_id = 0;\n $data->owner_id = 0;\n }\n // Check if this asset already exists\n $results = $mysqli->query(\"SELECT id FROM assets WHERE asset='{$asset}' LIMIT 1\");\n if($results){\n if($results->num_rows){\n // Update asset information\n $row = $results->fetch_assoc();\n $id = $row['id'];\n $sql = \"UPDATE assets SET\n asset_id = '{$data->asset_id}',\n asset_longname = '{$data->asset_longname}',\n divisible = '{$data->divisible}',\n description = '{$data->description}',\n issuer_id = '{$data->issuer_id}',\n owner_id = '{$data->owner_id}',\n locked = '{$data->locked}',\n type = '{$data->type}',\n supply = '{$data->supply}'\n WHERE\n id='{$id}'\";\n $results = $mysqli->query($sql);\n if($results){\n return $id;\n } else {\n byeLog('Error while trying to update asset record for ' . $asset . ' : ' . $sql);\n }\n } else {\n // Create asset information\n $sql = \"INSERT INTO assets (asset_id, asset, asset_longname, block_index, type, divisible, description, issuer_id, locked, owner_id, supply) values (\n '{$data->asset_id}',\n '{$asset}',\n '{$data->asset_longname}',\n '{$block_index}',\n '{$data->type}',\n '{$data->divisible}',\n '{$data->description}',\n '{$data->issuer_id}',\n '{$data->locked}',\n '{$data->owner_id}',\n '{$data->supply}')\";\n $results = $mysqli->query($sql);\n if($results){\n return $mysqli->insert_id;\n } else {\n byeLog('Error while trying to create asset record for ' . $asset);\n }\n }\n } else {\n byeLog('Error while trying to lookup asset record');\n }\n}", "public function getAsset($key, $path = null) {\n if (isset($path))\n return $this->m->Assets->getAsset($key, $path);\n return $this->info->getAsset($this->m->Assets, $key);\n }", "public function chooseAssetsAction($data) {\n try {\n $styleId = @$data['styleId'];\n $materialId = @$data['materialId'];\n $colorId = @$data['colorId'];\n $type = @$data['type'];\n if (!($styleId && $materialId && $colorId && $type)) { \n throw new \\Exception('Error. One of the parameters (styleId, materialId, colorId, type) is empty, it must be numeric values and type as string( shoes, belts)!');\n }\n \n $asset = $this->em\n ->getRepository('BallyEntityBundle:Asset')\n ->createQueryBuilder('a')\n ->leftJoin('a.product_type', 't')\n ->where('a.product_style = :style')\n ->andWhere('a.leather = :material')\n ->andWhere('a.color = :color')\n ->andWhere('t.app = :app')\n ->andWhere('t.name = :type')\n ->setParameters(array(\n 'style' => (int) $styleId,\n 'material' => (int) $materialId,\n 'color' => (int) $colorId,\n 'app' => $this->app->getId(),\n 'type' => $type\n ))\n ->setMaxResults(1)\n ->getQuery()\n ->getOneOrNullResult();\n if (!$asset) { \n throw new \\Exception('Asset with this parameters no exist!');\n }\n \n if ($this->statistics) {\n $statisticsShare = new StatisticsAssets();\n $statisticsShare\n ->setStatistics($this->statistics)\n ->setAction($this->type)\n ->setMySessionId($this->sessionId)\n ->setIp(@$_SERVER['REMOTE_ADDR'])\n ->setViews(1)\n ->setAsset($asset);\n $this->em->persist($statisticsShare);\n $this->em->flush();\n return new JsonResponse(array('success' => true, 'msg' => 'Choose assets actions successufly added'));\n } else {\n throw new \\Exception('Cant find statistics for this session id and app id!');\n }\n } catch (\\PDOException $e) {\n return new JsonResponse(array('success' => false, 'msg' => 'An error occured', 'error' => $e->getMessage()));\n }\n }", "public function getAssetById(int $assetId, int $siteId = null)\n {\n /** @noinspection PhpIncompatibleReturnTypeInspection */\n return Craft::$app->getElements()->getElementById($assetId, Asset::class, $siteId);\n }", "public function getInfo($name) {}", "function asset($component)\n{\n echo \"resources/$component\";\n}", "public function show($id)\n {\n //\n $asset = Assets::find($id);\n return view('assets.show',compact('asset'));\n }", "public function assetObject()\n {\n return $this->belongsTo('App\\Asset', 'assetID');\n }", "function asset($asset)\n{\n return ASSET_PREFIX . '/'. $asset;\n}", "public function show(Asset $asset)\n {\n return view('admin.asset.show', compact('asset'));\n }", "public function testActiveListAsset()\n {\n // 1. Create mock\n $admin = $this->admin;\n // 2. Hit Api Endpoint\n $response = $this->actingAs($admin)->get(route('asset.list'));\n // 3. Verify and Assertion\n $response->assertStatus(Response::HTTP_OK);\n }", "public function asset()\n {\n return $this->belongsTo(Asset::class, 'asset_id', 'id');\n }", "public function assets()\r\n {\r\n return $this->httpRequest(\"v2/assets\");\r\n }", "private function _echoAsset($asset)\n {\n return Craft::$app->getResponse()->sendContentAsFile(\n $asset->getContents(),\n $asset->filename, \n [\n 'inline' => true,\n 'mimeType' => $asset->mimeType,\n 'contentLength' => $asset->size\n ]\n );\n }", "public function viewAssetDetails($asset_id, $id)\n {\n if (($asset_id == '' || $id == '') || ($asset_id == '' && $id == '')) {\n redirect('Products/index');\n } else {\n $breadcrumbs = \"<ul class='breadcrumb'>\n <li>\n <i class='ace-icon fa fa-home home-icon'></i>\n <a href='\" . site_url('Dashboard') . \"'>Dashboard</a>\n\n </li>\n <li class=''> <a href='\" . site_url('Products') . \"'>Manage Products</a></li>\n <li class=''> <a href='\" . site_url('Products/view/' . $asset_id) . \"'>Manage Product View</a></li>\n <li class='active'>View Product Details</li>\n </ul>\";\n $asset_details = $this->Crud_model->GetData('asset_details', '', \"asset_id='\" . $asset_id . \"' and id='\" . $id . \"'\", '', '', '', '1');\n $replaceDetails = '';\n if (!empty($asset_details->parent_id)) {\n $replaceDetails = $this->Crud_model->GetData('asset_details', '', \"asset_id='\" . $asset_id . \"' and id='\" . $asset_details->parent_id . \"'\", '', '', '', '1');\n }\n $assets = $this->Crud_model->GetData('assets', '', \"id='\" . $asset_id . \"'\", '', '', '', '1');\n $data = array(\n 'breadcrumbs' => $breadcrumbs,\n 'asset_details' => $asset_details,\n 'asset_id' => $asset_id,\n 'assets' => $assets,\n 'replaceDetails' => $replaceDetails,\n );\n\n $this->load->view('assets/viewAssetDetails', $data);\n }\n }", "function getInfo();", "public function getAssetType() : string\n {\n return $this->getProperty()->assetType;\n }", "public function infoAction()\r\n\t{\r\n\t // load the helper and the registry\r\n\t $helper = Mage::helper('manager');\r\n\t $registry = $helper->getRegistry();\r\n // load the ID of the package to initialize and the package itself\r\n\t $id = $this->getRequest()->getParam('id');\r\n\t $package = Mage::getModel('manager/package');\r\n\t $package->load($id);\r\n // load the package information packagename and the channel's URL\r\n $info = $this->_packageInfo(\r\n $package->getName(),\r\n $package->getChannel()->getUrl()\r\n );\r\n // attach a message to the session\r\n\t\tMage::getSingleton('adminhtml/session')->addSuccess(\r\n\t\t Mage::helper('manager')->__(\r\n\t\t var_export($info, true)\r\n\t\t )\r\n\t\t);\r\n // redirect to the licence overview\r\n $this->_redirect('*/*/');\r\n\t}", "public function getCode()\n {\n return 'resource_to_asset';\n }", "public function asset($asset = null)\n\t{\n\t\treturn rtrim($this->assetUrl,\"/\").($asset ? \"/\". trim($asset, '/') : '');\n\t}", "public function Asset($params)\n {\n if (gettype($params) == \"string\") {\n $params = [$params];\n }\n $filename = $params[0];\n $Link = $this->_machine->plugin(\"Link\");\n return $Link->Get($this->_prefixDir . \"/assets/\" . $filename);\n }", "public function getAssets()\n {\n\n }", "public function getComponent()\n {\n return $this->hasOne(Asset::className(), ['id' => 'component_id']);\n }", "public function onJSpaceAssetPrepareDownload($asset)\n {\n $html = null;\n \n $credentials = new Credentials(\n $this->params->get('access_key_id'), \n $this->params->get('secret_access_key')); \n\n $s3 = S3Client::factory(array('credentials'=>$credentials));\n \n $storage = JSpaceArchiveAssetHelper::buildStoragePath($asset->record_id);\n $path = $storage.$asset->hash;\n \n if ($s3->doesObjectExist($this->params->get('bucket'), $path))\n {\n $asset->url = JRoute::_('index.php?option=com_jspace&task=asset.stream&type=jspaces3&id='.$asset->id);\n \n $layout = JPATH_PLUGINS.'/content/jspaces3/layouts';\n $html = JLayoutHelper::render(\"jspaces3\", $asset, $layout);\n }\n\n return $html;\n }", "public function getAssetId(): int\n {\n $assetId = $this->attrs['asset_id'] ?? 0;\n\n return (int) $assetId;\n }", "function get_card_info($file){\n $template_data = get_file_data( $file , array( 'Card' => 'Card' ) );\n if (!empty($template_data['Card'])) {\n return $template_data['Card'];\n }\n }", "public function show(FixedAssets $fixed_asset)\n {\n //\n }", "public function getInfo($source)\n {\n $image_obj = $this->_getInstance('utility');\n return $image_obj->getInfo($source);\n }", "public static function get_user_assets($conn, $login) \n {\n Ossim_db::check_connection($conn);\n \n $assets = array();\n \n $params = array($login);\n $query = ossim_query(\"SELECT HEX(asset_id) AS asset_id FROM acl_assets WHERE login = ?\"); \n \n $rs = $conn->Execute($query, $params); \n \n if (!$rs)\n {\n Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());\n \n return $assets; \n } \n \n while (!$rs->EOF) \n {\n // Asset is a host or a net\n if (($obj = Asset_net::get_object($conn, $rs->fields['asset_id'], TRUE)) != NULL)\n {\n $assets[$obj->get_id()] = $obj;\n } \n elseif (($obj = Asset_host::get_object($conn, $rs->fields['asset_id'], TRUE)) != NULL) \n {\n $assets[$obj->get_id()] = $obj;\n }\n \n $rs->MoveNext();\n }\n \n return $assets;\n }", "public function getproductinfoAction() {\n\t\t$id = $this->getRequest ()->getParam ( 'id' );\n\t\t$product = Doctrine::getTable ( 'Products' )->find ( $id )->toArray ();\n\t\tdie ( json_encode ( $product ) );\n\t}", "public function show($id)\n {\n $asset = Asset::findOrFail($id);\n\n return View('assets.show', compact('asset'));\n }", "protected function _getAssetName()\n\t{\n\t\t$k = $this->_tbl_key;\n\n\t\treturn 'com_content.article.' . (int) $this->$k;\n\t}", "public function getTag()\n {\n return 'assets';\n }", "public function getAssetKey(): string\n {\n }", "public function getAlbumInfoAction()\n {\n \t$params = $this->getRequest()->getParams();\n\n \t$result = \\Extended\\socialise_album::getSocialiseAlbumInfo( $params['album_id'] );\n \n \tif( $result ):\n \techo Zend_Json::encode( $result );\n \telse:\n \t//Wallpost doesnot exist anymore.\n \techo Zend_Json::encode( 2 );\n \tendif;\n \tdie;\n }", "public function edit($id)\n {\n // \n $asset = Assets::find($id);\n return view('assets.edit',compact('asset'));\n }", "public function testIndexAssetSearchByName()\n {\n // 1. Mock data\n $admin = $this->admin;\n // 2. Hit Api Endpoint\n $response = $this->actingAs($admin)->get(route('asset.index', ['name' => 'zoom']));\n // 3. Verify and Assertion\n $response->assertStatus(Response::HTTP_OK);\n }", "protected function _getAssetName()\n\t{\n\t\t$k = $this->_tbl_key;\n\n\t\treturn 'com_labgenevet.clinic.' . (int) $this->$k;\n\t}", "public function getInfo($type){\n $sql= \"SELECT * FROM abilities WHERE Type = ? ORDER BY Stars DESC \";\n $ability = $this->database->getAll($sql, array($type));\n //Returns recordID, Name, SubInfo, Stars, Type\n return $ability;\n }", "public function getInformation();", "public function getAssetGuest()\n {\n return Asset::getAssets($this->command_guest_id, Asset::ASSETABLE_TEAM, NULL, true);\n }", "public function show($id)\n {\n $asset = $this->asset->findOrFail($id);\n\n return view('assets.show', compact('asset'));\n }", "function asset($url = '')\n{\n return ASSET . $url;\n}", "public function get_asset_url( string $asset ) {\n\t\tif ( ! $this->file_path ) {\n\t\t\t$this->file_path = str_replace( ABSPATH, '', dirname( ( new \\ReflectionClass( static::class ) )->getFileName(), 2 ) );\n\t\t}\n\n\t\t$asset_path = ABSPATH . $this->file_path . '/assets/' . $asset;\n\n\t\tif ( ! is_readable( $asset_path ) ) {\n\t\t\tthrow new \\Exception( \"Could not find requested asset at {$asset_path}.\" );\n\t\t}\n\n\t\treturn trailingslashit( get_site_url() . \"/{$this->file_path}/assets\" ) . $asset;\n\t}", "public function getInfo($url);", "public function getInfo($type)\n {\n if($this->isCurlSet()){\n return curl_getinfo($this->curl, $type);\n }else {\n throw new SdkException(\"cURL instance is not set when trying to get info from the type:\" . $type);\n }\n }", "public function test_actionAsset($file_name = \"\", $get = [])\n {\n $create_json_response = $this->createAsset($file_name);\n\n $_GET = $get;\n\n $_SERVER['REDIRECT_URL'] = '/query/asset/';\n ob_start();\n $controller = new $this->controller_name(rand(0,1000));\n Reflection::setProperty('allowGenerateHeader', $this->controller_name, $controller, false);\n Reflection::callMethod('actionAsset', $this->controller_name, [], $controller);\n $response = ob_get_contents();\n ob_end_clean();\n\n $json_response = str_replace(\"HTTP/1.1 200 OK\\n\", \"\", $response);\n $json_response = str_replace(\"Content-type: application/json\\n\", \"\", $json_response);\n\n $this->assertEquals(\"[\" . $create_json_response . \"]\", $json_response);\n }", "function info() {\r\n\t\t$this -> Producto -> recursive = -1;\r\n\t\t$producto = $this -> Producto -> read(null, $this -> data[\"Producto\"][\"id\"]);\r\n\t\techo json_encode($producto);\r\n\t\tConfigure::write('debug', 0);\r\n\t\t$this -> autoRender = false;\r\n\t\texit();\r\n\t}", "protected function getResourceEntity()\n\t{\n\t\treturn $this->arguments->getArgument(static::$RESOURCE_ARGUMENT_NAME)->getValue();\n\t}", "public function asset($name) {\n if (!$this->app->supportMethod('node', 'get')) {\n $params = array(\n '@method' => t('get'),\n '@asset' => t('node'),\n );\n throw new Exception(t(\"The app don't support the @method for @asset\", $params));\n }\n\n $this->asset = $name;\n $this->query = new EntityFieldQuery();\n $this->query->entityCondition('entity_type', $this->asset);\n return $this;\n }", "public function asset($asset = null)\n {\n if (! file_exists($manifest = $this->path . 'public/mix-manifest.json')) {\n return $this->uri . $asset;\n }\n\n $manifest = json_decode(file_get_contents($manifest), true);\n\n return $this->uri . ($manifest[$asset] ?? $asset);\n }", "public function get_remote_asset($id, $queryargs = array()) {\n return $this->get_item_of_type($id, 'remote-asset', $queryargs);\n }", "function getImg() {\n\n global $f3;\n global $tvdb;\n\n $series = $f3->get('PARAMS.param1');\n $episode_index = $f3->get('PARAMS.param2');\n $data = $tvdb->getSeries($series);\n\n if ($episode_index) {\n\t\t//if requesting episode image\n $chunks = explode(\",\", $episode_index);\n \t\t$season = $chunks[0]; //\techo \"Season \" . $season;\n \t\t$ep = $chunks[1]; //\t\techo \"Ep\" . $ep;\n \t\t$episode = $tvdb->getEpisode($data[0]->id, $season, $ep, 'en');\n\t\t echo $episode->thumbnail;\n } \n else {\n\t\t//if requesting show images\n $banner = $tvdb->getBanners($data[0]->id);\n $banner_j = json_encode($banner);\n echo $banner_j;\n }\n}", "function getMeta(){\n\t\t$AccessToken = Auth::token();\n\t\t$baseUrl = url . '/api/v1/' . customerAlias . '/' . databaseAlias;\n\t\t$endpoint = '/meta';\n\t\t$request = $baseUrl . $endpoint;\n\t\t$ch = curl_init();\n\t\tcurl_setopt_array($ch, array(\n\t\t CURLOPT_HTTPGET => true,\n\t\t CURLOPT_HTTPHEADER => array(\n\t\t\t\t'Authorization: Bearer ' . $AccessToken),\n\t\t CURLOPT_URL => $request,\n\t\t\tCURLOPT_RETURNTRANSFER => 1\n\t\t ));\n\t\t$response = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\treturn $response;\n\t}", "public function test_library_asset() {\n\t\t$path = route('v2_library_asset',[],false);\n\n\t\t$this->log(\"\\nTesting: \" . route('v2_library_asset', $this->params),'light_cyan',true);\n\t\t$response = $this->get(route('v2_library_asset'), $this->params);\n\t\t$response->assertSuccessful();\n\t\t$response->assertJsonStructure([$this->getSchemaKeys('v2_library_asset')]);\n\t\t$this->compareToOriginal($path,[$this->getSchemaKeys('v2_library_asset')]);\n\t}", "public function getInfo()\n {\n return $this->get(self::_INFO);\n }", "public function getInfo()\n {\n return $this->get(self::_INFO);\n }", "public function getInfo()\n {\n return $this->get(self::_INFO);\n }", "public function getInfo()\n {\n return $this->get(self::_INFO);\n }", "public function getInfo()\n {\n return $this->get(self::_INFO);\n }", "public function get_asset_by_tp_media_id($tp_media_id) {\n /* Returns the corresponding asset if it exists. Note that they're\n * calling it tp_media_id, NOT tp_media_object_id */\n $query = \"/assets/legacy/?tp_media_id=\" . $tp_media_id;\n $response = $this->get_request($query);\n if (!empty($response[\"errors\"][\"info\"][\"http_code\"]) && $response[\"errors\"][\"info\"][\"http_code\"] == 404) {\n // If this video is private/unpublished, retry the edit endpoint.\n preg_match(\"/.*?(\\/assets\\/.*)\\/$/\", $response[\"errors\"][\"info\"][\"url\"], $output_array);\n if (!empty($output_array[1])) {\n $response = $this->get_request($output_array[1] . \"/edit/\");\n }\n }\n return $response;\n }", "public function details()\n {\n \n try{\n return response()->json(['status' => true, 'data' => new VendorResource(auth()->user()), 'error' => []]);\n }\n catch(\\Exception $e){\n return response()->json(['status' => true, 'data' => [], 'error' => ['message' => $e->getMessage()]]);\n }\n }", "public function getBlockInfo();", "public function downloadAssetsAction() {\n try {\n if ($this->statistics) {\n $statisticsAssets = new StatisticsDownloads();\n $statisticsAssets\n ->setStatistics($this->statistics)\n ->setAction($this->type)\n ->setMySessionId($this->sessionId)\n ->setIp(@$_SERVER['REMOTE_ADDR'])\n ->setAssetDownloads(1);\n $this->em->persist($statisticsAssets);\n $this->em->flush();\n return new JsonResponse(array('success' => true, 'msg' => 'Assets download stats successufly added'));\n } else {\n throw new \\Exception('Cant find statistics for this session id and app id!');\n }\n } catch (\\Exception $e) {\n return new JsonResponse(array('success' => false, 'msg' => 'An error occured', 'error' => $e->getMessage()));\n }\n }" ]
[ "0.71543956", "0.6607871", "0.60457426", "0.5879343", "0.5789925", "0.5777391", "0.56835043", "0.5676702", "0.5657498", "0.56518424", "0.56308544", "0.5627868", "0.56094205", "0.55982184", "0.55946904", "0.5576663", "0.55315936", "0.5498109", "0.5462544", "0.54426175", "0.54375565", "0.54375565", "0.5432469", "0.54199016", "0.5393914", "0.5393914", "0.5381285", "0.5381285", "0.5375834", "0.5375834", "0.536108", "0.53352135", "0.5330829", "0.5328338", "0.532652", "0.53131944", "0.5308349", "0.5304803", "0.5292139", "0.52759075", "0.5266424", "0.5263188", "0.52565956", "0.525267", "0.5250676", "0.5235749", "0.52176136", "0.5209059", "0.52034736", "0.5197536", "0.5196112", "0.518491", "0.518412", "0.5167981", "0.5158979", "0.5126932", "0.50947887", "0.5074345", "0.5073389", "0.5066502", "0.50664866", "0.5056101", "0.5053", "0.50339174", "0.5033863", "0.502947", "0.5028076", "0.50261486", "0.50123686", "0.5011694", "0.49975038", "0.49935198", "0.49866882", "0.49829435", "0.497625", "0.49693725", "0.496885", "0.4964344", "0.49639148", "0.49394238", "0.4936509", "0.49147862", "0.49138147", "0.49089986", "0.48979616", "0.48965976", "0.48903507", "0.4887744", "0.48855507", "0.48783773", "0.48599413", "0.48546457", "0.4848238", "0.4848238", "0.4848238", "0.4848238", "0.4848238", "0.48471528", "0.48454893", "0.48442742", "0.4841154" ]
0.0
-1
////////////////////////////////////////////////////////////////////// Acounts Creates a new account for the payment address
public function createAccount($payment_address_uuid, $account_name, $meta_data=null) { $body = [ 'addressId' => $payment_address_uuid, 'name' => $account_name, ]; if ($meta_data !== null) { $body['meta'] = $meta_data; } $result = $this->newAPIRequest('POST', '/accounts', $body); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllAcounts(){\n return $this->accountGateway->getAllAcounts();\n }", "function add_create_account()\n {\n\t\t\n\t\tglobal $imported_ids;\n global $current_user;\n\n\t\t$acc_name = trim($this->column_fields['accountid']);\n\n\t\tif ((! isset($acc_name) || $acc_name == '') )\n\t\t{\n\t\t\treturn; \n\t\t}\n\n $arr = array();\n\n\t\t// check if it already exists\n $focus = new Accounts();\n\n\t\t$query = '';\n\n\t\t// if user is defining the ec_account id to be associated with this contact..\n\n\t\t//Modified to remove the spaces at first and last in ec_account name -- after 4.2 patch 2\n\t\t$acc_name = trim(addslashes($acc_name));\n\n\t\t//Modified the query to get the available account only ie., which is not deleted\n\t\t$query = \"select ec_account.* from ec_account WHERE accountname like '{$acc_name}%' \n\t\t\t\t\tand ec_account.deleted=0 ORDER BY accountname \";\n\t\t$result = $this->db->query($query);\n\t\t$row = $this->db->fetchByAssoc($result, -1, false);\n\t\t// we found a row with that id\n\t\tif (isset($row['accountid']) && $row['accountid'] != -1)\n\t\t{\n\t\t\t$focus->id = $row['accountid'];\n\t\t}\n\n\t\t// if we didnt find the ec_account, so create it\n\t\tif (! isset($focus->id) || $focus->id == '')\n\t\t{\n\t\t\t$focus->column_fields['accountname'] = $acc_name;\n\t\t\t$focus->column_fields['assigned_user_id'] = $current_user->id;\n\t\t\t$focus->column_fields['modified_user_id'] = $current_user->id;\n\n\t\t\t$focus->save(\"Accounts\");\n\t\t\t$acc_id = $focus->id;\n\t\t\t// avoid duplicate mappings:\n\t\t\tif (!isset( $imported_ids[$acc_id]) )\n\t\t\t{\n\t\t\t\t$imported_ids[$acc_id] = 1;\n\t\t\t}\n\t\t}\n\t\t// now just link the ec_account\n $this->column_fields[\"account_id\"] = $focus->id;\n\n }", "public function add_payments() {\n\n global $redis;\n\n $user_id = $this->params['user_id'];\n $associate_id = !empty($this->params['associate_id']) ? $this->params['associate_id'] : 0;\n $payment_account_id = $this->params['payment_account_id'];\n $paypal_username = $this->params['paypal_username'];\n $account_dbobj = $this->params['account_dbobj'];\n\n // validate paypal username\n $paypal = new PaypalAccount($account_dbobj);\n $paypal->findOne(\"username='\".$account_dbobj->escape($paypal_username).\"'\");\n if($paypal->getId() === 0) {\n if(!$paypal->setUsername($paypal_username)) {\n $this->errnos[INVALID_PAYPAL_ACCOUNT] = 1;\n $this->status = 1;\n return;\n }\n }\n $paypal->save();\n\n $payment_account = new PaymentAccount($account_dbobj);\n if(!empty($payment_account_id)) {\n $payment_account->findOne('id='.$payment_account_id);\n }\n $payment_account->setPaypalAccountId($paypal->getId());\n $payment_account->save();\n\n $user = new User($account_dbobj);\n $user->findOne('id='.$user_id);\n BaseMapper::saveAssociation($user, $payment_account, $account_dbobj);\n\n if(!empty($associate_id) && $is_active_associate = AssociatesMapper::is_active_associate($associate_id, $account_dbobj)) {\n $associate = new Associate($account_dbobj);\n $associate->findOne('id='.$associate_id);\n $associate->setStatus(ACTIVATED);\n $associate->save();\n $redis->set(\"associate::$associate_id:status\", $associate->getStatus());\n }\n\n $this->response['paypal_account_id'] = $paypal->getId();\n $this->response['paypal_username'] = $paypal->getUsername();\n\n $this->status = 0;\n\n // warm up cache\n $redis->set(\"user:$user_id:payment_account_id\", $payment_account->getId());\n $redis->set(\"payment_account:{$payment_account->getId()}:paypal_account_id\",$paypal->getId());\n $paypal_account_id = $paypal->getId();\n $redis->set(\"paypal_account:$paypal_account_id:username\", $paypal->getUsername());\n $redis->set(\"paypal_account:$paypal_account_id:status\", $paypal->getStatus());\n $redis->set(\"paypal_account:$paypal_account_id:created\", $paypal->getCreated());\n $redis->set(\"paypal_account:$paypal_account_id:updated\", $paypal->getUpdated());\n\n\n }", "function create() {\n\t\t\n\t\t// Require a validated association \n\t\tProfileAssociationValidRequired::check();\n\t\t\n\t\t// Dummy empty annonce\n\t\t$this->annonce = new Annonce();\n\t\t$this->annonce->competences = $this->extendedProfile->competences;\n\t\t$this->annonce->begin = date(DATE_FORMAT);\n\t\t$this->renderView(\"createAnnonce\");\n\t\t\n\t}", "public function createCustodyRecord($user_email, $user_id, $token_symbol, $token_count, $account_id = NULL) {\n $record = array(\n 'user_email' => $user_email,\n 'user_id' => $user_id,\n 'account_id' => $account_id,\n 'token_symbol' => $token_symbol,\n 'token_count' => $token_count,\n );\n DB::table('custody_accounts')->insert($record);\n }", "function add_account($name) {\n $this_account = new Account;\n $this->list[$name] = $this_account;\n return $this_account;\n }", "public function addAccount()\n {\n return new AccountDefinition($this,$this->now);\n }", "public static function createAccount($userIdentity, $bankName = null, $owner = null, $cardNumber = null, $shaba = null, $accountNumber = null);", "function newAccount(){\n\t\t\t\tglobal $driver;\n\t\t\t\t$sql = \"SELECT acnumber FROM clients ORDER BY id DESC LIMIT 1\"; //Retrieve the latest account number from clients table\n\t\t\t\tif($results\t= $driver->perform_request($sql)):\n\t\t\t\t\t$row\t\t=\t$driver->load_data($results,MYSQL_ASSOC);\n\t\t\t\t\t$account\t=\t$row['acnumber'];\n\t\t\t\t\t$newac\t\t=\t$account+1;\n\t\t\t\t\t\tswitch($newac):\n\t\t\t\t\t\t\tCASE $newac < 10:\n\t\t\t\t\t\t\t$newac\t=\t'000'.$newac;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tCASE $newac>=10 && $newac<100:\n\t\t\t\t\t\t\t$newac\t=\t'00'.$newac;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tCASE $newac>=100 && $newac<1000:\n\t\t\t\t\t\t\t$newac\t=\t'0'.$newac;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$newac\t=\t$newac+1;\n\t\t\t\t\t\tendswitch;\n\t\t\t\t\telse: \n\t\t\t\t\t\tdie('<p class=\"error\">Failed to generate New ACC/No: <br/>'.mysql_error().'</p>');\n\t\t\t\t\tendif;\n\t\t\treturn $newac; //The generated account number\n}", "public function createAccount(User $user){\n $this->accountList[$user->accountNumber][] = $user->userName;\n $this->accountList[$user->accountNumber][] = $user->balance;\n $this->totalAmount += $user->balance;\n }", "public function newWithdrawals( string $currency, float $amount, string $address)\r\n {\r\n $params = [\r\n 'wapi' => true,\r\n 'currency' => $currency,\r\n 'amount' => $amount,\r\n 'address' => $address\r\n ];\r\n return $this->httpRequest('withdrawals/new',\"POST\",$params,true);\r\n }", "public function Add($bank, $agency, $account, $account_type, $payment_type) {\n //Get Database\n $_database = $this->ConnectDatabase();\n //Create Data\n $_data = array($bank, $agency, $account, $account_type, $payment_type);\n //Call and return Database Function\n return $this->CallDatabase(\n $_database, $_data, function($_pdo, $_parameters) {\n //Create Query\n $_query = $_pdo->prepare(\"\n INSERT INTO `Bank`\n ( \n `bank`, \n `agency`, \n `account`, \n `type`,\n `account_type`\n )\n VALUES \n (\n ?, \n ?, \n ?, \n ?,\n ?\n )\n \");\n //Execute Query\n $_query->execute($_parameters);\n\n $id = $_pdo->lastInsertId();\n //Tratamento da resposta\n if (is_null($_query->errorInfo())) {\n $this->_response[\"status\"] = false;\n $this->_response[\"error\"] = $_query->errorInfo();\n } else {\n $this->_response[\"status\"] = true;\n $this->_response[\"data\"] = $id;\n }\n return $this->_response;\n }\n );\n }", "public function create()\n {\n $total=Cart::total();\n $tax=Cart::tax();\n $cart=Cart::content();\n $count=Cart::count();\n $user=Auth::user();\n $address=$user->address()->get();\n return view('frontend.addressbook',compact('address','total','tax','count','cart'));\n\n }", "public function create_account(Request $request)\n {\n //validate incoming request \n $this->validate($request, [\n 'account_number' => 'required',\n 'currency' => 'required|string'\n ]);\n\n try \n {\n $account = new Accounts;\n \n \n $account->account_number = $request->input('account_number');\n $account->currency = $request->input('currency');\n \n $account->save();\n\n return response()->json( [\n 'entity' => 'account', \n 'action' => 'create', \n 'result' => 'success'\n ], 201);\n\n } \n catch (\\Exception $e) \n {\n return response()->json( [\n 'entity' => 'account', \n 'action' => 'create', \n 'result' => 'failed'\n ], 409);\n }\n }", "public function __construct()\n {\n $this->_accounts = [];\n $this->_accounts[0] = new Account(12345, 1000.0, 1000.0);\n $this->_accounts[1] = new Account(67890, 20000.0, 20000.0);\n }", "public function addAccount(){\n\n\t}", "public function newPaymentAddress() {\n $result = $this->newAPIRequest('POST', '/addresses', []);\n return $result;\n }", "public function create()\n {\n if (! $attributes = $this->request->input('data.attributes')) {\n throw new BadRequestHttpException('You must provide attributes to create an account.');\n }\n\n //Run the create\n $account = $this->accounts->create($attributes);\n\n //Return the show response\n return $this->show($account->id);\n }", "public function addAddress($address);", "public function create()\n {\n //\n return view('purchase.asns.create');\n }", "function aff()\n {\n $invoice_order = App\\Invoice\\Model\\InvoiceOrderModel::find(1);\n $invoice_order_aff = new \\App\\Invoice\\InvoiceService\\Affiliate();\n $invoice_order_aff->active($invoice_order);\n }", "public function create()\n {\n return view('admin.accountaddresses.create');\n }", "public function createAccount(Request $request)\n {\n $this->_initAddAccountPageDynamicData();\n $postParams = $request->all();\n unset($postParams['_token']);\n\n $saveParams = $postParams['saveParams'];\n\n $createdAccountId = $this->_createAccountRecord($request, $saveParams);\n\n //return success response\n return response()->json(['error' => false, 'message' => 'Function completed Successfully!', 'createdAccountId' => $createdAccountId]);\n }", "public function addAddress($address, $name = ''){ \n $this->adresses[$address]= $name;\n }", "public function CreateWithdrawal($amount, $currency, $address, $auto_confirm = FALSE, $ipn_url = '') {\t\t\n\t\t$req = array(\n\t\t\t'amount' => $amount,\n\t\t\t'currency' => $currency,\n\t\t\t'address' => $address,\n\t\t\t'auto_confirm' => $auto_confirm ? 1:0,\n\t\t\t'ipn_url' => $ipn_url,\n\t\t);\n\t\treturn $this->api_call('create_withdrawal', $req);\n\t}", "public function add_account($id,$balance){\n if(preg_match(\"/^[0-9]+$/\",$id) && preg_match(\"/^[-+]?[0-9]*\\.?[0-9]+$/\",$balance)){\n if(array_key_exists($id,$this->accounts)){\n return 4;\n }else{\n $account = new Account($id,$balance);\n $this->accounts[$account->id] = $account;\n return 0;\n }\n }else{\n return 3;\n }\n }", "public function run()\n {\n $acc = new Account();\n $acc->create([\n 'name' => 'Main Account',\n 'slug' => strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', 'Main Account'))),\n 'balance' => 0,\n 'min_balance' => 0,\n 'description' => 'Main business Account',\n ]);\n\n $acc->create([\n 'name' => 'Sales',\n 'slug' => strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', 'Sales'))),\n 'balance' => 0,\n 'min_balance' => 0,\n 'description' => 'Deposits From Sales',\n ]);\n\n $acc->create([\n 'name' => 'Deposits',\n 'slug' => strtolower(trim(preg_replace('/[^A-Za-z0-9-]+/', '-', 'Deposit'))),\n 'balance' => 0,\n 'min_balance' => 0,\n 'description' => 'Deposits From Management',\n ]);\n }", "function doCreate() {\n\t\t\n\t\t// Require a validated association \n\t\tProfileAssociationValidRequired::check();\n\t\t\n\t\t// Create a new annonce with uniq id\r\n\t\t$this->annonce = new Annonce();\n\t\t$this->annonce->id = uniqid();\n\t\t\n\t\t// Populate from request\n\t\t$this->populateAnnonce();\n\t\t\n\t\t// Publish this announce\t\n\t\t$this->annonce->publish();\n\t\t\n\t\t// Make nice benevolat be notified of future canditatures\n\t\t$req = new Candidature();\n\t\t$req->annonceID = $this->annonce->id;\n\t\t$req->subscribe(ProfileNiceBenevolat::$USERID);\n\t\t\n\t\t// Succes message\r\n\t\t$this->setSuccess(_(\"Votre annonce a bien été publiée\"));\n\t\t\n\t\t// Show the new annonce\n\t\t$this->forwardTo(\"annonce:details\", array(\"id\" => $this->annonce->id));\n\r\n\t}", "public function __construct($accounts)\n {\n $this->accounts = $accounts;\n }", "public function create()\n {\n $category=Category::all(['category_id','category_name']);\n $item=Item::all(['item_id','item_name']);\n $destination=Destination::all(['destination_id','destination_name']);\n $accbank=Accbank::all(['accbank_id','reknumber','accbanks_desc']);\n return view('admin.accounts.create',compact('accbank','category','item','destination'));\n }", "public function getNewAddress($account = null);", "function create_account() {\n\n\tglobal $AccountDomain, $AccountName, $DB;\n\n\t// verify account name and domain are set\n\tif(!isset($AccountDomain) || empty($AccountDomain) || !isset($AccountName) || empty($AccountName)) {\n\t\tif(ADMIN_DEBUG_MODE === true) {\n\t\t\techo \"empty domain or name... name [{$AccountName}] - domain [{$AccountDomain}]\\n\";\n\t\t}\n\t\treturn 0;\n\t}\n\n\tif(domain_exists($AccountDomain)) {\n\t\tif(ADMIN_DEBUG_MODE === true) {\n\t\t\techo \"Domain Already Exists {$AccountDomain}\\n\";\n\t\t}\n\t\treturn 0;\n\t}\n\n\t$license_attempts = 0;\n\t$license_generation_failure = false;\n\t$license = generate_license();\n\twhile(license_exists($license)) {\n\t\t$license_attempts++;\n\t\t$license = generate_license();\n\t\tif($license_attempts >= MAX_LIC_GENERATIONS) {\n\t\t\tif(ADMIN_DEBUG_MODE === true) {\n\t\t\t\techo \"Maximum license generation attempts reached\\n\";\n\t\t\t}\n\t\t\t$license_generation_failure = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif($license_generation_failure) {\n\t\treturn 0;\n\t}\n\n\n\t$sql = \"INSERT INTO Account (Id, License, Domain, Name, Active, Del, Added) VALUES (NULL, '{$license}', '{$AccountDomain}', '{$AccountName}', 1, 0, CURRENT_TIMESTAMP)\";\n\tif(!$DB->Query($sql)) {\n\t\tif(ADMIN_DEBUG_MODE === true) {\n\t\t\techo \"Insert error: {$DB->GetLastErrorMsg()}\\n\";\n\t\t}\n\t\treturn 0;\n\t}\n\n\treturn $DB->GetLastInsertedId();\n\n}", "public function addAC($data){\n $advisory = new Advisory_Council;\n $advisory->fname = $data['fname'];\n\t \t$advisory->lname = $data['lname'];\n\t \t$advisory->mname = $data['mname'];\n\t \t$advisory->qualifier = $data['qname'];\n\t \t$advisory->gender = $data['gender'];\n\t \t$advisory->contactno = $data['mobile'];\n\t \t$advisory->landline = $data['landline'];\n\t \t$advisory->officename = $data['officename'];\n $advisory->officeaddress = $data['officeadd'];\n\t \t$advisory->email = $data['email'];\n\n\t \tif($data['durstart'] != \"\") {\n\t \t\t$advisory->startdate = $data['durstart'];\n\n\t \t}//if\n\t\tif($data['bdate'] != \"\") {\n\t \t\t$advisory->birthdate = $data['bdate'];\n\n\t \t}//if\n\n\t \t$advisory->fbuser = $data['facebook'];\n\t \t$advisory->twitteruser = $data['twitter'];\n\t \t$advisory->iguser = $data['instagram'];\n\n\t \t\n\n\t \t$advisory->street = $data['street'];\n\t \t$advisory->city = $data['city'];\n\t \t$advisory->province = $data['province'];\n\t \t$advisory->barangay = $data['barangay'];\n\n\n\t \tif($data['upphoto'] != \"\") {\n\t \t\t$advisory->imagepath = $this->loadphoto($data['upphoto']);\n\n\t \t}//if\n\n $advisory->advisory_position_id = $data['acposition'];\n $advisory->ac_sector_id = $data['acsector'];\n\n \t$advisory->second_id = $data['secondary'];\n\n\t if($data['tertiary'] != 'disitem') {\n\t \t$advisory->tertiary_id = $data['tertiary'];\n\t }//if\n\n\t if($data['quaternary'] != 'disitem') {\n\t \t$advisory->quaternary_id = $data['quaternary'];\n\t }//if\n\n $advisory->save();\n }", "public function CountAddresses() {\n\t\t\tif ((is_null($this->intId)))\n\t\t\t\treturn 0;\n\n\t\t\treturn Address::CountByPersonId($this->intId);\n\t\t}", "public function create()\n {\n $user = Auth::user();\n $addresses = Address::where('user_id', $user->id)->with('user')->get();\n //dd($addresses);\n return view('address.create');\n }", "public static function generateAccountN0(){\n $year = '20'.date('y');\n $accounts = User::count();\n return $year.($accounts + 1 ) ;\n }", "public function createAccount($request)\n {\n $runtime = new RuntimeOptions([]);\n\n return $this->createAccountWithOptions($request, $runtime);\n }", "public function store(CreateAccountAddressRequest $request)\n {\n $input = $request->all();\n\n $accountAddress = $this->accountAddressRepository->create($input);\n\n Flash::success('AccountAddress saved successfully.');\n\n return redirect(route('admin.accountaddresses.index'));\n }", "public static function addAddress($address, $clientId = null, $fromApi = false) {\n\n SchedDao::authenticateAddress($address);\n $sql = \"INSERT INTO addresses VALUES(NULL\";\n $sql .= \", \" . quote($address->tableCode);\n $sql .= \", \" . quote($address->tableId);\n $sql .= \", \" . quote($address->type);\n $sql .= \", \" . quote($address->addr1, true);\n $sql .= \", \" . quote($address->addr2, true);\n $sql .= \", \" . quote($address->addr3, true);\n $sql .= \", \" . quote($address->city, true);\n $sql .= \", \" . quote($address->state);\n $sql .= \", \" . quote($address->zip);\n $sql .= \", \" . gquote($address, \"country\");\n $sql .= \", \" . quote($address->phone1, true);\n $sql .= \", \" . quote($address->phone1Type);\n $sql .= \", \" . quote($address->phone2, true);\n $sql .= \", \" . quote($address->phone2Type);\n $sql .= \", \" . quote($address->phone3, true);\n $sql .= \", \" . quote($address->phone3Type);\n $sql .= \", \" . quote($address->email1, true);\n $sql .= \", \" . gquote($address, \"email2\", true);\n $sql .= \", \" . quote($address->name, true);\n $sql .= \")\";\n $id = insert($sql);\n if (! $fromApi && $clientId) {\n //AuditDao::log($clientId, AuditDao::ENTITY_ADDR_CLIENT, $id, AuditDao::ACTION_CREATE);\n }\n return $id;\n }", "function _queue2civicrm_trxn_counter_add( $gateway, $count=1 ) {\n $counter = _queue2civicrm_trxn_counter_get();\n $counter->add( $gateway, $count );\n}", "public function add(Address $address) {\n\n\t\t// parameterized query\n\t\t$query = \"INSERT INTO agrishop__addresses (profile_id, cap, street, name, city)\n\t\t\t\t\t\t\tVALUES ( ? , ? , ? , ? , ? );\";\n\n\t\t$parameters = [\n\n Session::get('id'),\n\t\t\t$address->getCap(),\n\t\t\t$address->getStreet(),\n\t\t\t$address->getName(),\n\t\t\t$address->getCity()\n\n\t\t];\n\n\t\t// set up parameters\n\t\t$options = ['types' => ['issss'], 'params' => $parameters ];\n\n\t\t// execute query\n $this->db->directQuery($query, $options);\n\n\t\t// check if the query has been successful\n return ($this->db->getAffectedNum() === 1);\n\n\t}", "private function _createAccountRecord(Request $request, $saveParams)\n {\n //validate payload\n $accountNumberValidationRules = $this->_getAccountNumberValidationRules($saveParams['country']);\n $validator = Validator::make($saveParams, [\n 'account_name' => !empty($saveParams['account_name']) ? 'required' : '',\n 'bank_name' => !empty($saveParams['bank_name']) ? 'required' : '',\n 'account_number' => !empty($saveParams['account_number']) ? $accountNumberValidationRules : '',\n 'iban' => !empty($saveParams['iban']) ? $accountNumberValidationRules : '',\n 'account_type' => !empty($saveParams['account_type']) ? 'required' : '',\n 'swift_code' => !empty($saveParams['swift_code']) ? 'required|alpha_num|regex:/^[a-zA-Z0-9]{8}([a-zA-Z0-9]{3})?$/' : '',\n 'branch_address' => !empty($saveParams['branch_address']) ? 'required' : '',\n 'sort_code' => !empty($saveParams['sort_code']) ? 'required|numeric|digits:6' : '',\n 'routing_number' => !empty($saveParams['routing_number']) ? 'required|numeric|digits:9' : '',\n 'ifsc_code' => !empty($saveParams['ifsc_code']) ? 'required|alpha_num|min:11|max:11' : '',\n 'transit_number' => !empty($saveParams['transit_number']) ? 'required|numeric|digits:5' : '',\n 'institution_number' => !empty($saveParams['institution_number']) ? 'required|numeric|digits:3' : '',\n 'bsb' => !empty($saveParams['bsb']) ? 'required|numeric|digits:6' : '',\n 'bank_code' => !empty($saveParams['bank_code']) ? 'required|numeric|digits:4' : '',\n 'branch_code' => !empty($saveParams['branch_code']) ? 'required|numeric|digits:3' : '',\n 'meps' => !empty($saveParams['meps']) ? 'required|alpha_num|min:8|max:8' : '',\n 'clabe' => !empty($saveParams['clabe']) ? $accountNumberValidationRules : '',\n 'brstn_code' => !empty($saveParams['brstn_code']) ? 'required|numeric|digits:9' : '',\n ]);\n\n if ($validator->fails())\n return response()->json(['error' => true, 'message' => 'Security Threat - Tampered Request Payload!']);\n if ($this->_foundDuplicacy($saveParams))\n return response()->json([\n 'error' => true,\n 'message' => 'An error ocurred. This bank account can\\'t be added right now'\n ]);\n //return failure response if occurs\n //create account record\n $accountRecord = new \\App\\Accounts();\n $accountRecord->user_id = Auth::user()->id;\n array_walk($saveParams, function ($value, $field) use ($accountRecord) {\n $accountRecord->{$field} = $value;\n });\n $accountRecord->save();\n return $accountRecord->id;\n }", "public function createAccount($type,$refID)\n\t{\n\t\tdb::insert(\"account\",Array(\n\t\t\t\t\t\t\"accountType\"=>$type,\n\t\t\t\t\t\t\"accountRefID\"=>$refID,\n\t\t\t\t\t\t\"accountBalance\"=>0,\n\t\t\t\t\t\t\"accountCreatedDate\"=>now(),\n\t\t\t\t\t\t\"accountCreatedUser\"=>session::get(\"userID\")\n\t\t\t\t\t\t));\n\n\t\t## return row (not last id)\n\t\treturn db::getLastID(\"account\",\"accountID\",true);\n\t}", "public function createEmployeeAccounts(Employee $employee, $params = array()) {\n\t\t$row = gv($params, 'account_total_row');\n\t\tif ($row > 0) {\n\t\t\tfor ($i = 0; $i < $row; $i++) {\n\t\t\t\tif (gv(gv($params, 'account_name'), $i)) {\n\t\t\t\t\t$this->account->forceCreate([\n\t\t\t\t\t\t'employee_id' => $employee->id,\n\t\t\t\t\t\t'account_name' => gv(gv($params, 'account_name'), $i),\n\t\t\t\t\t\t'account_number' => gv(gv($params, 'account_no'), $i),\n\t\t\t\t\t\t'bank_id' => gv(gv($params, 'bank_id'), $i),\n\t\t\t\t\t\t'branch_name' => gv(gv($params, 'branch_name'), $i),\n\t\t\t\t\t\t'options' => [],\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function create(){\r\n\t\t\t$data['title'] = \"Accounts | Create Account\";\r\n\t\t\t$data['userData'] = $this->session->userdata();\r\n\r\n\t\t\tif (!empty($this->input->post())){\r\n\t\t\t\t$accountCreateValidation = $this->form_validation->run();\r\n\r\n\t\t\t\tif($accountCreateValidation){\r\n\t\t\t\t\t$_POST['userID'] = $data['userData']['userID'];\r\n\t\t\t\t\t$createCheck = $this->account_model->createAccount($_POST);\r\n\t\t\t\t\tif ($createCheck){\r\n\t\t\t\t\t\t$this->session->set_flashdata('success', 'You have successfully created an account.');\r\n\t\t\t\t\t\tredirect('accounts');\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$this->session->set_flashdata('danger', 'Something internally happened. Please try again.');\r\n\t\t\t\t\t\t$this->load->template('accounts/create', $data);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\t$this->load->template('accounts/create', $data);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$this->load->template('accounts/create', $data);\r\n\t\t\t}\r\n\t\t}", "public function createPayment()\n\t{\n\n\t}", "public function newAccount($aFields)\n\t{\n\t\t// Verification de l'existence du login\n\t\tif ($this->checkLogin($aFields['login']))\n\t\t{\n\t\t\t$this->_error(LOC_MSG_LOGIN_EXIST);\n\t\t\treturn false;\n\t\t}\n\n\t\t// Enregistrement de la demande dans la base\n\t\t$q = new Bn_query('creations', '_asso');\n\t\tforeach( $aFields as $key => $value)\n\t\t{\n\t\t\t$q->addValue('crea_'.$key, $value);\n\t\t}\n\t\t$id = $q->addRow();\n\t\tif ( $q->isError() )\n\t\t{\n\t\t\t$this->_error($q->getMsg());\n\t\t}\n\t\treturn $id;\n\t}", "public function createWithdrawal($amount, $currency, $address)\n {\n $req = array(\n 'currency' => $currency,\n 'amount' => $amount,\n 'to' => $address,\n 'type' => 'cash_out',\n );\n return $this->apiCall('operations/withdraw', $req);\n }", "function createNewBilltoAccount($companyname\n , $contactname\n , $contactemail\n , $contactnumber\n , $address\n , $cfg_country_sdesc\n , $cfg_region_sdesc\n , $city)\n {\n $this->gdlog()->LogInfoStartFUNCTION(\"createNewBilltoAccount\");\n $fr = \"UNKNOWN_ERROR\";\n $this->cleanAllOutputData();\n \n $gdfab = new gdFindAccountingBillto();\n $fr = $gdfab->findAcountingBillto_bySdesc($companyname);\n if($fr == \"RECORD_IS_NOT_FOUND\")\n {\n $gdfab->countAcountingBilltos();\n $count = $gdfab->getRecordCount();\n \n $invoicenumberprefix = 9000 + (100 * (1 + $count));\n $timesheetnumberprefix = 9000 + (100 * (2 + $count));\n \n \n $gdcab = new gdCreateAccountingBillto();\n $fr = $gdcab->createRecordBilltoAccount($companyname\n , $contactname\n , $contactemail\n , $contactnumber\n , $address\n , $cfg_country_sdesc\n , $cfg_region_sdesc\n , $city\n , $invoicenumberprefix\n , $timesheetnumberprefix);\n if($fr == \"RECORD_IS_CREATED\")\n {\n $fr = $this->gdlog()->LogInfoRETURN(\"DATA_IS_CREATED\");\n }\n else\n {\n $fr = $this->gdlog()->LogInfoRETURN(\"DATA_IS_NOT_CREATED\");\n }\n }\n else\n {\n $fr = $this->gdlog()->LogInfoRETURN(\"ACCOUNT_ALREADY_EXISTS\");\n }\n $this->gdlog()->LogInfoEndFUNCTION(\"createNewBilltoAccount\");\n return $fr;\n }", "public function createNewAcount(Step_04 $I)\n {\n $I->LoginFuntion_04(Login_Page::$creataHyper);\n $I->waitForText('get started.',20);\n }", "public function Create_Account($p_CompanyName, $p_UserName, $p_Password, $p_Email){\n $acc_info=new Account_Info();\n $acc_info->AccountId = $this->GetGUID();//GUID Creation\n $acc_info->CompanyName = $p_CompanyName;\n $acc_info->Status = AccountStatus::Trail;//Enum Data Type Creation\n print_r($acc_info->Status);\n $acc_info->AccountType = AccountType::Starter;//Enum Data Type Creation\n $acc_info->ExpiryDate = date('Y-m-d', strtotime('+15 days'));\n \t $acc_info->CreatedDate = date('Y-m-d');\n \t $acc_info->Email = $p_Email;\n $acc_info->Insert();\n \t $usr_info = new User_Info();\n $usr_info->UserId = $this->GetGUID();\n \t $usr_info->AccountId =\"$acc_info->AccountId\";\n $usr_info->Email = $p_Email;\n \t $usr_info->UserName =$p_UserName;\n \t $usr_info->Password = $p_Password; \n \t $usr_info->Role = UserRole::Admin;//Enum Data Type Creation\n $usr_info->Insert();\n }", "public function actionCreate()\n {\n $model = new Account();\n $model->setScenario('create');\n $model->language = Yii::$app->language;\n $model->timezone = Yii::$app->timeZone;\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create( StoreAccountRequest $request )\n {\n $attributes = [\n 'user_id' => Auth::user()->id,\n 'fb_account_id' => $request->fb_account_id,\n 'fb_token' => $request->fb_token\n ];\n\n // Create the account record.\n //\n $account = $this->accountRepository->create( $attributes );\n\n // Return the response.\n //\n return $this->response( $account );\n }", "private function createAccount($username, $password, $acctype) {\n\t\t$newPass = password_hash($password, PASSWORD_DEFAULT);\n\t\t$queryInsert = $this->conn->prepare(\"INSERT INTO accounts (username, password, acc_status, acc_type) VALUES (?, ?, 'Active', ?)\");\n\t\t$queryInsert->bindParam(1, $username);\n\t\t$queryInsert->bindParam(2, $newPass);\n\t\t$queryInsert->bindParam(3, $acctype);\n\t\t$queryInsert->execute();\n\t\t$querySearch = $this->conn->prepare(\"SELECT acc_id FROM accounts WHERE username=?\");\n\t\t$querySearch->bindParam(1, $username);\n\t\t$querySearch->execute();\n\t\t$row = $querySearch->fetch();\n\t\t$newUsername = $username.$row['acc_id'];\n\t\t$getaccid = $row['acc_id'];\n\t\t$queryUpdate = $this->conn->prepare(\"UPDATE accounts SET username=? WHERE username=?\");\n\t\t$queryUpdate->bindParam(1, $newUsername);\n\t\t$queryUpdate->bindParam(2, $username);\n\t\t$queryUpdate->execute();\n\t\treturn $getaccid;\n\t}", "public function create() {\n $countries = Country::all();\n return view('account.addresses.create', compact('countries'));\n }", "public function getAddressesByAccount($account);", "public function create()\n {\n $data['paymentMethods'] = PaymentMethod::whereNull('deleted_at')->get();\n $data['banks'] = Bank::whereNull('deleted_at')->get();\n $data['account'] = Account::find(1);\n return view(\"backend.account.account.create\",$data);\n }", "function createCustomerProfile($email)\n{\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(MERCHANT_LOGIN_ID);\n $merchantAuthentication->setTransactionKey(TRANSACTION_KEY);\n\n // Set the transaction's refId\n $refId = 'ref' . time();\n\n // Create a Customer Profile Request\n // 1. (Optionally) create a Payment Profile\n // 2. (Optionally) create a Shipping Profile\n // 3. Create a Customer Profile (or specify an existing profile)\n // 4. Submit a CreateCustomerProfile Request\n // 5. Validate Profile ID returned\n\n\n // Create the payment object for a payment nonce\n $opaqueData = new AnetAPI\\OpaqueDataType();\n $opaqueData->setDataDescriptor($_POST['descriptor']);\n $opaqueData->setDataValue($_POST['value']);\n $paymentOpaque = new AnetAPI\\PaymentType();\n $paymentOpaque->setOpaqueData($opaqueData);\n\n\n // Create the Bill To info for new payment type\n $billTo = new AnetAPI\\CustomerAddressType();\n $billTo->setFirstName($_POST['firstName']);\n $billTo->setLastName($_POST['lastName']);\n $billTo->setCompany($_POST['company']);\n $billTo->setAddress($_POST['address']);\n $billTo->setCity($_POST['city']);\n $billTo->setState($_POST['state']);\n $billTo->setZip($_POST['zip']);\n $billTo->setCountry($_POST['country']);\n $billTo->setPhoneNumber($_POST['phone']);\n\n\n // Create a new CustomerPaymentProfile object\n $paymentProfile = new AnetAPI\\CustomerPaymentProfileType();\n $paymentProfile->setCustomerType('individual');\n $paymentProfile->setBillTo($billTo);\n $paymentProfile->setPayment($paymentOpaque);\n $paymentProfile->setDefaultpaymentProfile(true);\n $paymentProfiles[] = $paymentProfile;\n\n\n // Create a new CustomerProfileType and add the payment profile object\n $customerProfile = new AnetAPI\\CustomerProfileType();\n $customerProfile->setDescription(\"Customer 2 Test PHP\");\n $customerProfile->setEmail($email);\n $customerProfile->setpaymentProfiles($paymentProfiles);\n\n\n // Assemble the complete transaction request\n $request = new AnetAPI\\CreateCustomerProfileRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setProfile($customerProfile);\n\n // Create the controller and get the response\n $controller = new AnetController\\CreateCustomerProfileController($request);\n $response = $controller->executeWithApiResponse(\\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n echo \"Succesfully created customer profile : \" . $response->getCustomerProfileId() . \"<br>\";\n $paymentProfiles = $response->getCustomerPaymentProfileIdList();\n echo \"SUCCESS:<br>PAYMENT PROFILE ID : \" . $paymentProfiles[0] . \"<br>\";\n echo \"<br>Validating payment:<br>\";\n validateCustomerPaymentProfile($response->getCustomerProfileId(),$paymentProfiles[0]);\n }\n else\n {\n echo \"ERROR : Invalid response<br>\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"<br>\";\n }\n return $response;\n}", "public function add_cc(EmailAddress $address);", "public function save_address(CreateAddressRequest $request)\n {\n $address = Auth::guard('customer')->user()->addresses()->create($request->all());\n\n return redirect()->to(url()->previous().'?address='.$address->id.'#address-tab')->with('success', trans('theme.notify.address_created'));\n }", "public function purchaseAccountLedgerEntry()\n {\n $items = $this->getItems();\n \n $financeLedger = new Core_Model_Finance_Ledger;\n $salesLedgerRecord = $financeLedger->fetchByName('Purchase Account');\n \n $totalPrice = 0;\n for($i = 0; $i <= sizeof($items)-1; $i += 1) {\n $price = $items[$i]['unit_price'] * $items[$i]['quantity'];\n $totalPrice = $totalPrice + $price;\n }\n $notes = 'Purchase with Purchase Id = '.$this->_purchaseId;\n \n $dataToInsert = array(\n 'debit' => $totalPrice,\n 'credit' => \"0\",\n 'notes' => $notes,\n 'transaction_timestamp' => $this->_transactionTime,\n 'fa_ledger_id' => $salesLedgerRecord['fa_ledger_id']\n );\n $ledgerEntryModel = new Core_Model_Finance_Ledger_Entry;\n $ledgerEntryId = $ledgerEntryModel->create($dataToInsert);\n return $ledgerEntryId;\n }", "public function actionCreate()\n\t{\n\t\t$model = new AccountInvoice();\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t} else {\n\t\t\treturn $this->render('create', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}", "public function idc_authnet_add_address($customer_payment_profile, $fields, $line) {\r\n\t\tglobal $avs;\r\n\t\t// if AVS (Address verification system) is turned on, add address in billing\r\n\t\tif (isset($avs) && $avs) {\r\n\t\t\t// echo \"fields: \"; print_r($fields); echo \"\\n\";\r\n\t\t\tforeach ($fields as $field) {\r\n\t\t\t\t// Address 1 field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_1\") {\r\n\t\t\t\t\t$idc_address_1 = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// Address 2 field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_2\") {\r\n\t\t\t\t\tif (!empty($field['value'])) {\r\n\t\t\t\t\t\t$idc_address_2 = sanitize_text_field($field['value']);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// State field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_city\") {\r\n\t\t\t\t\t$idc_address_city = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// City field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_state\") {\r\n\t\t\t\t\t$idc_address_state = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t\t// Zip code field storing\r\n\t\t\t\tif ($field['name'] == \"idc_address_zip_code\") {\r\n\t\t\t\t\t$idc_address_zip_code = sanitize_text_field($field['value']);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$address_1 = apply_filters('idc_authnet_address_1_filter', $idc_address_1);\r\n\t\t\t$address_2 = apply_filters('idc_authnet_address_2_filter', ((isset($idc_address_2)) ? $idc_address_2 : ''));\r\n\t\t\t$address_city = apply_filters('idc_authnet_address_city_filter', $idc_address_city);\r\n\t\t\t$address_state = apply_filters('idc_authnet_address_state_filter', $idc_address_state);\r\n\t\t\t$address_zip_code = apply_filters('idc_authnet_address_zip_code_filter', $idc_address_zip_code);\r\n\r\n\t\t\t// Adding it to payment_profile\r\n\t\t\t$customer_payment_profile->billTo->address = $address_1 . \" \" . $address_2;\r\n\t\t\t$customer_payment_profile->billTo->city = $address_city;\r\n\t\t\t$customer_payment_profile->billTo->state = $address_state;\r\n\t\t\t$customer_payment_profile->billTo->zip = $address_zip_code;\r\n\r\n\t\t\tunset ($customer_payment_profile->payment->bankAccount);\r\n\t\t}\r\n\t\t// echo \"customer_payment_profile: \"; print_r($customer_payment_profile); echo \"\\n\";\r\n\r\n\t\treturn $customer_payment_profile;\r\n\t}", "private function _createAccount(string $nickname)\n\t{\n\t\t$accountModel = new AccountModel();\n\t\t$accountModel->nickname = $nickname;\n\t\t$accountModel->save();\n\t\treturn $accountModel->id;\n\t}", "public function accountant_create()\n\t{\n\t\t$data['name'] = html_escape($this->input->post('name'));\n\t\t$data['email'] = html_escape($this->input->post('email'));\n\t\t$data['password'] = sha1($this->input->post('password'));\n\t\t$data['phone'] = html_escape($this->input->post('phone'));\n\t\t$data['gender'] = html_escape($this->input->post('gender'));\n\t\t$data['blood_group'] = html_escape($this->input->post('blood_group'));\n\t\t$data['address'] = html_escape($this->input->post('address'));\n\t\t$data['school_id'] = $this->school_id;\n\t\t$data['role'] = 'accountant';\n\t\t$data['watch_history'] = '[]';\n\n\t\t$duplication_status = $this->check_duplication('on_create', $data['email']);\n\t\tif($duplication_status){\n\t\t\t$this->db->insert('users', $data);\n\n\t\t\t$response = array(\n\t\t\t\t'status' => true,\n\t\t\t\t'notification' => get_phrase('accountant_added_successfully')\n\t\t\t);\n\t\t}else{\n\t\t\t$response = array(\n\t\t\t\t'status' => false,\n\t\t\t\t'notification' => get_phrase('sorry_this_email_has_been_taken')\n\t\t\t);\n\t\t}\n\n\t\treturn json_encode($response);\n\t}", "public function createAccount(){\n\n\t\t$title = 'Create Account.';\n\n\t\treturn View('accounts.createAccount')\n ->with('title', $title);\n\t}", "public function createAddress(Wallet $wallet, $label = 'Default'): Address;", "public function create()\r\n {\r\n $totalInCart = $this->getGrandTotalInCart();\r\n return view('user.address.create', compact('totalInCart'));\r\n }", "public function getAccount($bitcoinaddress);", "function create_buyer_account() {\n\t\t \n\t\t$account_type = \"buyer\";\n\t\t$this->data['title'] = \"Create User\";\n\n\t\t$this->form_validation->set_error_delimiters('<div class=\"error\">', '</div>');\n\t\t$this->form_validation->set_rules('first_name', 'First Name', 'required');\n\t\t$this->form_validation->set_rules('last_name', 'Last Name', 'required');\n\t\t$this->form_validation->set_rules('email', 'Email Address', 'required|valid_email');\n\t\t$this->form_validation->set_rules('dealer_name', 'Dealer Name', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('title', 'Title', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('business_street_address', 'Business Street Address', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('business_city', 'Business City', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('business_state', 'Business State', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('business_zip_code', 'Business Zip Code', 'required|max_length[9]|numeric');\n\t\t$this->form_validation->set_rules('license_number', 'License Number', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('insurance_company_name', 'Insurance Co. Name', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('insurance_company_contact_name', 'Insurance Co. Contact Name', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('insurance_company_contact_phone', 'Insurance Co. Contact Phone', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('insurance_policy_number', 'Insurance Policy Number', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('bank_name', 'Insurance Co. Name', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('bank_contact_name', 'Insurance Co. Contact Name', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('bank_contact_phone', 'Insurance Co. Contact Phone', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('business_telephone_number', 'Business Telephone Number', 'required|max_length[50]');\n\t\t$this->form_validation->set_rules('terms_of_use', 'Terms of Use', 'required');\n\t\t$this->form_validation->set_rules('password', 'Password', 'required|min_length[4]|max_length[20]|matches[password_confirmation]');\n\t\t$this->form_validation->set_rules('password_confirmation', 'Password Confirmation', 'required');\n\t\t\n // If everything validates \n\t\t\n\t\tif ($this->form_validation->run() == true) {\n\t\t\t\n\t\t\t$first_name \t\t= $this->input->post('first_name');\n\t\t\t$last_name \t\t\t= $this->input->post('last_name');\n\t\t\t$email \t\t\t\t= $this->input->post('email');\n\t\t\t$password \t\t\t= $this->input->post('password');\n\t\t\t$additional_data \t= array(\t\n\t\t\t\t'dealer_name' => $this->input->post('dealer_name'),\n\t\t\t\t'title' => $this->input->post('title'),\t\n\t\t\t\t'business_street_address' => $this->input->post('business_street_address'),\t\n\t\t\t\t'business_city' => $this->input->post('business_city'),\t\n\t\t\t\t'business_state' => $this->input->post('business_state'),\t\n\t\t\t\t'business_zip_code' => $this->input->post('business_zip_code'),\t\n\t\t\t\t'license_number' => $this->input->post('license_number'),\t\n\t\t\t\t'insurance_company_name' => $this->input->post('insurance_company_name'),\t\n\t\t\t\t'insurance_company_contact_name' => $this->input->post('insurance_company_contact_name'),\t\n\t\t\t\t'insurance_company_contact_phone' => $this->input->post('insurance_company_contact_phone'),\t\n\t\t\t\t'insurance_policy_number' => $this->input->post('insurance_policy_number'),\t\n\t\t\t\t'bank_name' => $this->input->post('bank_name'),\t\n\t\t\t\t'bank_contact_name' => $this->input->post('bank_contact_name'),\t\n\t\t\t\t'bank_contact_phone' => $this->input->post('bank_contact_phone'),\t\n\t\t\t\t'business_telephone_number' => $this->input->post('business_telephone_number')\n );\n }\n\n\t\t\n // We need to create error message for declined cc info!!\n\n /* \n * $from sets from address to knight1902@roadrunner for local testing.\n * Needs to be set up with ISP using MailServe application\n * \n */ \n \n\t\tif ($this->form_validation->run() == true && $this->ion_auth->register_buyer($first_name, $account_type, $last_name, $email, $password, $additional_data)) {\n\t\t $to = $this->config->item('email_to_admin');\n $from_email = $this->config->item('email_from_support');\n $from_name = $this->config->item('email_name_from_new_accounts');\n\t\t\t$this->load->library('email');\n\t $this->email->set_newline(\"\\r\\n\");\n\t $this->email->from($from_email, $from_name);\n\t $this->email->to($to);\n\t $this->email->subject('New User Awaiting Approval');\n\t $this->email->message('A buyer has registered an account and is awaiting approval. Login to approve at https://www.etradeinbids.com');\n\t\t\t$this->email->send();\n\t\t\t\n\t\t\t//We need to figure out the way to send id value from user table;\n\t\t\t//$id = $data['id'];\n\t\t\t//$data['id'] =$this->ion_auth->get_user_by_email($email);\n\t\t\t\n\t\t\t/*\n * \n * If we track registration by email only, using flashdata, maybe we can rid of the $id and the database calls\n * \n */\n\t\t\t\n\t\t\t//$this->load->model('data_model');\n\t\t\t//$user_details = $this->data_model->get_user_details($email);\n\t\t\t//$user_id = $user_details[0]->id;\n\t\t\t//$data['id'] = $user_id;\n\t\t\t//$data['email'] = $email;\n \n //$this->session->set_flashdata('user_id', $user_id);\n //echo \"Email is: \".$email;\n $session_array = array('email' => $email);\n $this->session->set_userdata($session_array);\n\n\t\t\t/*\n * Using redirect here so the URL changes, which should allow the back button to work properly.\n * Flash data stores data in a session for only the next server request, then destroys it. \n * \n */ \n\t\t\t\n redirect('auth/register_credit_card');\n\t\t} else {\n\t\t\t$this->load->view('register_buyer_view');\n\t\t}\n\t}", "public function testCreateAccountTest()\n {\n $data = new Request();\n $data->name = $this->faker->name;\n $data->amount = rand(1000,9999) ;\n\n $banco = new BancoController();\n\n $nuevo = $banco->createAccount($data);\n\n $response = $this->get('/');\n\n $response->assertStatus(200);\n }", "protected function create(array $data)\n {\n $account = Account::create([\n 'acc_user' => $data['acc_user_register'],\n 'acc_password' => bcrypt($data['acc_password_register']), \n ]);\n\n return $account;\n }", "public function actionCreate()\n { \n $model = $this->getNewModel();\n $this->performAjaxValidation($model);\n $accoutordersearch = new Order;\n $accoutordersearch->unsetAttributes();\n $accoutordersearch->acnt_no = $model->acnt_no;\n \n if ( isset( $_POST['Account'] ) )\n {\n $this->saveAndRedirect($model);\n }\n else\n {\n if (Yii::app()->request->isAjaxRequest)\n {\n echo 'Nothing to save';\n Yii::app()->end();\n }\n }\n $this->render( 'create', array(\n 'model' => $model, 'accoutordersearch' => $accoutordersearch,\n ) );\n }", "private function insertNewAffiliate() {\n\t\t\t$queryVals = array(\n\t\t\t\t'~company' => prepDB($this->registrationForm['company']),\n\t\t\t\t'~first' => prepDB($this->registrationForm['first']),\n\t\t\t\t'~last' => prepDB($this->registrationForm['last']),\n\t\t\t\t'~phone' => prepDB($this->registrationForm['phone']),\n\t\t\t\t'~fax' => prepDB($this->registrationForm['fax']),\n\t\t\t\t'~email' => prepDB($this->registrationForm['email']),\n\t\t\t\t'~website' => prepDB($this->registrationForm['website']),\n\t\t\t\t'~password' => prepDB($this->registrationForm['password']),\n\t\t\t\t'~address1' => prepDB($this->registrationForm['address1']),\n\t\t\t\t'~address2' => prepDB($this->registrationForm['address2']),\n\t\t\t\t'~city' => prepDB($this->registrationForm['city']),\n\t\t\t\t'~state' => prepDB($this->registrationForm['state']),\n\t\t\t\t'~postal' => prepDB($this->registrationForm['postal']),\n\t\t\t\t'~country' => prepDB($this->registrationForm['country']),\n\t\t\t\t'agreeTerms' => prepDB($this->registrationForm['agreeTerms']),\n\t\t\t\t'agreePolicy' => prepDB($this->registrationForm['agreePolicy']),\n\t\t\t\t'isOverAge' => prepDB($this->registrationForm['isOverAge']),\n\t\t\t\t'entryDate' => 'NOW()'\n\t\t\t\t\n\t\t\t);\n\t\t\t$this->dbh->perform('affiliates', $queryVals);\n\t\t}", "public function testPayoutsTableCount()\n {\n $inflationEffect = factory(InflationEffect::class, 1)->create([\n 'amount' => '1000'\n ]);\n\n $activeAccounts = factory(ActiveAccount::class, 5)->states('real-stellar-account')->create();\n\n $this->payoutService->init();\n\n $this->payoutService->setInflationEffect($inflationEffect->first());\n\n $this->payoutService->executeActiveAccountsPayout($activeAccounts);\n\n $payouts = PayoutModel::count();\n\n $this->assertEquals($activeAccounts->count(), $payouts);\n }", "public function addAccount(array $data)\n {\n return parent::addAccount($data);\n }", "public function new_address() {\n\t\t$address = new Address();\n\n\t\t/*\n\t\t * Twinfield requires one default address:\n\t\t * \"There has to be one default address.\"\n\t\t */\n\t\tif ( empty( $this->addresses ) ) {\n\t\t\t$address->set_default( true );\n\t\t}\n\n\t\t$this->addresses[] = $address;\n\n\t\treturn $address;\n\t}", "public function wallet_accounts(){\n\t//restricted this area, only for admin\n\t\tpermittedArea();\n\t\t$data['earnings'] \t \t= $this->ledger_model->totalEarning();\n\t\t$data['referralEarnings']\t= $this->ledger_model->referralEarnings();\n\t\t$data['total_liabilities'] \t= $this->ledger_model->total_liabilities();\n\t\t$data['total_wallet']\t\t= $this->ledger_model->total_wallet(); //User Total Wallet Points from Accounts Table\n\n\t\t\t$data['assets'] = $this->ledger_model->totalAssets();\n\t\t$data['debits'] = $this->ledger_model->totalDebits();\n\t\t$data['credits'] = $this->ledger_model->totalCredits();\n\t\t$data['wallet'] = $this->ledger_model->totalWallet();\n\t\t$data['usedwallet'] = $this->ledger_model->usedWallet();\n\t\t\n\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'cash_2wallet') die('Error! sorry');\n\n\n\t\t\t$this->form_validation->set_rules('cash', 'Company Cash', 'required|trim');\n\t\t\t$this->form_validation->set_rules('pay_type', 'Payment Type', 'required|trim'); \n\t\t\t$this->form_validation->set_rules('tranx_id', 'Transaction Remarks', 'required|trim'); \t\t\t\t\n\t\t\t\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->cash_2wallet();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Entered Cash Amount Turned to Wallet Points Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttheme('wallet_accounts', $data);\n\t}", "function createAccount($sfConn, $dataArray){\n\t\techo(\"<P> createAccount <P>\");\n $sObjects = array();\n foreach ($dataArray as $fieldset)\n {\n\t\techo(\"<P> Set records to Account <P>\");\n $sObject = new sObject();\n $sObject->type = 'Account'; \n $sObject->fields = $fieldset;\n array_push($sObjects, $sObject);\n\t\t\t\t\necho(\"<P> ACCOUNT DETAILS- type: \" . $sObject->type . \n\t\t\" Dealer: \" . $fieldset['Dealer_Number__c'] . \n\t\t\" Name: \" . $fieldset['Name'] . \n\t\t\t\t\t\t\t\" Owner ID: \" . $fieldset['OwnerId'] .\n\t\t\t\t\t\t\t\" Phone \" . $fieldset['Phone'] .\n\t\t\t\t\t\t\t\" Dealer Auction Access: \" . $fieldset['Dealer_Auction_Access_Number__c'] .\n\t\t\t\t\t\t\t\" Dealer_Status__c: \" . $fieldset['Dealer_Status__c'] .\n\t\t\t\t\t\t\t\" IAA_Territory__c: \" . $fieldset['IAA_Territory__c'] .\n\t\t\t\t\t\t\t\" ID: \" . $sObject->Id .\n\t\t\"\");\n\t\t\n }\n\t\techo(\"<P> Ready to roll <P>\");\n $success = create_multiple($sfConn, $sObjects);\n return $success; \n }", "protected function createUserAccount() {\n\t\treturn new UserAccount();\n\t}", "public function add() {\n $dataH['CustomerBankAccount'] = $_lib['sess']->get_companydef('BankAccount');\n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $dataH['CustomerAccountPlanID'] = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber')));\n }", "public function createAccount($data)\n\t{\n\t\t$this->instanceTwitter();\n\n\t\t$info = $this->twitter->getAccountInfo($data['account_id'], $data['screen_name']);\n\n\t\tif (!isset($info->id)) {\n\t\t\treturn ['status' => 'error', 'error' => 'Ups!!! This account not found.'];\n\t\t}\n\n\t\t$result = DB::insert('INSERT IGNORE INTO accounts (refresh_interval, account_id, screen_name, title, updated_at) VALUES (?, ?, ?, ?, ?)',\n\t\t\t[$data['refresh_interval'], $data['account_id'], $info->screen_name, $info->description, '2000-01-01 01:01:01']);\n\t\t\n\t\tif ($result) {\n\t\t\treturn ['status' => 'success', 'title' => $info->description];\n\t\t} else {\n\t\t\treturn ['status' => 'error', 'error' => 'Ups!!! Not introduced in the base.'];\n\t\t}\n\t}", "public function createCustodyAccount($user_email, $user_name, $token_symbol, $token_count, $jwt_token) {\n $body = [ \n 'data' => [ \n 'type' => 'account', \n 'attributes' => [\n 'account-type' => 'custodial',\n 'name' => $user_name,\n 'authorized-signature' => $user_name,\n 'token_symbol' => $token_symbol,\n 'token_count' => $token_count,\n 'owner' => [\n 'contact-type' => 'natural_person',\n 'name' => 'John Doe',\n 'email' => $user_email,\n 'date-of-birth' => '1980-06-09',\n 'sex' => 'male',\n 'tax-id-number' => '123123123',\n 'tax-country' => 'US',\n 'primary-phone-number' => [\n 'country' => 'US',\n 'number' => '7026912020',\n 'sms' => true,\n ],\n 'primary-address' => [\n 'street-1' => '330 S. Rampart',\n 'street-2' => 'Apt 260',\n 'postal-code' => '89145',\n 'city' => 'Las Vegas',\n 'region' => 'NV',\n 'country' => 'US',\n ]\n ]\n ]\n ]\n ];\n\n $res = $this->doRequest($this->base_URL.'v2/accounts', 'post', [ 'body' => json_encode($body) ], $jwt_token, 'Bearer');\n\n return $this->extractData($res, true);\n }", "public function create()\n {\n $this->authorize('admin.billing-account.create');\n\n return view('admin.billing-account.create');\n }", "public function testNewPaidReturnsAccountInsightInstance()\n {\n $this->assertInstanceOf(AccountInsightInterface::class, $this->insight->accounts->addPaid(12345, new PlanM(), new Yearly()));\n }", "public function addAccount()\n {\n $this->_initAddAccountPageDynamicData();\n $user = User::find(Auth::user()->id);\n $userp = Profile::where('id', '=', Auth::user()->id)->first();\n $userb = Business::where('user_id', '=', Auth::user()->id)->first();\n\n return view('User.dashboard.accounts.add', compact('user', 'userp', 'userb'))->with('accountNumberRules', $this->_accountNumberRules)->with('fieldCountries', $this->_fieldCountries);\n }", "public function store(AddressRequest $request)\n {\n $data = $request->only(['cep', 'street', 'city', 'number', 'user_id']);\n $user = \\Authorization::user();\n $model = $user->adresses()->create($data);\n return [\n \"data\" => [\n \"address\" => $model\n ]\n ];\n }", "public function create(){\n\n\t\t$country = Country::orderBy('country_des','asc')->lists('country_des','id');\n\t\t$agencies \t\t= Agency::orderBy('acronym','asc')->lists('acronym','id');\n\t\t\n\t\treturn View::make('admin.akdn.create',compact('country','agencies'));\n\t}", "public function add_number($attributes)\n {\n return $this->numbers()->create($attributes);\n }", "public static function Aaaa($address)\n {\n $rdata = new AaaaRdata();\n $rdata->setAddress($address);\n\n return $rdata;\n }", "public function create()\n {\n\n if (Sentry::check()) {\n $branch_id = Sentry::getUser()->branch_id;\n if (Sentry::getUser()->isSuperUser() || Sentry::getUser()->hasAccess('associate-create')) {\n $rank = Rank::where('company', 0)->lists('rankname', 'id');\n $title = \"Create Associate\";\n $mode = 'create';\n\n return View::make('admin/associates/create', compact('title', 'mode', 'rank', 'branch_id'));\n }\n else {\n return Redirect::to('admin/associates')->with(\n 'error', \" You dont have enough permission to create associates \"\n );\n }\n }\n else {\n return Redirect::route('login')->with('error', \" You are not logged in \");\n }\n }", "protected function create(Request $request)\n {\n $account = new Accounts;\n\n $account->email = $request['email'];\n $account->MD5Password = md5($this->salt . $request['password']);\n $account->AccountStatus = 100;\n $account->IsDeveloper = 0;\n $account->ReferralID = 0;\n $account->dateregistered = (new \\DateTime())->format('Y-m-d H:i:s');\n\n $account->save();\n\n $user = new UsersData;\n\n $user->CustomerID = $account->CustomerID;\n $user->AccountStatus = 100;\n $user->IsDeveloper = 0;\n $user->AccountType = 2;\n $user->GamePoints = 0;\n $user->GameDollars = 0;\n $user->dateregistered = (new \\DateTime())->format('Y-m-d H:i:s');\n $user->lastjoineddate = '1973-01-01 00:00:00.000';\n $user->lastgamedate = '1973-01-01 00:00:00.000';\n $user->ClanID = 0;\n $user->ClanRank = 99;\n $user->CharsCreated = 0;\n $user->TimePlayed = 0;\n $user->DateActiveUntil = '2030-01-01 00:00:00.000';\n $user->BanCount = 0;\n\n $user->save();\n\n return redirect('login');\n\n }", "public function create()\n\t{\n\t\t$accounts = Account::where('organization_id',Confide::user()->organization_id)->where('active',true)->get();\n\t\treturn View::make('paymentmethods.create',compact('accounts'));\n\t}", "public function create()\n {\n $data['aafields'] = AASource::all()->where('status','=',1)->ToArray();\n return view(\"applicationaccount\")->with($data);\n\n }", "public function addAddress($address, $name = '')\n {\n }", "public function addAddress($address) {\n\t\t$userAddress = new MUserAddress();\n\t\t$userAddress->userId = $this->id;\n\t\t$userAddress->name = $address['name'];\n\t\t$userAddress->detail = $address['detail'];\n\t\t$userAddress->longitude = $address['longitude'];\n\t\t$userAddress->latitude = $address['latitude'];\n\t\t$userAddressList = $userAddress->find();\n\t\tif (count($userAddressList) > 0) {\n\t\t\tthrow new \\Exception('不可以添加重复的地址哦~');\n\t\t} else {\n\t\t\t$userAddress->insert();\n\t\t}\n\t}", "function roomify_conversations_add_booking_address() {\n field_info_cache_clear();\n\n // \"booking_address\" field.\n if (field_read_field('booking_address') === FALSE) {\n $field = array(\n 'field_name' => 'booking_address',\n 'type' => 'addressfield',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(),\n );\n field_create_field($field);\n }\n\n field_cache_clear();\n\n // \"booking_address\" field instance.\n if (field_read_instance('bat_booking', 'booking_address', 'conversation_booking') === FALSE) {\n $instance = array(\n 'field_name' => 'booking_address',\n 'entity_type' => 'bat_booking',\n 'label' => 'Address',\n 'bundle' => 'conversation_booking',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'addressfield_standard',\n 'settings' => array(\n 'default_country' => '',\n ),\n ),\n );\n field_create_instance($instance);\n }\n}", "public function create()\n {\n //create a new account\n return view('account');\n }", "public static function address($address){\n $addre = Address::where('user_id',Auth::id())->where('address_type',$address['address_type'])->first();\n if ($addre){\n $addre->update($address);\n }else{\n Address::create($address);\n }\n }", "public function account(): Account\n {\n return new Account($this);\n }" ]
[ "0.5495981", "0.5204191", "0.5130756", "0.5095464", "0.50783503", "0.5030515", "0.50216925", "0.50149524", "0.49880034", "0.49703243", "0.4940253", "0.48611414", "0.48191774", "0.47836602", "0.47738028", "0.47307318", "0.4721183", "0.47181705", "0.47152817", "0.4708148", "0.47021753", "0.46953124", "0.46524745", "0.46507457", "0.46430376", "0.46371868", "0.46209124", "0.46206468", "0.461974", "0.4617342", "0.46168917", "0.46106556", "0.4606209", "0.4601193", "0.45981485", "0.4594647", "0.45907074", "0.45797482", "0.45789436", "0.4566309", "0.45570415", "0.455639", "0.4546937", "0.4546446", "0.45430973", "0.45377633", "0.45219037", "0.45186138", "0.45004034", "0.44967353", "0.44942427", "0.44940272", "0.44765303", "0.44711766", "0.44619042", "0.44299898", "0.44262257", "0.44240564", "0.44124776", "0.44083413", "0.4407517", "0.44041973", "0.44015566", "0.43984404", "0.43973625", "0.43965295", "0.4387126", "0.43848923", "0.4383592", "0.4382802", "0.43821338", "0.43723154", "0.43659452", "0.43658942", "0.43620142", "0.43606642", "0.43562695", "0.4355896", "0.43531153", "0.43402737", "0.43398008", "0.4337866", "0.43333805", "0.4331658", "0.43299586", "0.43239027", "0.43185228", "0.43177876", "0.43168527", "0.43098086", "0.43090177", "0.43065834", "0.4298883", "0.4297672", "0.4297459", "0.42937723", "0.42930034", "0.4292702", "0.42900196", "0.42877233" ]
0.45667863
39
Updates an existing account
public function updateAccount($account_uuid, $account_name=null, $meta_data=null) { $body = []; if ($account_name !== null) { $body['name'] = $account_name; } if ($meta_data !== null) { $body['meta'] = $meta_data; } $result = $this->newAPIRequest('PATCH', '/accounts', $body); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateAccount()\n {\n $user = Auth::user();\n\n if(Input::get('edit')) {\n\n $manager = new AccountManager($user, Input::all());\n if ($manager->save()) {\n\n return Redirect::route('home');\n } else {\n return Redirect::back()->withInput()->withErrors($manager->getErrors());\n }\n }\n elseif(Input::get('delete'))\n {\n $user = Auth::user();\n $id =$user->id;\n User::destroy($id);\n return Redirect::route('home')->with('user_deleted', 1);\n }\n }", "public function update_account() {\n global $dbconfig;\n\n $user_id = $this->params['user_id'];\n $status = isset($this->params['status']) ? $this->params['status'] : BLOCKED;\n $account_dbobj = $this->params['account_dbobj'];\n $user_status = BLOCKED;\n $store_status = PENDING;\n\n if($status === ACTIVATED) {\n $user_status = CREATED;\n $store_status = PENDING;\n }\n\n // update users table\n $user_obj = new User($account_dbobj, $user_id);\n $user_obj->setStatus($status);\n $user_obj->save();\n\n $user = BaseModel::findCachedOne($dbconfig->account->name . \".user?id=$user_id\");\n if(!empty($user['store_id'])){\n $store_id = $user['store_id'];\n // store need to manually launch\n $store_obj = new Store($account_dbobj, $store_id);\n if($store_obj->getId()) {\n $store_obj->setStatus($store_status);\n $store_obj->save();\n if($store_status != ACTIVATED){\n GlobalProductsMapper::deleteProductsInStore($account_dbobj, $store_id);\n }\n }\n }\n }", "public function update_account()\n\t{\n\t\t$data = $this->input->post();\n\t\t\n\t\t$success = $this->user_model->safe_update($this->user->id, $data);\n\t\t\n\t\tif ( $success )\n\t\t{\n\t\t\t$this->json['message'] = 'Your account details have been successfully updated.';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->json['status'] = 'error';\n\t\t\t$this->json['message'] = 'There were errors when attempting update your account.';\n\t\t}\n\t\t\n\t\t$this->json['content'] = $this->update_account_content();\n\t\t\n\t\treturn $this->ajax_response();\n\t}", "public function update($medAccount);", "public function put()\n {\n $request = new EditRequest();\n\n $account = new User();\n\n $account->update($_SESSION['user'], [\n 'first_name' => $request->first_name,\n 'last_name' => $request->last_name,\n 'password' => $request->password,\n 'email' => $request->email,\n ]);\n\n Redirect::route('account');\n }", "public function update(Request $request, Account $account) {\n //\n }", "public function updateAccount(UpdateAccountRequest $request)\n {\n $user = Auth::user();\n $user->password = Hash::make($request->get('password'));\n $user->save();\n\n flashy()->success('密码修改成功, 请重新登陆');\n Auth::logout();\n\n return $this->redirectToRoute('auth.login');\n }", "public function update(Request $request, Account $account)\n {\n //\n }", "public function update(Request $request, Account $account)\n {\n //\n }", "public function update(Request $request, Account $account)\n {\n //\n }", "public function update(Request $request, Account $account)\n {\n //\n }", "public static function update ($account) {\n // Retrieve account resources.\n $list = Json::update('account', $account);\n\n // If resource not found.\n if ($list == 1)\n return 1;\n // If object not found.\n if ($list == 2)\n return 2;\n\n // If save was successful.\n return 0;\n }", "public function apiUpdate()\n {\n // Update only if account key existe and Account status is active\n $apiKey = Mage::getStoreConfig('steerfox_plugins/account/api_key');\n $accountStatus = Mage::getStoreConfig('steerfox_plugins/account/status');\n\n if (!empty($apiKey) && 1 == $accountStatus) {\n $coreHelper = Mage::helper('steerfox_plugins/core_data');\n $steerfoxContainer = $coreHelper->getSteerfoxContainer();\n $steerfoxApi = $steerfoxContainer->get('api');\n $steerfoxApi instanceof SteerfoxApiService;\n $result = $steerfoxApi->updateAccount();\n\n if (!$result) {\n Mage::getSingleton('core/session')->addError('Steerfox update account : Error occurred.');\n }\n\n Mage::app()->getStore()->resetConfig();\n }\n }", "public function update(Request $request, Account $account)\n {\n $this->validate($request, [\n \"payment_method_id\" => \"required\",\n \"bank_id\" => \"required\",\n ]);\n\n $account->payment_method_id = $request->payment_method_id;\n $account->bank_id = $request->bank_id;\n $account->account_name = $request->account_name;\n $account->account_no = $request->account_no;\n $account->opening_amount = $request->opening_amount;\n $account->contract_person = $request->contract_person;\n $account->contract_phone = $request->contract_phone;\n $account->address = $request->address;\n\n $account->created_by = auth()->user()->id;\n if ($account->save()) {\n $notification = array(\n 'message' => 'Successfully Account updated!',\n 'alert-type' => 'success'\n );\n } else {\n $notification = array(\n 'message' => 'Someting Went Wrong!',\n 'alert-type' => 'error'\n );\n }\n return redirect()->route('admin.account.index')->with($notification);\n }", "public function account_update_info()\n\t{\n\t\t$data = $this->input->post();\n\t\tif ($this->ion_auth->update($this->mUser->id, $data))\n\t\t{\n\t\t\t$messages = $this->ion_auth->messages();\n\t\t\t$this->system_message->set_success($messages);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errors = $this->ion_auth->errors();\n\t\t\t$this->system_message->set_error($errors);\n\t\t}\n\n\t\tredirect('admin/panel/account');\n\t}", "public function update(UpdateAccountRequest $request)\n\t{\n\t\t$user = \\Auth::user();\n\t\t$user->name = $request->name;\n $user->email = $request->email;\n\t\t$oldpass = $request->oldpass;\n\t\t$newpass = $request->newpass;\n\t\t$confirmpass = $request->newpass_confirmation;\n\t\tif(!empty($oldpass) || !empty($newpass) || $confirmpass) {\n\t\t\t// Check oldpass is true\n\t\t\tif(Hash::check($oldpass,$user->password)) {\n\t\t\t\t// Check newpass and confirmpass are the same\n\t\t\t\tif($newpass == $confirmpass) {\n\t\t\t\t\t$user->password = Hash::make($newpass);\n\t\t\t\t} else {\n\t\t\t\t\t\\Session::flash('notify-type', 'error');\n\t\t\t\t\t\\Session::flash('message', 'Passwords provided were not the same.');\n\t\t\t\t\treturn redirect()->back();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t\\Session::flash('notify-type', 'error');\n\t\t\t\t\\Session::flash('message', 'The old password provided was incorrect.');\n return redirect()->back();\n\t\t\t}\n\t\t}\n\t\t$result = $user->save();\n\t\tif($result) {\n\t\t\t\\Session::flash('message', $user->name.' was updated successfully.');\n\t\t\treturn redirect('/account');\n\t\t}\n\t}", "public function update(Request $request)\n {\n $user = \\App\\User::find((Auth::user()->id));\n \n $request->validate([\n 'name' => ['string', 'max:255','required'],\n 'email' => ['string', 'email', 'max:255','required'],\n 'password' => ['string', 'min:8','required'],\n\t\t\t'address' => ['string', 'max:255'],\n\t\t\t'phone' => ['string', 'max:20'],\n ]);\n \n\t\t\t$user->name = $request->name;\n\t\t\t$user->email = $request->email;\n\t\t\t$user->address = $request->address;\n\t\t\t$user->phone = $request->phone;\n\t\t\t$user->updated_at = date('Y-m-d');\n \n $user->save();\n \n return redirect()->action('auth\\EditAccountController@edit')->with('status', 'Account updated!');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request,['account_name' => 'required', 'account_number' => 'required', 'account_type' => 'required']);\n \n \n $account = accounts::find($id);\n $account->account_name = $request->account_name;\n $account->account_number = $request->account_number;\n $account->account_type = $request->account_type;\n $account->save();\n return redirect()->route('account.index')->with('success','Account Updated Successfully');\n }", "private function editAccount()\n {\n try\n {\n global $userquery; \n\n $request = $_REQUEST;\n\n if(!userid())\n throw_error_msg(\"Please login to perform this action\");\n\n //country\n if(!isset($request['country']) || $request['country']==\"\")\n throw_error_msg(\"provide country\");\n\n //sex\n if(!isset($request['sex']) || $request['sex']==\"\")\n throw_error_msg(\"provide sex\");\n\n if(!in_array($request['sex'], array('male','female')))\n throw_error_msg(\"sex must be male/female\");\n\n //dob\n if(!isset($request['dob']) || $request['dob']==\"\")\n throw_error_msg(\"provide dob\");\n\n if(!isset($request['dob']) || $request['dob']==\"\")\n throw_error_msg(\"provide dob\");\n\n $is_valid_date = DateTime::createFromFormat('Y-m-d', $request['dob']);\n\n if(!$is_valid_date)\n throw_error_msg(\"dob must be in Y-m-d like 1990-11-18 format\");\n\n if(!isset($request['category']) || $request['category']==\"\")\n throw_error_msg(\"provide category\");\n\n $request['userid'] = userid();\n $userquery->update_user($request);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $user_info = format_users($request['userid']);\n \n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $user_info);\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "public function update(AccountRequest $request, $id)\n {\n //update an existing account entry\n Account::find($id)->update($request->all());\n \\Session::flash('success','Update Successfully!');\n return redirect(route('account.index'));\n\n }", "function eventUpdateAccount(){\r\n\t\t$userid = util::getData(\"id\");\r\n\t\t$selectedPermissions = util::getData(\"customPermissions\");\r\n\t\t$selectedTables = util::getData(\"selectedTables\");\r\n\t\t$tableAccess = util::getData(\"tableAccess\");\r\n\t\t$accountType = util::getData(\"accountType\");\r\n\r\n\t\t//make sure we can modify this account\r\n\t\tif(!$this->canUpdateUser($userid))\r\n\t\t\treturn $this->setEventResult(false, \"You cannot update this account\");\r\n\r\n\t\t$result = dkpAccountUtil::UpdateSecondaryAccount($this->guild->id, $userid, $selectedPermissions, $selectedTables, $tableAccess, $accountType);\r\n\r\n\t\tif($result != dkpAccountUtil::UPDATE_OK)\r\n\t\t\t$this->setEventResult(false, dkpAccountUtil::GetErrorString($result));\r\n\t\telse\r\n\t\t\t$this->setEventResult(true,\"Account Updated!\");\r\n\t}", "public function updateAccount(Request $request)\n {\n $user_id = Util::getUserIdFromApiToken($request->data[\"api_token\"]);\n if ($user_id === null) {\n return Util::getInvalidApiTokenResponse();\n } else {\n return Accounts::updateAccount($user_id, $request->data);\n }\n }", "public function updateAction(Account $account) {\n\n\t\t$this->accountRepository->update($account);\n\t\t$this->partyRepository->update($account->getParty());\n\n\t\t$this->addFlashMessage('The profile has been updated.');\n\n\t\t$referrer = $this->request->getReferringRequest();\n\t\t$this->redirect($referrer->getControllerActionName(), $referrer->getControllerName());\n\t}", "public function account_updated(){\n $this->log();\n http_response_code(200);\n ob_end_flush();\n }", "public function updateAccount(Request $r)\n {\n $this->validate($r, [\n 'email' => 'required',\n 'password' => 'required'\n ]);\n DB::table('users')->where('id', $r->id)->update([\n 'email' => $r->email,\n 'password' => Hash::make($r->password)\n ]);\n return redirect('/dashboard');\n // dd($r->id);\n }", "public function account_update($data, $id)\n {\n $this->db->update('customer', $data, array('id' => $id));\n }", "public function update(UpdateRequest $request,Account $account)\n {\n if($account->orders->count() < 0){\n return redirect()->route('account.index')->with('error','Cập nhật thất bại');\n }\n else{\n $account->update($request->only('name','email','phone','password','role','address','status'));\n return redirect()->route('account.index')->with('success','Cập nhật thành công');\n }\n \n }", "public function updateAccount($uid, array $data)\n {\n return parent::updateAccount($uid, $data);\n }", "public function updateAction(Request $request, $id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('AcmebsceneBundle:Account')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Account entity.');\n }\n $isAdmin = $entity->getIsAdmin();\n if ($isAdmin) {\n $organization = $em->getRepository('AcmebsceneBundle:Organization')->findOneBy(array('name' => 'BScene'));\n $adminTemplate = true;\n $entity->setOrganization($organization);\n $entity->setBusinessPhone('NA');\n } else {\n $adminTemplate = false;\n }\n\n $deleteForm = $this->createDeleteForm($id);\n $editForm = $this->createEditForm($entity);\n $editForm->handleRequest($request);\n\n if ($editForm->isValid()) {\n $plainPassword = $entity->getPassword();\n $encoder = $this->container->get('security.password_encoder');\n $encoded = $encoder->encodePassword($entity, $plainPassword);\n $entity->setPassword($encoded);\n $em->persist($entity);\n $em->flush();\n\n if ($isAdmin) {\n return $this->redirect($this->generateUrl('acmebscene_adminProfile', array('id' => $id)));\n } else {\n return $this->redirect($this->generateUrl('account_show', array('id' => $id)));\n }\n }\n\n return $this->render('AcmebsceneBundle:Account:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n 'adminTemplate' => $adminTemplate,\n ));\n }", "public function update(Request $request, Account $account)\n {\n if (isset($request->username)) {\n\n $account->username = $request->username;\n }\n if (isset($request->email)) {\n\n $account->email = $request->email;\n }\n if (isset($request->password)) {\n $account->password = md5($request->password);\n }\n if (isset($request->role)){\n $account->role = $request->role;\n }\n if ($request->hasFile('image')) {\n $file = $request->file('image');\n // lấy phần mở rộng (extension) của file để kiểm tra xem\n // đây có phải là file hình\n $extension = $file->getClientOriginalExtension();\n if ($extension != 'jpg' && $extension != 'jpeg' && $extension != 'png') {\n return redirect()->route('admin.account.create');\n }\n\n $imgName = $file->getClientOriginalName();\n // copy file vào thư mục public/images\n $file->move('images', $imgName);\n // tạo phần tử image trong mảng $account\n $account['image'] = $imgName;\n }\n $account->save();\n // $account->update($input);\n if (isset($request->password)){\n return redirect()->route('admin.login');\n } else {\n\n return redirect()->route('admin.account.index');\n }\n // ->with('success','Product updated successfully');\n }", "function updateAccount($accountId, $username, $password, $retypedPassword, $email, $status)\n\t\t{\n // escape the characters that are needed to escaped to avoid sql injection\n $username = mysql_escape_string($username);\n $password = mysql_escape_string($password);\n $retypedPassword = mysql_escape_string($retypedPassword);\n $email = mysql_escape_string($email);\n \n\t\t\t// validate the username\n\t\t\t$usernameError = $this -> validateUsername($accountId, $username);\n\t\t\t\n\t\t\t// validate the password\n\t\t\t$passwordError = $this -> validatePassword($password, $retypedPassword);\n\t\t\t\n\t\t\t// validate the email\n\t\t\t$emailError = $this -> validateEmail($accountId, $email);\n\t\t\t\n\t\t\t// check for errors\n\t\t\tif($usernameError == null && $passwordError == null && $emailError == null)\n\t\t\t{\n\t\t\t\t// if validation has passed, update the account\n\t\t\t\tmysql_query(\"UPDATE argus_accounts SET username = '\".$username.\"', password = '\".$password.\"', email = '\".$email.\"', status = '\".$status.\"' WHERE account_id = '\".$accountId.\"'\") or die(mysql_error());\n\t\t\t\t\n\t\t\t\t// return successful update\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// if validation failed, set the errors\n\t\t\t\t$this -> errors = array(\"username\" => $usernameError, \"password\" => $passwordError, \"email\" => $emailError);\n\t\t\t\t\n\t\t\t\t// return unsuccessful update\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\treturn;\n\t\t}", "public function account_update()\n {\n $user = Auth::user();\n \n $input = request()->validate([\n 'name' => 'required|string|max:255',\n 'email' => 'required|string|email|max:255|unique:users,email,' . request()->user()->id,\n 'phone' => 'required|string|max:255|unique:users,phone,' . request()->user()->id,\n 'password' => 'nullable|string|min:6|confirmed',\n 'password_old' => 'nullable|string|min:6',\n 'profile_picture' => 'nullable|image'\n ]);\n // var_dump($input['profile_picture'] );exit;\n if(request()->profile_picture) {\n $input['profile_picture'] = $this->image_upload(request(),'profile_picture');//request()->profile_picture->store('profile_pictures');\n // $input->profile_picture = $picture;\n }\n if (empty($input['password'])) {\n unset($input['password']);\n } else {\n if (Hash::check(request()->password_old, request()->user()->password)) {\n $input['password'] = bcrypt($input['password']);\n }\n }\n request()->user()->update($input);\n\n return back();\n }", "public function updateUser()\n {\t\t\n\t\t$user = $this->checkToken();\n\t\tif ($user) {\t\n\t\t\t$userModel = UserModel::find($user->id);\n\t\t\t$data = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\t\t\t$userModel->fill($data);\n\t\t\t$userModel->save();\n\t\t\treturn $this->sendResponse('Your details have been successfully updated');\n\t\t}\n\t\treturn $this->sendResponse('You are not authorised to update this account');\n }", "public function update( $id , UpdateAccountRequest $request )\n {\n // Fetch the account record from the database.\n //\n $account = $this->accountRepository->byIdAndUser( $id, Auth::user());\n\n // Update the account record with new data.\n //\n $this->accountRepository->update( $account, $request->all());\n\n // Return a successful response.\n //\n return $this->response( $account );\n }", "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 updateMyAccountInfo()\n {\n $ajax_data = array();\n $post = $this->request->request->all();\n \n // validate POST parameters\n $result = $this->user_logic->validateAccountInfoPostData($post);\n if (($result['error'] == '') AND ! empty($result['params'])) {\n $user_id = $this->user_session->getUserId();\n $update = $this->user_logic->updateUserInfo($user_id, $result['params']);\n if ($update !== false) {\n $ajax_data['code'] = 0;\n $ajax_data['data'] = $post;\n $ajax_data['message'] = 'Updated Account Information'; \n } else {\n $errors = $this->user_logic->getErrorMessage();\n if (! empty($errors) AND is_array($errors)) {\n $errors = implode(',',$errors);\n } else {\n $errors = 'Failed to update account info due to database error';\n }\n \n $ajax_data['code'] = 1;\n $ajax_data['message'] = $ajax_data['validation_error'][] = $errors;\n }\n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = $ajax_data['validation_error'][] = $result['error']; \n }\n \n $this->ajax_respond($ajax_data);\n }", "public function update(Request $request, $id)\n {\n $a=$request['balance'];\n $amount= str_replace(',','',$a) ;\n $account = AccountModel::find($id); //find the primary key of User table\n $action= $account->update ([\n 'ACCOUNT_NAME' => $request['name'],\n 'PARENT_ACCOUNT' => $request['type'],\n 'ACCOUNT_DESCRIPTION' => $request['naration'],\n 'AFFECTS' => implode(\",\",$request['affects']),\n 'ACCOUNT_BALANCE' => $amount,\n \n 'BALANCE_TYPE' => $request['balance_type'],\n 'BUSINESS_PERSON' => $request['people'],\n \n\n ]);\n \n if (!$action) {\n return redirect()->back()->with(\"error_message', 'Account successfully updated!\");\n \n }\n \n \n return \\Redirect::to('view_accounts');\n }", "public function update(AccountUpdateRequest $request, $id)\n {\n $account = Account::find($id);\n\n $account->fill($request->all())->save();\n\n return redirect()->route('cuentas.edit', $account->id)->with('info', 'Etiqueta actualizada con exito');\n }", "public function update(AccountRequest $request, $account)\n {\n $account->update($request->all());\n\n return response()->json([\n 'success' => 'Les informations du compte ont été mises à jour.',\n ]);\n }", "public function update(){\n\t\t\t$record = $this->modelGetrenter_user();\n\t\t\tinclude \"Views/AccountUpdateView.php\";\n\t\t}", "public function update(Request $request, $id)\n {\n $account = Account::find($id);\n $fields = $request->validate([\n 'name' => 'string',\n 'email' => 'string|',\n 'amount' => 'integer',\n 'password' => 'string|confirmed'\n ]);\n\n $account->update([\n 'name' => $fields['name'],\n 'email' => $fields['email'],\n 'amount' => $fields['amount'],\n 'password' => bcrypt($fields['password'])\n ]);\n $account->save();\n return $account;\n }", "public function update()\n {\n $user = Auth::user();\n\n $data = request()->validate([\n 'name' => 'required|string',\n 'email' => 'required|string|email|max:255|unique:users,email,' . $user->id,\n ]);\n\n $user->update($data);\n }", "public function update($id,$acct,$data=[])\n {\n extract_args($data, [\n 'nickname' => '',\n 'auto_pay_active' => null,\n 'active' => null,\n ]);\n return $this->put(\"debt/{$id}/payaccounts/{$acct}\", $data);\n }", "public function update($id, Request $request)\n {\n $this->validate($request, [\n\t\t\t'ig_username' => 'required'\n\t\t]);\n $requestData = $request->all();\n \n $account = Account::findOrFail($id);\n $account->update($requestData);\n\n Session::flash('flash_message', 'Account updated!');\n\n return redirect('a/accounts');\n }", "private function updateAccount($stripeAccount, $data, $account)\n {\n $result = null;\n if ($account->legal_entity->verification->status == 'unverified'\n || $account->legal_entity->verification->status == 'pending') {\n $result = $stripeAccount->documentUploaded(\n $account->id,\n $data['photo'],\n $this->getParameter('tmp_directory')\n );\n if (!$result['success']) {\n return $result;\n }\n\n $result = $stripeAccount->documentAttachment($account->id, $result['uploadedFile']);\n if (!$result['success']) {\n return $result;\n }\n }\n\n $result = $stripeAccount->createExternalAccount($account->id, $data, $data['currency'], $data['country']);\n if (!$result['success']) {\n return $result;\n }\n\n return $stripeAccount->updateAddress($account->id, $data);\n }", "public function update(Request $request,$id)\n {\n $validation=[\n\n 'name'=>'required',\n 'email'=>'required|unique:users,email,'.$id,\n \n 'position'=>'required',\n 'username'=>'required|unique:users,username,'.$id,\n 'id_number'=>'required|unique:users,id_number,'.$id,\n 'factory'=>'required', \n 'contact'=>'required',\n 'role'=>'required',\n 'active'=>'required',\n\n 'shift_start'=>'nullable|numeric',\n 'shift_end'=>'nullable|numeric',\n 'break_time'=>'nullable|numeric',\n\n ];\n\n # Validate password if there has a value\n if(!empty($request['password']))\n $validation['password']=['required', 'string', 'min:6', 'confirmed'];\n\n $this->validate($request,$validation);\n\n $account=User::find($id);\n abort_if($account==null,404,'Account could not be found!');\n\n \n try {\n DB::beginTransaction();\n\n $account->name=strtoupper($request['name']);\n $account->email=$request['email'];\n $account->position=$request['position'];\n $account->username=$request['username'];\n $account->updated_by=auth()->user()->name;\n $account->active=$request['active'];\n\n $account->id_number=strtoupper($request['id_number']);\n $account->factory=$request['factory'];\n $account->role=$request['role'];\n $account->contact=$request['contact'];\n\n $account->shift_start=$request['shift_start'];\n $account->shift_end=$request['shift_end'];\n $account->break_time=$request['break_time'];\n \n if(!empty($request['password']))\n if(\\Hash::needsRehash($request['password']))\n $account->password=bcrypt($request['password']);\n\n if($account->isDirty('email'))\n Ticket::where('sender_email',$account->getOriginal('email'))\n ->update(['sender_email'=>$account->email]);\n\n $account->save();\n DB::commit();\n \n\n return response()->json(['message'=>'Account has been successfully updated!']);\n\n } catch (\\Throwable $th) {\n DB::rollBack();\n abort(442,$th->getMessage());\n }\n }", "public function update(Request $request, $id)\n {\n //\n \n\n\n $account = Account::find($id);\n\n $account->name = $request->name ? $request->name : $account->name;\n $account->phone = $request->phone ? $request->phone : $account->phone;\n $account->gender = $request->gender ? $request->gender : $account->gender;\n $account->level = $request->level ? $request->level : $account->level;\n $account->email = $request->email ? $request->email : $account->email;\n $account->password = $request->password ? Hash::make($request->password) : $account->password;\n $account->token = $request->token ? $request->token : $account->token;\n $account->photo = $request->photo ? $request->file('photo')->store('docs','public') : $account->photo;\n \n\n $account->save();\n return redirect('account');\n }", "public function updateAccount( array $data )\n\t{\n\t\t$passquery = '';\n\t\tif( !empty($data['password']) )\n\t\t{\n\t\t\t$passquery = 'password = :passwd,';\n\t\t}\n\n\t\t$stmt = $this->connection->prepare('UPDATE \n\t\t\t\t\t\t\t\t\t\t\t\t' . Configure::get('database/prefix') . 'accounts\n\t\t\t\t\t\t\t\t\t\t\tSET\n\t\t\t\t\t\t\t\t\t\t\t\t' . $passquery . '\n\t\t\t\t\t\t\t\t\t\t\t\temail = :email,\n\t\t\t\t\t\t\t\t\t\t\t\temail_hash = :hash\n\t\t\t\t\t\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\t\t\t\t\t\tid = :uid');\n\t\t$stmt->bindValue(':uid', $data['id'], PDO::PARAM_INT);\n\t\t$stmt->bindValue(':email', $data['email'], PDO::PARAM_STR);\n\t\t$stmt->bindValue(':hash', $data['hash'], PDO::PARAM_STR);\n\n\t\tif( !empty($data['password']) )\n\t\t{\n\t\t\t$stmt->bindValue(':passwd', $data['password'], PDO::PARAM_STR);\n\t\t}\n\n\t\t$success = $stmt->execute();\n\t\t$affected = $stmt->rowCount();\n\t\t$error = $stmt->errorInfo();\n\t\t$stmt->closeCursor();\n\n\t\treturn array(\n\t\t\t'success' => $success,\n\t\t\t'affected_rows' => $affected,\n\t\t\t'error' => $error\n\t\t);\n\t}", "public function update($accountid, AccountInfo $account) {\n\t\tif (!$account->validate()) {\n\t\t\tthrow new iGivefirst_AccountInformationIncomplete();\n\t\t}\n\t\t\n\t\t$req = $this->api->client->put('/account/' . $accountid);\n\t\t$req->setBody(json_encode($account), 'application/json');\n\t\t\n\t\ttry {\n\t\t\t$this->api->execute($req);\n\t\t}\n\t\tcatch(iGivefirst_HttpError $e) {\n\t\t\tthrow new iGivefirst_AccountNotUpdated($e);\n\t\t}\n\t}", "public function update($id, Request $request)\n {\n \n $requestData = $request->all(); \n $account = Account::findOrFail($id);\n $account->update($requestData);\n Session::flash('flash_message', 'Account updated!');\n return Redirect::back()->with('message','Operation Successful !');\n }", "public function edit(Account $account)\n {\n //\n }", "public function edit(Account $account)\n {\n //\n }", "public function edit(Account $account)\n {\n //\n }", "public function edit(Account $account)\n {\n //\n }", "public function edit(Account $account)\n {\n //\n }", "public function update(Request $request, $id)\n {\n $acunt = Account::find($id);\n $acunt->update($request->input());\n session()->flash('status', 'Account is Updated');\n return redirect()->route('admin.accounts.index');\n }", "public function updateAccountInfo( AccountInfo $accountInfo): AccountInfo\n {\n \treturn $this->client->accountService->updateAccountInfo( $this->token, $accountInfo );\n }", "public function edit(Account $account) {\n //\n }", "public function updateAccount($val = null) {\r\n $query = 'UPDATE MEMBER SET';\r\n $mod = 0;\r\n foreach ($val as $k => $v) {\r\n if ($k != 'UID') {\r\n if ($mod++ > 0)\r\n $query .= ', ';\r\n $query .= ' ' . $k . ' = \\'' . $v . '\\'';\r\n }\r\n }\r\n $query .= ' WHERE UID = ' . $this->db->scrub($val['UID']);\r\n \r\n $this->db = new Db();\r\n $this->db->select($query);\r\n $val['ISADMIN'] = null;\r\n \r\n // Set the current session up with the new values\r\n $this->assignSession($val); \r\n \r\n // Log it\r\n $log = new Logger();\r\n $log->log('User '.$val['UID'].' updated their profile', $_SERVER['REMOTE_ADDR'], 'INFO');\r\n return(true);\r\n }", "public function update(apiaccountrequest $request, $id)\n {\n $input = $request->all();\n $api = Apilogins::findOrFail($id);\n $api[\"apilogin\"] = $input[\"login\"];\n $api[\"apikey\"] = $input[\"key\"];\n $api[\"hostname\"] = $input[\"host\"];\n $api->save();\n return redirect()->route('apiaccount.index');\n\n }", "public function post_account()\n {\n $rules = array();\n $rules['username'] = 'required|min:4|max:32';\n $rules['email'] = Input::has('email') ? 'required|email' : '';\n $rules['password'] = Input::has('email') ? 'required|confirmed|min:4|max:32' : '';\n\n $v = Validator::make( Input::all(), $rules );\n if ($v->fails()) {\n return Redirect::to( Config::get('user.account_route', Config::get('user::config.account_route')) )\n ->with_errors($v)\n ->with_input();\n }\n\n Auth::user()->username = Input::get('username');\n Auth::user()->email = Input::get('email');\n\n // Leave password alone if the user doesn't want to change it\n if(Input::has('password')) {\n Auth::user()->password = Input::get('password');\n }\n\n Auth::user()->save();\n\n Event::fire('user: account updated');\n\n return Redirect::to( Config::get('user.account_route', Config::get('user::config.account_route')) )\n ->with('success', 'Account changes saved');\n }", "public function update($id)\n {\n return 'accounts.update';\n }", "public function update() {\n\t\t$db = Database::getInstance();\n\t\t$stmt = $db->prepare(\"UPDATE users SET mail=?, name=?, password=?, state=? WHERE id = ?\");\n\t\t$stmt->execute(array($this->mail, $this->name, $this->password, $this->state, $this->id));\n\t}", "public function update(Request $request,$id)\n { \n try {\n $user = User::findOrFail($id);\n } catch (ModelNotFoundException $e) {\n return \"Account doesn't exist\";\n }\n\n $user->update([\n 'password' => bcrypt(request('password')),\n 'phone_no' => request('phone_no'),\n\n ]); \n\n if($user->save()){\n //return new UserResource($user);\n return \"Success update user\";\n }\n }", "public function update(Request $request, Account $account)\n {\n $validatedData = $this->accounts->validateUpdate($request);\n\n $result = $this->accounts->update($validatedData, $account->id);\n\n $success = $result ? true : false;\n\n return redirect()\n ->route('account.accounts.index')\n ->with('message', self::getMessage('update', $success));\n }", "public function testUpdateUser()\n {\n $userData = [\n \"name\" => \"User 2\",\n \"email\" => \"user2@gmail.com\",\n \"password\" => \"demo12345123\",\n \"org_id\" => 2\n ];\n $id = 4;\n $this->json('PUT', \"api/user/update/$id\", $userData, ['Accept' => 'application/json'])\n ->assertStatus(200)\n ->assertJsonStructure([\n \"action\",\n \"data\" => [],\n \"status\"\n ]);\n }", "function mint_update_account($session, $token, $account_id, $account_name, $total) {\n $_post = array(\n \"accountId\" => $account_id,\n \"types\" => \"ot\",\n \"accountName\" => $account_name, \n \"accountValue\" => $total,\n \"associatedLoanRadio\" => \"No\", \n \"accountType\" => \"3\", \n \"accountStatus\" => \"1\",\n \"token\" => $token,\n );\n $session->URLFetch(\"https://wwws.mint.com/updateAccount.xevent\", $_post);\n}", "public function update(Request $request, $id): Response\n {\n try {\n $data = AccountValidator::validate($request->all());\n } catch (ValidationException $e) {\n return response($e->getMessage(), 400);\n } catch (\\Illuminate\\Validation\\ValidationException $e) {\n return response($e->getMessage(), 500);\n }\n\n $account = AccountSerializer::deserialize($data);\n\n $accountModel = AccountModel::whereId($id)->first();\n\n AccountModel::write($account, $accountModel);\n\n $createdAccount = AccountMapper::mapAccountRow(\n AccountModel::whereUuid($account->getUuid()->getBytes())\n ->first()->toArray()\n );\n\n return response(AccountSerializer::serialize($createdAccount), 200);\n }", "public function update(Request $request, $id)\n {\n //\n $bankAccount = BankAccount::find($id);\n $bankAccount->user_id = Auth::user()->id;\n $bankAccount->account_number = $request->account_number;\n $bankAccount->holder_full_name = $request->holder_full_name;\n if($bankAccount->save()){\n return response()->json(['status'=>true,'message'=>'Account is updated successfully']);\n }\n }", "public function update(Request $request, $id)\n {\n Account::where('account_number',$id)->update(array(\n 'status'=>Input::get('status')\n ));\n }", "public function update()\n { if (is_null($this->id))\n trigger_error(\"User::update(): Attempt to update a User object that does not have its ID property set.\", E_USER_ERROR);\n \n // Update the User\n $conn = new PDO(DB_DSN, DB_USER, DB_PASS);\n $sql = \"UPDATE users SET user_name=:user_name, user_password_hash=:user_password_hash, user_email=:user_email, orcid=:orcid, orcid_code=:orcid_code, orcid_access_token=:orcid_access_token WHERE user_id = :id\";\n $st = $conn->prepare($sql);\n $st->bindValue(\":user_name\", $this->userName, PDO::PARAM_STR);\n $st->bindValue(\":user_password_hash\", $this->userPasswordHash, PDO::PARAM_STR);\n\t$st->bindValue(\":user_email\", $this->userEmail, PDO::PARAM_STR);\n $st->bindValue(\":orcid\", $this->orcid, PDO::PARAM_STR);\n $st->bindValue(\":orcid_code\", $this->orcidCode, PDO::PARAM_STR);\n $st->bindValue(\":orcid_access_token\", $this->orcidAccessToken, PDO::PARAM_STR);\n $st->bindValue(\":id\", $this->id, PDO::PARAM_INT);\n $st->execute();\n $conn = null;\n }", "public function update($id, Request $request)\n {\n try {\n if(ACLHelper::hasPermission('update_account')){ \n\n $user = User::findOrFail($id);\n if($user instanceof User){\n $data = $request->all(); \n\n $res = $user->update($data); \n\n if($res){\n if(!empty($request->get('password'))){ \n\n $user = User::findOrFail($id);\n $user->password = bcrypt($request->get('password'));\n $user->save();\n \n }\n Session::flash('success_message', 'User is updated!');\n return redirect('admin/users');\n }else{\n Session::flash('fail_message', 'Something went wrong! Please try again.');\n } \n }else{\n Session::flash('fail_message', 'User is not found!');\n }\n }else{\n abort(404, 'Access denied!');\n }\n \n } catch (Exception $exc) {\n Session::flash('fail_message', $exc->getTraceAsString());\n }\n\n return redirect('/admin/users/'.$id);\n }", "public function actionUpdate()\r\n {\r\n $model=Settings::findOne(1);\r\n\r\n \r\n if ($model->load(Yii::$app->request->post())) \r\n {\r\n $model->code=strtolower($model->code);\r\n if($model->save())\r\n {\r\n Yii::$app->session->setFlash('success','Account Updated');\r\n return $this->redirect(['/site/index']);\r\n }\r\n else\r\n {\r\n print_r($model->errors); exit;\r\n }\r\n } \r\n else \r\n {\r\n Yii::$app->view->title=\"Update Account Info\";\r\n return $this->render('update', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n \r\n\r\n }", "function update()\n {\n $fkey = $this->input->post('fkey', TRUE);\n $fpass = $this->input->post('fpass', TRUE);\n $fname = $this->input->post('fname', TRUE);\n $femail = $this->input->post('femail', TRUE);\n\n $dataInfo = array('fkey'=>$fkey, 'fpass'=>$fpass, 'fname'=>$fname, 'femail'=>$femail);\n \n $rs_data = send_curl($this->security->xss_clean($dataInfo), $this->config->item('api_edit_account'), 'POST', FALSE);\n\n if($rs_data->status)\n {\n $this->session->set_userdata('vendorName', $fname);\n $this->session->set_flashdata('success', $rs_data->message);\n redirect('my-account');\n }\n else\n {\n $this->session->set_flashdata('error', $rs_data->message);\n redirect('my-account');\n }\n }", "public function updateAccountPost(Request $request) \n {\n // dd($request->all());\n $accountAction = ''; \n $userAction = '';\n $isEamil = false;\n $sendRightEmail = false;\n $isEamil = User::isUserExist($request->get('email')); \n if(!$isEamil) {\n // print \"email not exist\"; \n User::find(Auth::user()->id)->update(['email'=>$request->get('email')]); \n } else {\n print \"Email exist, failed to update <b>x</b><br>\";\n $userAction .= \"Email exist, failed to update. \"; \n }\n\n $sendRightEmail = Account::isSendRightEmailExist($request->get('sendright_email'));\n if(!$sendRightEmail) { \n Account::find(User::getUserAccount())->update(['sendright_email'=>$request->get('sendright_email')]); \n } else {\n print \"Sendright Email exist, failed to update <b>x</b><br>\";\n $userAction .= \"Sendright Email exist, failed to update. \"; \n }\n \n\n $user = User::find(Auth::user()->id)->update(['name'=>$request->get('name')]); \n\n $account = Account::find(User::getUserAccount())->update(['company'=>$request->get('company')]); \n\n\n\n if(!$isEamil) { \n print \"Email successfully update <i class='fa fa-check' aria-hidden='true'></i><br>\"; \n $userAction .= \"Email successfully update\"; \n } \n if(!$sendRightEmail) { \n print \"Sendright Email successfully update <i class='fa fa-check' aria-hidden='true'></i><br>\"; \n $userAction .= \"Sendright Email successfully update\"; \n } \n\n\n if($user === true) {\n print \"Full name successfully updated <i class='fa fa-check' aria-hidden='true'></i> <br>\";\n $userAction .= \"Full name successfully updated\";\n } else {\n print \"Something wrong full name failed updated<span class='glyphicon-class'></span><br>\";\n $userAction .= \"Something wrong full name failed updated\";\n }\n \n if($account === true) {\n print \"Company successfully updated <i class='fa fa-check' aria-hidden='true'></i><br>\"; \n $accountAction .= \"Company successfully updated\"; \n } else {\n print \"Something wrong company failed updated <b>x</b><br>\";\n $accountAction .= \"Something wrong company failed updated\"; \n } \n\n\n\n\n // print \"user action \" . $userAction; \n // print \"user action \" . $accountAction; \n Activity::createActivity(['table_name'=>'users', 'table_id'=>Auth::user()->id, 'action'=>$userAction]);\n Activity::createActivity(['table_name'=>'accounts', 'table_id'=>User::getUserAccount(), 'action'=>$accountAction]); \n // print \"Your account password successfully updated, try logout and log in now!\"; \n }", "public function update()\n {\n $updateUser = new UpdateUser($this->_user->getID(), $this->_user->account);\n if (CSRF::validate() && $updateUser->execute()) {\n return new RedirectResponse('/account/bewerken');\n }\n\n return $this->edit();\n }", "public function actionAccount()\n {\n /** @var AccountForm $model */\n $model = Yii::createObject(AccountForm::className());\n\n $this->performAjaxValidation($model);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', '您的用户信息修改成功');\n return $this->refresh();\n }\n\n return $this->render('account', [\n 'model' => $model,\n ]);\n }", "public function update(Request $request, $id)\n {\n $user = User::find($id);\n if ($request['status'] == 1) {\n $user->name \t = $request['name'];\n $user->user_lname \t = $request['lname'];\n $user->user_status \t = 1;\n $user->user_phone \t = $request['phone'];\n $user->email \t = $request['email'];\n if ($request->password != null) {\n $user->password \t = Hash::make($request->password);\n }\n if ($request->file('profile') != null) {\n $imgprofile = $request->file('profile');\n foreach($imgprofile as $key => $item) {\n if ($user->user_img != 'nopic.png') {\n unlink('local/storage/app/userprofile/'.$user->user_img);\n }\n $name = rand().time().'.'.$item->getClientOriginalExtension();\n $item->storeAs('userprofile', $name);\n $user->user_img = $name;\n }\n }\n $user->save();\n\n // Activity Log\n $log = new activitylog();\n $log->log_user_id = Auth::user()->user_id;\n $log->log_description = \"Updated Account\";\n $log->log_url = URL::full();\n $log->log_sitemap_id = 1;\n $log->log_activeon_id = $id;\n $log->save();\n }\n if ($user->save()) {\n return back()->withSuccess('New Account Has Been Saved!');\n } else {\n return back()->withError('Something Wrong. New Account Can Not Saved!');\n }\n }", "public function update($id)\n\t\t{\n\t\t\t$regles = array(\n\t\t\t\t'idAccountEditInput' => 'required|exists:bookmaker_user,id,user_id,' . Auth::user()->id,\n\t\t\t\t'name_account' => 'required|unique:bookmaker_user,nom_compte,' . $id . ',id,user_id,' . Auth::user()->id,\n\t\t\t);\n\n\t\t\t$messages = array(\n\t\t\t\t'name_account.required' => 'Vous devez entrer un nom ou un n° de compte.',\n\t\t\t\t'name_account.unique' => 'Ce nom ou n° de compte existe déja ou à deja existé.',\n\t\t\t\t'idAccountEditInput.required' => 'L\\'id du compte n\\'est pas renseigné.',\n\t\t\t\t'idAccountEditInput.exists' => 'Ce compte ne vous appartient pas.',\n\t\t\t);\n\n\t\t\t$validator = Validator::make(Input::all(), $regles, $messages);\n\t\t\tif ($validator->fails()) {\n\t\t\t\treturn Response::json(array(\n\t\t\t\t\t'state' => false,\n\t\t\t\t\t'errors' => $validator->getMessageBag()->toArray()\n\t\t\t\t));\n\t\t\t} else {\n\n\t\t\t\t$account = Auth::user()->comptes()->where('id', Input::get('idAccountEditInput'))->first();\n\t\t\t\t$account->nom_compte = Input::get('name_account');\n\t\t\t\t$account->save();\n\n\t\t\t\treturn Response::json(array(\n\t\t\t\t\t'state' => true\n\t\t\t\t));\n\t\t\t}\n\t\t}", "public function updateAccount()\n\t{\n\t\tif (in_array('newsletter', $this->Config->getActiveModules()))\n\t\t{\n\t\t\t$GLOBALS['TL_DCA']['tl_member']['palettes']['default'] = str_replace('newsletter;', 'newsletter,newsalert;', $GLOBALS['TL_DCA']['tl_member']['palettes']['default']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$GLOBALS['TL_DCA']['tl_member']['palettes']['default'] = str_replace('assignDir;', 'assignDir;{newsletter_legend:hide},newsalert;', $GLOBALS['TL_DCA']['tl_member']['palettes']['default']);\n\t\t}\n\t\t\n\t\t$intUser = $this->Input->get('id');\n\n\t\t// Front end call\n\t\tif (TL_MODE == 'FE')\n\t\t{\n\t\t\t$this->import('FrontendUser', 'User');\n\t\t\t$intUser = $this->User->id;\n\t\t}\n\n\t\t// Edit account\n\t\tif (TL_MODE == 'FE' || $this->Input->get('act') == 'edit')\n\t\t{\n\t\t\t$objUser = $this->Database->prepare(\"SELECT email FROM tl_member WHERE id=?\")\n\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t ->execute($intUser);\n\n\t\t\tif ($objUser->numRows)\n\t\t\t{\n\t\t\t\t// E-mail address has changed\n\t\t\t\tif (!empty($_POST) && $this->Input->post('email', true) != $objUser->email)\n\t\t\t\t{\n\t\t\t\t\t$this->Database->prepare(\"UPDATE tl_news_recipients SET email=? WHERE email=?\")\n\t\t\t\t\t\t\t\t ->execute($this->Input->post('email', true), $objUser->email);\n\n\t\t\t\t\t$objUser->email = $this->Input->post('email', true);\n\t\t\t\t}\n\n\t\t\t\t$objSubscriptions = $this->Database->prepare(\"SELECT pid FROM tl_news_recipients WHERE email=?\")\n\t\t\t\t\t\t\t\t\t\t\t\t ->execute($objUser->email);\n\n\t\t\t\t$strNews = serialize($objSubscriptions->fetchEach('pid'));\n\n\t\t\t\t$this->Database->prepare(\"UPDATE tl_member SET newsalert=? WHERE id=?\")\n\t\t\t\t\t\t\t ->execute($strNews, $intUser);\n\n\t\t\t\t// Update the front end user object\n\t\t\t\tif (TL_MODE == 'FE')\n\t\t\t\t{\n\t\t\t\t\t$this->User->newsalert = $strNews;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Delete account\n\t\telseif ($this->Input->get('act') == 'delete')\n\t\t{\n\t\t\t$objUser = $this->Database->prepare(\"SELECT email FROM tl_member WHERE id=?\")\n\t\t\t\t\t\t\t\t\t ->limit(1)\n\t\t\t\t\t\t\t\t\t ->execute($intUser);\n\n\t\t\tif ($objUser->numRows)\n\t\t\t{\n\t\t\t\t$objSubscriptions = $this->Database->prepare(\"DELETE FROM tl_news_recipients WHERE email=?\")\n\t\t\t\t\t\t\t\t\t\t\t\t ->execute($objUser->email);\n\t\t\t}\n\t\t}\n\t}", "function updateacct() {\r\n$email=$this->get('email');\r\n\r\n//instantiating variables begin\r\n\r\n$this->surname=safeAddSlashes($_POST['surname']);\r\n$this->othernames=safeAddSlashes($_POST['othernames']);\r\n$this->email=safeAddSlashes($_POST['email']);\r\n$this->gsm1=safeAddSlashes($_POST['gsm1']);\r\n$this->gsm2=safeAddSlashes($_POST['gsm2']);\r\n$this->contactaddress=safeAddSlashes($_POST['contactaddress']);\r\n$this->homedescription=safeAddSlashes($_POST['homedescription']);\r\n$this->state=safeAddSlashes($_POST['state']);\r\n$this->paymentmode=safeAddSlashes($_POST['paymentmode']);\r\n\r\n\r\n//database connection begins\r\n\r\n// Include the MySQL class\r\nrequire_once('database/MySQL.php');\r\n\r\nrequire('database/connx.php');\r\nrequire('database/strip_quotes.php');\r\n\r\n// Connect to MySQL\r\n$db = & new MySQL($host,$dbUser,$dbPass,$dbName);\r\n\r\n$sql=\"UPDATE membersaccount SET\r\nsurname='$this->surname',\r\nothernames='$this->othernames',\r\ngsm1='$this->gsm1',\r\ngsm2='$this->gsm2',\r\ncontactaddress='$this->contactaddress',\r\nhomedescription='$this->homedescription',\r\nstate='$this->state',\r\npaymentmode='$this->paymentmode' where email='$email'\";\r\n//echo $sql;\r\n\r\nif($db->query($sql)){$this->response=\"Update Successful\";}\r\n\r\n\r\n}", "public function testUpdateUser()\n {\n }", "public function update(UserRequest $request)\n {\n\n \t// Validate the request\n \t$request->validated();\n\n\n \t// Update account details\n try {\n\n\t \t$request->user()->fill([\n\t 'name' \t\t=> $request->name,\n\t 'email' \t=> $request->email,\n\t 'timezone' \t=> $request->timezone\n\t ])->save();\n\n return response(['message' => 'Your account settings were successfully updated.'], 200);\n \n } catch (Exception $e) {\n return response(['message' => $e->getMessage()], 500);\n }\n }", "public function update(Request $request,$id)\n {\n $account = Account::find($id);\n if (!$account) {\n abort(404);\n }\n $inputs = $request->all();\n $currentRoute = explode('.', \\Request::route()->getName());\n $routeMethod = reset($currentRoute);\n //$routeAction = end($currentRoute);\n if($routeMethod == 'account') {\n $validator = (new Account)->validateAccountOnly($inputs,$id);\n }\n else{\n $validator = (new Account)->validateAccount($inputs,$id);\n }\n if ($validator->fails()) {\n return validationResponse(false, 206, \"\", \"\", $validator->messages());\n }\n\n try {\n \\DB::beginTransaction();\n $accountGroup = $inputs['account_group'];\n unset($inputs['account_group']);\n $city = $inputs['city'];\n unset($inputs['city']);\n $state = $inputs['state'];\n unset($inputs['state']);\n $country = $inputs['country'];\n unset($inputs['country']);\n $drCrId = $inputs['d_c'];\n unset($inputs['d_c']);\n $default = 0;\n if(array_key_exists('is_default', $inputs)){\n $default = $inputs['is_default'];\n unset($inputs['is_default']);\n }\n $inputs = $inputs + [\n 'dr_cr_id' => $drCrId,\n 'is_default' => $default,\n 'city_id' => $city,\n 'state_id' => $state,\n 'country_id' => $country,\n 'account_group_id' => $accountGroup,\n 'updated_by' => \\Auth::user()->id\n ];\n //dd($inputs);\n (new Account)->store($inputs, $id);\n $submitData = [];\n\n if($routeMethod == 'account') {\n $route = route('account.index');\n $lang = lang('messages.updated', lang('account.account'));\n }\n if($routeMethod == 'supplier') {\n $route = route('supplier.index');\n $lang = lang('messages.updated', lang('supplier.supplier'));\n }\n if($routeMethod == 'customer') {\n $route = route('customer.index');\n $lang = lang('messages.updated', lang('customer.customer'));\n }\n\n \\DB::commit();\n return validationResponse(true, 201, $lang, $route, [], $submitData);\n } catch (\\Exception $exception) {\n \\DB::rollBack();\n return validationResponse(false, 207, $exception->getMessage() . $exception-> getFile() . $exception->getLine() . lang('messages.server_error'));\n }\n }", "public function editAccount($account_id, $data)\n\t{\n\t\t$affected = DB::update('UPDATE accounts SET refresh_interval = ? WHERE account_id = ?', [$data['refresh_interval'], $account_id]); \n\n\t\tif ($affected) {\n\t\t\t$account = $this->getAccount($account_id);\n\t\t\treturn ['status' => 'success', 'title' => $account->title];\n\t\t} else {\n\t\t\treturn ['status' => 'error', 'error' => 'Ups!!! Not affected.'];\n\t\t}\n\t}", "public static function update() {\n if ( isset($_POST['nickname']) ) {\n self::setNickname($_POST['nickname']);\n } \n if ( isset($_POST['password'])\n && isset($_POST['password2'])\n && isset($_POST['passwordold'])\n && !empty($_POST['password'])\n && !empty($_POST['password2'])\n && !empty($_POST['passwordold'])\n && $_POST['password'] == $_POST['password2'] ) {\n \n $passwordold = Helper::hash($_POST['passwordold'].self::getEmail());\n \n $result = Database::getUser(self::getEmail(),$passwordold);\n \n if ( $result === false || !is_array($result) ) {\n self::setError('Falsches Passwort!<br>');\n return;\n }\n \n if ( count($result) != 1 ) {\n self::setError('Falsches Passwort!<br>');\n return;\n }\n \n $password = Helper::hash($_POST['password'].self::getEmail());\n $success = Database::setPassword(self::getId(),$passwordold,$password);\n \n self::setError('Passwort ge&auml;ndert!<br>');\n }\n \n }", "public function update(Request $request, AdminAccount $adminAccount)\n {\n //\n }", "public function setAccount($account);", "public function update(Request $request, Account $account)\n {\n // Updates Target KPI, KPI value\n if($request['kpi_value']) $account->kpi_value = $request['kpi_value'];\n if($request['kpi_name']) $account->kpi_name = $request['kpi_name'];\n $account->save();\n\n // return new AccountKpiResource($account);\n }", "public function update():void\n {\n $id = $this->id;\n $first_name = $this->first_name;\n $last_name = $this->last_name;\n $image = $this->image;\n $user_type = $this->user_type;\n $address = $this->address;\n\t\t$phone = $this->phone;\n $this->fetch(\n 'UPDATE user\n SET first_name = ?,\n last_name = ?,\n image = ?,\n user_type = ?,\n address=?,\n phone=?\n WHERE id = ?;',\n [$first_name, $last_name,$image, $user_type,$address ,$phone , $id]\n );\n }", "public function update(UpdateCustomerRequest $request,$id){\n $input =$request->all();\n $user = User::findOrFail($id);\n global $result;\n\n if(array_key_exists('passwordOld',$input) && $input['password'] !== null ){\n $this->validate($request, [\n 'passwordOld'=>'required|between:8,255',\n 'password' => 'required|between:8,255|confirmed',\n ]);\n if(!count($user->getRoleNames()) && Hash::check($input['passwordOld'], $user->password)){\n $user->phoneNumber = $input['phoneNumber'];\n $user->email = $input['email'];\n $user->password =Hash::make($input['password']);\n $user->firstName = $input['firstName'];\n $user->lastName = $input['lastName'];\n $user->address = $input['address'];\n $user->save();\n $result = \"Cập nhật thành công!\";\n session()->flash('account-update',$result);\n }else{\n $result = \"Sai password!\";\n session()->flash('account-update-fail',$result);\n }\n }else{\n $user->phoneNumber = $input['phoneNumber'];\n $user->email = $input['email'];\n $user->firstName = $input['firstName'];\n $user->lastName = $input['lastName'];\n $user->address = $input['address'];\n $user->save();\n $result = \"Cập nhật thành công!\";\n session()->flash('account-update',$result);\n }\n return redirect()->route('account',$id);\n }", "public function accountChange(){\n\t\t\n\t\t// If user want to change his informations\n\t\tif(isset($_POST['account_save']))\n\t\t{\n\t\t\trequire 'Database.php';\n\t\t\t\n\t\t\t$order_id = $_REQUEST['order_id'];\n\t\t\tif($order_id!=\"\")\n\t\t\t{\n\t\t\t // Update database with his informations\n\t\t\t$req = $db->prepare(\"UPDATE orders SET lol_server = ?, lol_summoner = ?, lol_account = ?, lol_password = ? WHERE order_id = ?\");\n\t\t\t$req->execute(array($_POST['server'], $_POST['summonername'], $_POST['accountname'], $_POST['accountpassword'], $order_id));\n\t\t\t$_SESSION['account_information'] = 1;\n\t\t\t\n\t\t\t// Update current league, LP\n\t\t\t$update = new Member();\n\t\t\t$update->updateOrderLeague();\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\n\t\t\t// Update database with his informations\n\t\t\t$req = $db->prepare(\"UPDATE orders SET lol_server = ?, lol_summoner = ?, lol_account = ?, lol_password = ? WHERE user_id = ?\");\n\t\t\t$req->execute(array($_POST['server'], $_POST['summonername'], $_POST['accountname'], $_POST['accountpassword'], $_SESSION['id']));\n\t\t\t$_SESSION['account_information'] = 1;\n\t\t\t\n\t\t\t// Update current league, LP\n\t\t\t$update = new Member();\n\t\t\t$update->updateOrderLeague();\n\t\t\t}\necho \"<script>window.location='index.php'</script>\";\n\t\t\t//header('Location: index.php');\n\t\t}\n\n\t}", "public function update(Request $request, AccountBank $accountBank)\n {\n //\n }", "public function update($username, Request $request)\n\t{\n// $this->validate($request,[\n// 'email' => 'required|email|unique:users',\n// 'phone' => 'required|unique:users',\n// ]);\n $account_data = $request->except('_token');\n foreach($account_data as $k => $v){\n if($k == 'phone'){\n $v = remove_symbols($v);\n }\n Auth::user()->{$k} = $v;\n }\n if(Auth::user()->save()){\n return redirect()->back()->with('success', Lang::get('account.update_success'));\n }\n return redirect()->back()->withInput($request->except('_token'))->with('error',Lang::get('account.update_error'));\n\t}", "function update_account_using_sparse_object()\n{\n // If not, a new account is created.\n $merchantAccountId = 'some_user_id';\n $account = new Account();\n $account->setMerchantAccountId($merchantAccountId);\n $account->setEmailAddress('some_new_or_different_email_address@nomail.com');\n $response = $account->update();\n\n if ($response['returnCode'] != '200') {\n print('Error updating account' . PHP_EOL);\n }\n}", "public function update(Request $request, $id)\n {\n if($request->password !== $request->password2){\n return redirect()->back()->withErrors(['msg' => '兩次輸入的新密碼不相同']);\n }else{\n $accounts = Account::find($id);\n $accounts->password = bcrypt($request->password);\n $accounts->save();\n return redirect()->route('account.index');\n }\n\n }", "public function updateAccount($bank_id, $currency, $account_number, $first_name, $last_name, $branch, $type, $class)\n {\n try {\n // Look for the currency ID.\n $currency_id = DB::table('core.currencies')->where('code', $currency)->value('id');\n\n if (!$currency_id) {\n throw new \\Exception('The provided currency code is not valid.', 422);\n }\n\n // Update the account.\n $this->bank_id = $bank_id;\n $this->currency_id = $currency_id;\n $this->account_number = $account_number;\n $this->first_name = $first_name;\n $this->last_name = $last_name;\n $this->branch = $branch;\n $this->type = $type;\n $this->class = $class;\n $this->save();\n\n // Return the updated object.\n return $this;\n } catch (\\Exception $e) {\n throw $e;\n }\n }", "public function update_info()\n\t{\n\t\t$this->load->model('admin_user_model', 'admin_users');\n\t\t$updated = $this->admin_users->update_info($this->mUser->id, $this->input->post());\n\n\t\tif ($updated)\n\t\t{\n\t\t\tset_alert('success', 'Successfully updated account info.');\n\t\t\t$this->mUser->full_name = $this->input->post('full_name');\n\t\t\t$this->session->set_userdata('admin_user', $this->mUser);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tset_alert('danger', 'Failed to update info.');\n\t\t}\n\n\t\tredirect('admin/account');\n\t}", "public function update(Request $request, $id)\n {\n //\n $this->validate($request, [\n 'email' => 'required|string|email|max:255',\n 'phone' => 'required|string|max:11',\n ]);\n\n\n $user = User::find($id);\n $user->firstname = $request->input('firstname');\n $user->lastname = $request->input('lastname');\n $user->email = $request->input('email');\n $user->phone = $request->input('phone');\n $user->save();\n\n return redirect('/home/accountlist');\n }", "public function postAccountInfoForm(AccountInfoRequest $request)\n {\n $result = $this->guard()->user()->update($request->except(['_token']));\n\n if ($result) {\n Alert::success(trans('backpack::base.account_updated'))->flash();\n } else {\n Alert::error(trans('backpack::base.error_saving'))->flash();\n }\n\n return redirect()->back();\n }" ]
[ "0.74838364", "0.74712163", "0.7300323", "0.721076", "0.7209313", "0.71364516", "0.71241766", "0.7120675", "0.7120675", "0.7120675", "0.7120675", "0.7038783", "0.7000428", "0.6995712", "0.6978353", "0.6975653", "0.69206995", "0.6906236", "0.68967843", "0.68763113", "0.6871274", "0.6843076", "0.6821846", "0.6786295", "0.6770027", "0.67492306", "0.6676128", "0.6656724", "0.6609546", "0.65887284", "0.65812665", "0.65765786", "0.6572931", "0.65692616", "0.6537109", "0.6533403", "0.652664", "0.65173686", "0.6510718", "0.6507746", "0.64817894", "0.6470995", "0.64505297", "0.644447", "0.643278", "0.6417014", "0.63951355", "0.6377736", "0.63669986", "0.63634974", "0.6355473", "0.6355473", "0.6355473", "0.6355473", "0.6355473", "0.63521904", "0.63482344", "0.63388205", "0.63249785", "0.6315693", "0.6315062", "0.63091695", "0.6306002", "0.6302445", "0.62675774", "0.62549233", "0.6249213", "0.6246227", "0.6245665", "0.6244915", "0.62406266", "0.6225973", "0.62156117", "0.62116826", "0.61973387", "0.6178581", "0.61737555", "0.61727285", "0.61722463", "0.6170492", "0.61675024", "0.61539894", "0.61386186", "0.6135061", "0.6135014", "0.61311615", "0.61139846", "0.6111522", "0.6105952", "0.61037654", "0.6095462", "0.6092923", "0.6087519", "0.6069994", "0.6065335", "0.6063119", "0.60400194", "0.6028167", "0.6025427", "0.60159314" ]
0.64237064
45
Fetch an existing account by ID
public function getAccount($account_uuid) { $result = $this->newAPIRequest('GET', '/account/'.$account_uuid); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getAccount ($id = null) {\n if (!$id) { \n $id = session::getUserId();\n }\n $db = new db();\n $row = $db->selectOne('account', 'id', $id);\n return $row;\n }", "public function getForAccount($id)\n {\n $slug = implode('/', ['account', $id]);\n return $this->_get($slug);\n }", "public function show($id)\n {\n return Account::find($id);\n }", "public static function get ($id) {\n // Retrieve account resources.\n $account = Json::get('account', $id);\n\n // If account resource is not avaiable, internal server error.\n if ($account == 1)\n return 1;\n if ($account == 2)\n return 2;\n\n // Account found.\n return $account;\n }", "public function fetch($id)\n {\n $account=User::find($id);\n abort_if($account==null,404,'Account could not be found!');\n\n return json_encode($account);\n\n }", "public function account($id)\n {\n return $this->get(\"ach/relationships/{$id}\");\n }", "public static function getAccount(string $type, int $id = 0) {\n $account = self::query($type, $id);\n if (!$account) {\n $account = self::createAccount($type, $id);\n }\n return $account;\n }", "public function loadAccount($id){\n try{\n \n $sql = 'SELECT * FROM accounts WHERE idaccount=:id';\n $query = pdo()->prepare($sql);\n $query->bindValue(':id', $id, PDO::PARAM_INT);\n $query->execute();\n $res = $query->fetch(PDO::FETCH_ASSOC);\n $query->closeCursor();\n if($res){\n $this->_idaccount = $res['idaccount'];\n $this->_email = $res['email'];\n $this->_username = $res['username'];\n $this->_password = $res['password'];\n $this->_validationkey = $res['validationkey'];\n $this->_rang = $res['rang'];\n return $this;\n }\n return false;\n \n }\n catch(Exception $e)\n {\n trigger_error('Echec lors de l\\'inscription : '.$e->getMessage(), E_USER_ERROR);\n }\n }", "public function show($id)\n {\n return Account::select('*')->where('account_number',$id)->get();\n }", "function selectAccountById($id) {\n $connection = openDb();\n\n //Using prepared statements:\n $id = (int) $id;\n $sql = \"SELECT * FROM accounts WHERE ID = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "public function getAccount();", "public function show($id)\n {\n $account = Account::where('accountNumber',$id)->first();\n if(!$account) return response()->json(['error' => 'account doest exist'],204);\n $user = $account->user;\n if(!auth('api')->check())\n {\n return response()->json(['name'=> $user->name, 'email' => $user->email],200);\n }\n return response()->json($account);\n }", "public function getAccount($account_id)\n\t{\n\t\t$arr = DB::select('SELECT * FROM accounts WHERE account_id = ?', [$account_id]); \n\n\t\tif ($arr[0]) {\n\t\t\treturn $arr[0];\n\t\t} else {\n\t\t\treturn ['status' => 'error', 'error' => 'Ups!!! No accounts.'];\n\t\t}\n\t}", "public static function getByID($id)\n\t{\n\t\t$db = UserConfig::getDB();\n\t\t$account = null;\n\n\t\tif ($stmt = $db->prepare('SELECT name, plan FROM '.UserConfig::$mysql_prefix.'accounts WHERE id = ?'))\n\t\t{\n\t\t\tif (!$stmt->bind_param('i', $id))\n\t\t\t{\n\t\t\t\t throw new Exception(\"Can't bind parameter\".$stmt->error);\n\t\t\t}\n\t\t\tif (!$stmt->execute())\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Can't execute statement: \".$stmt->error);\n\t\t\t}\n\t\t\tif (!$stmt->bind_result($name, $plan_id))\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Can't bind result: \".$stmt->error);\n\t\t\t}\n\n\t\t\tif ($stmt->fetch() === TRUE)\n\t\t\t{\n\t\t\t\t$account = new self($id, $name, Plan::getByID($plan_id), Account::ROLE_USER);\n\t\t\t}\n\n\t\t\t$stmt->close();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception(\"Can't prepare statement: \".$db->error);\n\t\t}\n\n\t\treturn $account;\n\t}", "public function retrieveById(string $id): ?\\snuze\\Reddit\\Thing\\Account\\UserAccount {\n\n $query = 'SELECT name FROM accounts WHERE id = :id';\n\n try {\n /* Prepare and execute a statement */\n $stmt = $this->pdo->prepare($query);\n $stmt->bindValue(':id', $id, \\PDO::PARAM_STR);\n $stmt->execute();\n $row = $stmt->fetch(\\PDO::FETCH_ASSOC);\n }\n catch (\\PDOException $ex) {\n /* Re-throw as logged SnuzeException */\n throw new \\snuze\\Exception\\PersistenceException($this,\n $ex->getMessage(), $ex->getCode(), $ex->getPrevious());\n }\n\n if (empty($row)) {\n $this->debug(\"Requested account {$id} wasn't found\");\n return null;\n }\n\n return $this->retrieve($row['name']);\n }", "public function getAccount( $id )\n\t{\n\t\t$stmt = $this->connection->prepare('SELECT a.id, username, avatar, email, expire FROM ' . Configure::get('database/prefix') . 'accounts as a LEFT JOIN ' . Configure::get('database/prefix') . 'sessions as s ON s.id = a.sessid WHERE a.id = :uid');\n\t\t$stmt->bindValue(':uid', Security::sanitize($id, 'integer'), PDO::PARAM_INT);\n\t\t$stmt->execute();\n\t\t$users = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t$stmt->closeCursor();\n\n\t\tif( !empty($users) )\n\t\t{\n\t\t\t$users['email'] = Security::decryptData($users['email']);\n\t\t}\n\n\t\treturn $users;\n\t}", "public function getLoginAccountById($id)\n\t{\n\t\t$record = Social_LoginAccountRecord::model()->findByPk($id);\n\n\t\tif ($record)\n\t\t{\n\t\t\treturn Social_LoginAccountModel::populateModel($record);\n\t\t}\n\t}", "public function show($id)\n {\n $account = $this->accountRepo->find($id);\n if($account){\n return $this->apiResponse($account);\n }\n return $this->notFound();\n }", "function account($id)\r\n{\r\n mysql_selectdb(SQL_AUTH_DATABASE);\r\n $query = \"SELECT * FROM `account` WHERE `id` = $id\";\r\n $sql = mysql_query($query);\r\n return mysql_fetch_array($sql);\r\n \r\n}", "public function show(int $id): Response\n {\n $account = AccountMapper::mapAccountRow(\n AccountModel::whereId($id)->first()->toArray()\n );\n\n return response(AccountSerializer::serialize($account), 200);\n }", "public function get( $id )\n {\n $user = Auth::user();\n $fields = ['cost_per_total_action', 'clicks', 'spend'];\n $start_date = $this->getStartDate(Input::get('start_date'));\n $end_date = $this->getEndDate(Input::get('end_date'));\n $time_increment = (bool) Input::get('time_increment', false);\n\n // Fetch the account record from the database.\n //\n $account = $this->accountRepository->byIdAndUserWithMetricsByDate( $id, $user, $fields, $start_date, $end_date, $time_increment );\n\n // Bail of the account record does not exist.\n //\n if ( ! $account )\n {\n // Otherwise return an error response.\n //\n return $this->setError( [ 'id' => [ 'Invalid account id.' ] ] )->error( null, 404 );\n }\n\n // Return the record.\n //\n return $this->response( $account ?: 0 );\n }", "public function index($id)\n {\n // If we have a cache system, we find item by CacheController and if not exist, abort(404)\n\n // Then we have to Authorize the user, account info are private and they should not be allowed to be\n // seen by everybody, so we use Laravel Policies but here we skip it as we have no authentication.\n\n $item = Account::find($id);\n\n $response = [\n 'status' => !$item ? false:true,\n 'model' => !$item ? null:$item->load('user'),\n ];\n return response()->json($response, 200);\n }", "public function retrieveById(string $id): ?\\snuze\\Reddit\\Thing\\Account\\UserAccount;", "public static function getAccountById($account_id){\n $stmt = Dbh::connect() ->PREPARE(\"SELECT * FROM accounts WHERE account_id=?\");\n $stmt->execute([$account_id]);\n $account = array();\n if($stmt->rowCount()){\n while ($row = $stmt->fetch()){\n $account = array(\"id\"=>$row['account_id'], \"email\"=>$row['email'], \"firstName\"=>$row['first_name'], \"lastName\"=>$row['last_name'],\n \"type\"=>$row['account_type'],\"password\"=>$row['password'],\"subscription\"=>$row['subscription']);\n }\n return $account;\n } else {\n\t\t\treturn false;\n\t\t}\n }", "public function getAccountID();", "public function show($id)\n {\n return $this->espService->getAccountWithEditCheck( $id );\n\n }", "function selectAccountByUserId($id) {\n $connection = openDb();\n $id = escape($id,$connection);\n $id = (int) $id;\n\n //Using prepared statements and parameterized queries:\n $sql = \"SELECT * FROM accounts WHERE USER = ?\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"i\",$id);\n\n return executeQueryPrepared($stmt, $connection, true);\n}", "public function retrieve(int $id);", "public static function account($accountId) {\n //Return the information for $accountId\n return self::get('accounts/' . $accountId);\n }", "public function fetch($id);", "public function fetch($id);", "public function show($id)\n {\n //Get transfer\n $account = accounts::findOrFail($id);\n //Return the single transfer as a resource\n return new accountResource($account);\n }", "public function getRecord($id)\n\t{\n\t\treturn $this->db->get_where('bank_account',array('id'=>$id))->row();\n\t}", "public function retrieveById($id);", "public function searchAccount($id) {\n $criteria = new CDbCriteria;\n $criteria->compare('company', $id);\n\n return $this->searchBase($criteria);\n }", "static public function getDataForId($id) {\r\n\t\tDB::getInstance()->stopAddingAccountID();\r\n\t\t$Data = DB::getInstance()->query('SELECT * FROM `'.PREFIX.'account` WHERE `id`=\"'.(int)$id.'\" LIMIT 1')->fetch();\r\n\t\tDB::getInstance()->startAddingAccountID();\r\n\r\n\t\treturn $Data;\r\n\t}", "private function findAccountByOwner(string $type, int $id)\n {\n return Account::where([\n \"owner_id\" => $id,\n \"owner_type\" => $type\n ])->firstOrFail();\n }", "abstract public function fetchUserById($id);", "function getAccountID () {\r\n //checks if the user is logged in\r\n if (checkLogin()) {\r\n //gets the ID\r\n $ID = getPersonID();\r\n //setup sql query\r\n $sql = \"SELECT AccountID FROM accounts WHERE PersonID = $ID\";\r\n //runs the query\r\n $stmt = runQuery($sql);\r\n //checks if we found atleast 1 account\r\n if ($stmt->rowCount() > 0) {\r\n $row = $stmt->fetch();\r\n //returns the ID\r\n return $row['AccountID'];\r\n }\r\n }\r\n return null;\r\n}", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById($id);", "public function getById() {}", "function findById($id){\n\t\tUtilidades::_log(\"findById($id)\");\n\t\t$query = \"SELECT id,name,account,surnames,email,pass,address,access\n\t\t\t\t\tFROM user WHERE id = $id\";\n\t\t$row = DB::ejecutarConsulta($query);\n\t\t\n\t\treturn new UserDAO($row[0]);\n\t}", "public function it_can_retrieve()\n {\n $response = $this->managedAccountResponse('acct_ABC');\n $this->mockRequest('GET', '/v1/account', [], $response);\n\n $this->account = Account::retrieve();\n $this->assertSame($this->account->id, 'acct_ABC');\n }", "public function loadAccount($id) {\n $account = Account::findOne($id);\n if ($account === null) {\n return false;\n }\n $this->account = $account;\n return true;\n }", "function find($id) {\n global $conn;\n\n $stmt = $conn->prepare(\"SELECT Name, Surname, Email, Phone, Username, Customer_id\n FROM Customer WHERE Customer_id = ?\");\n $stmt->execute([$id]);\n $stmt->setFetchMode(PDO::FETCH_CLASS, 'Customer');\n return $stmt->fetch();\n }", "public function getById( $id );", "public function show($id)\n {\n if (!$id) {\n return \"Account doesn't exist\";\n }\n try {\n $user = User::findOrFail($id);\n } catch (ModelNotFoundException $e) {\n return \"Account doesn't exist\";\n }\n return new UserResource($user);\n }", "public function get(string $id);", "public function getUser($id);", "public function getById(string $id);", "public function getAccount($cache = TRUE);", "public function getById(int $id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "static function GetWithId(int $id)\n\t{\n\t\t$arr = [\n\t\t\t':id' => $id\n\t\t];\n\n\t\t$sql = 'SELECT * FROM user_info WHERE rf_user_id = :id LIMIT 1';\n\n\t\treturn Db::Query($sql,$arr)->FetchObj();\n\t}", "abstract public function retrieve($id);", "public function getAccount(string $id, string $fetch = self::FETCH_OBJECT)\n {\n return $this->executeEndpoint(new \\NxSys\\Library\\Clients\\Brex\\API\\Transactions\\Endpoint\\GetAccount($id), $fetch);\n }", "public function user($id) {\n\n if (!isset($this->account_details['access_token'])) {\n throw new GoCardless_ClientException('Access token missing');\n }\n\n return GoCardless_User::find_with_client($this, $id);\n\n }", "public function getById($id) {\n\n $sql = \"SELECT * FROM user WHERE id = {$id}\";\n\n return $this->query($sql);\n }", "function user($id){\n\n $sql = \"SELECT * FROM users WHERE id=$id\";\n return fetch($sql);\n }", "public function get( $id );", "abstract public function getById($id);", "abstract public function getById($id);", "public function GetById($id);", "public function GetById($id);", "private function GetAccountDetails()\n\t{\n\t\t$customer_id = $this->getCustomerId();\n\t\tif(!$customer_id)\n\t\t{\n\t\t\tlogAdd(LOG_SEVERITY_ERROR, 'Se intento editar un WebUsuario con id \"'.$this->getData('ID').'\" invalido');\n\t\t\treturn false;\n\t\t}\n\n\t\t$query = sprintf(\"select * from [|PREFIX|]customers where customerid='%d'\", $GLOBALS['ISC_CLASS_DB']->Quote($customer_id));\n\t\t$result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n\t\t$row = $GLOBALS['ISC_CLASS_DB']->Fetch($result);\n\n\t\tif ($row !== false) {\n\t\t\treturn $row;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function mauth_find_by_id($id);", "public function findById($id){\n $customer = Customer::find($id);\n return $customer;\n }", "public abstract function getById($id);" ]
[ "0.75588244", "0.745535", "0.7420915", "0.73975575", "0.72290653", "0.7221099", "0.70559233", "0.6970688", "0.6939486", "0.6898622", "0.67686296", "0.67665154", "0.6713789", "0.67016345", "0.6637833", "0.662612", "0.6613475", "0.6610605", "0.6591901", "0.65797794", "0.6579215", "0.6575145", "0.65671515", "0.6550536", "0.65354794", "0.65301174", "0.6521174", "0.6472526", "0.6470568", "0.6453153", "0.6453153", "0.644647", "0.6444005", "0.6407708", "0.6407288", "0.64003676", "0.6383172", "0.63622344", "0.63408583", "0.63166875", "0.63166875", "0.63166875", "0.63166875", "0.63166875", "0.63166875", "0.63166875", "0.63166875", "0.63166875", "0.63166875", "0.63166875", "0.63166875", "0.63166875", "0.63166875", "0.63166875", "0.63073415", "0.6295549", "0.6293601", "0.6291473", "0.6291083", "0.62804174", "0.62797874", "0.6278662", "0.6271259", "0.62617517", "0.6245286", "0.6243306", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.6238109", "0.62166286", "0.62142223", "0.6194992", "0.6193738", "0.6191017", "0.6183184", "0.6168085", "0.6115575", "0.6115575", "0.61126935", "0.61126935", "0.610259", "0.61011773", "0.6093921", "0.60878855" ]
0.0
-1
Transfers all funds from one account to another that are tagged with a transaction ID
public function transferAllByTransactionID($payment_address_uuid, $from, $to, $txid) { $body = [ 'from' => $from, 'to' => $to, 'txid' => $txid, ]; $result = $this->newAPIRequest('POST', '/accounts/transfer/'.$payment_address_uuid, $body); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function transfer($id)\n {\n return $this->get(\"ach/transfers/{$id}\");\n }", "public function getAmountTransfers($id){\n\n $amountWallets = Wallets::select('amount')->where('id',$id)->get();\n\n return $amountWallets[0]->amount;\n \n }", "public function transfer_to(Request $request, $customer_sender_id)\n {\n\n $customer = DB::select('SELECT * FROM customers WHERE id = ?', [$customer_sender_id]);\n\n //\n $rules = [\n\t\t\t'amount' => 'required|numeric|max:'.$customer[0]->balance,\n\t\t\t'recipient_customer_id' => 'required|numeric'\n\t\t];\n\n\t\t$validator = Validator::make($request->all(), $rules);\n\t\tif ($validator->fails()) {\n\t\t\treturn redirect()->back()->withErrors($validator)->withInput();\n\t\t};\n\n\n\n\n\n // If it gets validated correcty\n $transaction_id = DB::insert('INSERT INTO `transfers` \n (`sender_id`, `receiver_id`, `amount`)\n VALUES \n (?, ?, ?)', [\n $customer_sender_id, $request->recipient_customer_id, $request->amount\n ]);\n\n // if the transaction is successful\n if ($transaction_id > 0) {\n // SENDER gets amount SUBSTRACTED\n DB::update('UPDATE `customers` \n SET\n `balance` = `balance`-?\n WHERE `id` = ?', [\n $request->amount,\n $customer_sender_id\n ]);\n\n // RECIPIENT gets amount ADDED\n DB::update('UPDATE `customers` \n SET\n `balance` = `balance`+?\n WHERE `id` = ?', [\n $request->amount,\n $request->recipient_customer_id\n ]);\n }\n\n return redirect()->back()->with('message', 'Transaction finished successfully');\n }", "public function transfert()\n {\n\n $account = \\Stripe\\Account::create([\n 'country' => 'US',\n 'type' => 'custom',\n 'requested_capabilities' => ['card_payments', 'transfers'],\n ]);\n\n $transfer = Transfer::create([\n 'amount' => 7000,\n 'currency' => 'usd',\n 'destination' => $account->id,\n 'transfer_group' => '{ORDER10}',\n ]);\n }", "public function transfer($from_user_id, $to_user_id, $amount)\n {\n $dateNow = new Nette\\Utils\\DateTime();\n $amount = number_format($amount, 2, '.', '');\n $this->database->beginTransaction();\n // out\n $this->database->table(self::TRANSFERS_TABLE_NAME)->insert([\n 'from_user_id' => $from_user_id,\n 'to_user_id' => $to_user_id,\n 'type' => self::TRANSFER_TYPE_OUT,\n 'amount' => $amount,\n 'dt' => $dateNow\n ]);\n if ($from_user_id != 0) {\n $from_user = $this->database->table(self::USERS_TABLE_NAME)->get($from_user_id);\n // check rules\n if (\n ($from_user)\n && ($from_user->balance > 0)\n && ($from_user->balance >= $amount)\n ) {\n $this->database->table(self::USERS_TABLE_NAME)\n ->where('id', $from_user_id)\n ->update([\n 'balance' => $from_user->balance - $amount,\n ]);\n } else {\n $this->database->rollBack();\n return false;\n }\n }\n if ($to_user_id != 0) {\n // TODO: one query\n $to_user = $this->database->table(self::USERS_TABLE_NAME)->get($to_user_id);\n $this->database->table(self::USERS_TABLE_NAME)\n ->where('id', $to_user_id)\n ->update([\n 'balance' => $to_user->balance + $amount,\n ]);\n }\n $this->database->commit();\n return true;\n }", "function transfer_money() {\n\t\t$user_id = $_REQUEST['user_id'];\n\t\t$mobile = $_REQUEST['mobile_no'];\n\t\t$amount = $_REQUEST['amount'];\n\t\t$mobile_no = $_REQUEST['mobile_no'];\n\n\t\t//$transaction_id= mt_rand( 10000000, 99999999);\n\t\t$wallet_type_main = 2;\n\t\t// amount debit in user self\n\t\t$wallet_type_frnd = 1;\n\t\t// amount credit in frnd\n\t\t$wallet_category_to = 5;\n\t\t// transfer money to\n\t\t$wallet_category_from = 10;\n\t\t// transfer money from\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\tif (!empty($mobile)) {\n\t\t\t$user_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif (!empty($user_records)) {\n\t\t\t\t$main_wallet = $user_records['0']['wallet_amount'];\n\t\t\t\t$contact_number_main = $user_records['0']['user_contact_no'];\n\t\t\t\t// main user mobile number\n\t\t\t\tif ($main_wallet >= $amount) {\n\t\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t\t\tif (!empty($records)) {\n\t\t\t\t\t\t$contact_number_frnd = $records['0']['user_contact_no'];\n\t\t\t\t\t\t// frnd mobile number\n\t\t\t\t\t\t$frnd_wallet = $records['0']['wallet_amount'];\n\t\t\t\t\t\t$frnd_id = $records['0']['user_id'];\n\t\t\t\t\t\tif ($frnd_id != $user_id) {\n\t\t\t\t\t\t\t// amount transfer to another\n\t\t\t\t\t\t\t$transaction_id1 = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t$w_to_desc = \"Amount transfer to \" . $contact_number_frnd;\n\t\t\t\t\t\t\t$wallet_to_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_to . '\",\"' . $transaction_id1 . '\",\"' . $w_to_desc . '\",\"' . $contact_number_frnd . '\"');\n\t\t\t\t\t\t\tif (!empty($wallet_to_transfer)) {\n\t\t\t\t\t\t\t\t//amount recieved by transfer\n\t\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t\t$w_by_desc = \"Amount transfer from \" . $contact_number_main;\n\t\t\t\t\t\t\t\t$wallet_by_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $frnd_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_from . '\",\"' . $transaction_id . '\",\"' . $w_by_desc . '\",\"' . $contact_number_main . '\"');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!empty($wallet_by_transfer)) {\n\t\t\t\t\t\t\t\t$main_wallet_money = $main_wallet - $amount;\n\t\t\t\t\t\t\t\t$frnd_wallet_money = $frnd_wallet + $amount;\n\t\t\t\t\t\t\t\t// update main user wallet\n\t\t\t\t\t\t\t\t$data['wallet_amount'] = $main_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data);\n\t\t\t\t\t\t\t\t// update frnd wallet//\n\t\t\t\t\t\t\t\t$data1['wallet_amount'] = $frnd_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $frnd_id, $data1);\n\t\t\t\t\t\t\t\t$post = array('status' => 'true', 'message' => 'Transfer money successfully', 'main_user_id' => $user_id, 'main_wallet' => $main_wallet_money, 'frnd_wallet' => $frnd_wallet_money, 'frnd_id' => $frnd_id, 'transfer_mobile' => $mobile_no, 'transfer_amount' => $amount, 'transaction_id' => $transaction_id1, 'transfer_date' => $current_date);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Error in transfering amount\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Please enter another user number\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"This user is not exist of given number\");\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Wallet amount is not sufficent to transfer money\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"invalid user\", 'user_id' => $user_id);\n\t\t\t}\n\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"missing parameter\", 'user_id' => $user_id, 'amount' => $amount, 'mobile' => $moble);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "private function depositToWallet() {\n # there is not api_limited_quota/cashier_quota msg\n # transfer function has to return error_code and error_msg\n }", "public function transfer($oldId, $newId);", "function transfer($details,$fromAccount=true){\n\t\n\t// The sending account and the database:\n\tglobal $verifiedAccount,$dz;\n\t\n\tif(!isset($details['ToAddress'])){\n\t\t\n\t\t// Get an address for the username (inline updates details):\n\t\tgetAddress($details);\n\t\t\n\t}\n\t\n\t// Get the commodity:\n\t$commodity=$details['Commodity'];\n\t\n\t// The amount too:\n\t$amount=$details['Amount'];\n\t\n\t// Get the to address:\n\t$toAddress=$details['ToAddress'];\n\t\n\t// Is this an internal transfer? (I.e. within this same bank):\n\t$internalTransfer=(!$toAddress);\n\t\n\t$balance=null;\n\t\n\t// Is it coming from the bank itself, or from an account?\n\tif($fromAccount){\n\t\t\n\t\t// Find a suitable 'from' balance.\n\t\t// (There should only ever be one. Just in case though, we don't want to lock more than one row):\n\t\t$balance=$dz->get_row('select `ID` from `Bank.Account.Balances` where `Account`='.$verifiedAccount.' and `Commodity`=\"'.$commodity.'\" and `Amount`>='.$amount);\n\t\t\n\t\tif(!$balance){\n\t\t\t\n\t\t\t// Not enough funds in the right currency.\n\t\t\terror('account/nofunds');\n\t\t\t\n\t\t}\n\t\t\n\t\t// Lock the amount in that balance row.\n\t\t// If a locked amount is present at startup then a crash occured during a transaction.\n\t\t// If it's severe, the balances can be rebuilt from the transaction history.\n\t\t$locked=$dz->query(\n\t\t\t'update `Bank.Account.Balances` set `LockedAmount`=`LockedAmount`+'.$amount.\n\t\t\t',`Amount`=`Amount`-'.$amount.' where `ID`='.$balance['ID'].' and `Amount`>='.$amount\n\t\t);\n\t\t\n\t\t// Did we successfully lock?\n\t\tif(!$locked){\n\t\t\t\n\t\t\t// Not enough funds in the right currency.\n\t\t\terror('account/nofunds');\n\t\t\t\n\t\t}\n\t\t\n\t\t// Ok! We've locked the balance.\n\t\t\t\n\t\t// Create a transaction row:\n\t\t$dz->query(\n\t\t\t'insert into `Bank.Transactions`(`Account`,`Type`,`Reference`,`ItemInformation`,`Amount`,`Commodity`,`Username`,`Title`,`TimeAt`,`Name`) values('.\n\t\t\t$verifiedAccount.',2,\"'.escape($details['Reference'],false).'\",\"'.escape($details['ItemInformation'],false).'\",'.$amount.',\"'.$commodity.'\",\"'.$details['Username'].'\",\"'.escape($details['Title'],false).'\",'.time().',\"'.escape($details['Name'],false).'\")');\n\t\t\n\t}\n\t\n\tif($internalTransfer){\n\t\t\n\t\t// It's an internal transaction.\n\t\t// Name needs to be changed first (it's the name of the sender, which we don't know at this point):\n\t\t$details['Name']='';\n\t\t\n\t\t// Update the receiving account:\n\t\treceive($details);\n\t\t\n\t}else{\n\t\t\n\t\t// Interbank transfer.\n\t\t// Need to select some suitable balances to use to send with.\n\t\t// For now, we'll just assume that a single balance can be found that has enough in it:\n\t\t$balanceRow=$dz->get_row('select `Bank.Balances`.`Key`,`Bank.Balances`.`Private`,`Root.Balances`.`Balance` from `Bank.Balances` left join `Root.Balances` on `Root.Balances`.`Key`=`Bank.Balances`.`Key` where `Root.Balances`.`Commodity`=\"'.$commodity.'\" and `Root.Balances`.`Balance`>='.$amount);\n\t\t\n\t\tif(!$balanceRow){\n\t\t\t// This bank doesn't have a single balance with enough funds in it.\n\t\t\t// A more advanced implementation would combine multiple balances to ensure there's enough.\n\t\t\t// For now though, and to avoid making the consumer freak out, we'll just say the transaction amount is too high:\n\t\t\terror('amount/toohigh');\n\t\t}\n\t\t\n\t\t// Get the from address:\n\t\t$fromAddress=bin2hex($balanceRow['Key']);\n\t\t\n\t\t// Get the target group:\n\t\t$toGroup=$details['ToGroup'];\n\t\t\n\t\tif(strlen($toAddress)!=130){\n\t\t\t\n\t\t\t// It's binary.\n\t\t\t$toAddress=bin2hex($toAddress);\n\t\t\t\n\t\t}\n\t\t\n\t\t// Perform a global transfer now:\n\t\tglobalTransfer($fromAddress,$toAddress,$toGroup,$amount,$balanceRow['Balance'],$balanceRow['Private']);\n\t\t\n\t}\n\t\n\t// Success!\n\t\n\tif($balance){\n\t\n\t\t// Now unlock the amount in the sender:\n\t\t$dz->query(\n\t\t\t'update `Bank.Account.Balances` set `LockedAmount`=`LockedAmount`-'.$amount.\n\t\t\t' where ID='.$balance['ID']\n\t\t);\n\t\n\t}\n\t\n}", "public function processTransfer($fromAccount, $toAccount, $amount)\n {\n $dbTransaction = $this->db->beginTransaction();\n\n $transaction = new PaymentTransaction();\n $transaction->save();\n\n $debetPayment = new Payment();\n $debetPayment->transaction_id = $transaction->id;\n $debetPayment->account_id = $fromAccount->id;\n $debetPayment->type_id = PaymentType::DEBET;\n $debetPayment->amount = $amount;\n $debetPayment->save();\n\n $creditPayment = new Payment();\n $creditPayment->transaction_id = $transaction->id;\n $creditPayment->account_id = $toAccount->id;\n $creditPayment->type_id = PaymentType::CREDIT;\n $creditPayment->amount = $amount;\n $creditPayment->save();\n\n // perform addition via database because in application decimal values will be converted to float\n\n $this->db->createCommand()->update(\n $fromAccount->tableName(),\n ['amount' => new DbExpression('amount - :amount')],\n ['id' => $fromAccount->id],\n [':amount' => $amount]\n )->execute();\n\n $this->db->createCommand()->update(\n $toAccount->tableName(),\n ['amount' => new DbExpression('amount + :amount')],\n ['id' => $toAccount->id],\n [':amount' => $amount]\n )->execute();\n\n $fromAccount->refresh();\n $toAccount->refresh();\n\n $this->state_id = TransferState::ACCEPTED;\n $this->save();\n\n $dbTransaction->commit();\n }", "public function submit_transfer(Request $request) {\n $receiver = User::where('account_number', $request->account)->first();\n $sender = User::where('id', Auth::id())->first();\n $txnId = 'TRF/'. date('ymd') . '/' .Str::upper(Str::random(10));\n $min = Config::get('minimum_transfer', 100);\n\n if ($sender->balance < $request->amount) {\n return redirect()->back()->with('fail', 'Insufficient balance to complete this transaction');\n }\n\n if ($min > $request->amount) {\n return redirect()->back()->with('fail', \"Minimum amount to transfer is equivalent of $$min\");\n }\n\n // Check for valid user\n if (!$receiver) {\n return redirect()->back()->with('fail', 'Please provide a valid user account number');\n }\n\n // Compare user currency type\n if ($receiver->account_type != $request->currency) {\n return redirect()->back()\n ->with('fail', \"Receiver's account does not support currency type: $request->currency\");\n }\n\n $receiverTxnData['account_name'] = $sender->fullName;\n $receiverTxnData['account_number'] = $sender->account_number;\n $receiverTxnData['txnId'] = $txnId;\n $receiverTxnData['type'] = 'Credit';\n $receiverTxnData['amount'] = $request->amount;\n $receiverTxnData['currency'] = $request->currency;\n $receiverTxnData['status'] = 'SUCCESSFUL';\n\n $senderTxnData['account_name'] = $receiver->fullName;\n $senderTxnData['account_number'] = $receiver->account_number;\n $senderTxnData['txnId'] = $txnId;\n $senderTxnData['type'] = 'Debit';\n $senderTxnData['amount'] = $request->amount;\n $senderTxnData['currency'] = $request->currency;\n $senderTxnData['status'] = 'SUCCESSFUL';\n\n DB::transaction(function () use ($receiver, $sender, $request, $receiverTxnData, $senderTxnData) {\n $sender->balance -= $request->amount;\n $sender->transactions()->create($senderTxnData);\n $sender->save();\n\n $receiver->balance += $request->amount;\n $receiver->transactions()->create($receiverTxnData);\n $receiver->save();\n });\n\n return redirect()->route('user.dashboard')->with('success', 'Transaction was successful');\n }", "function transfer_money(){\n\t\t$user_id=$_REQUEST['user_id'];\n\t\t$mobile=country_code.$_REQUEST['mobile_no'];\n\t\t$amount=$_REQUEST['amount'];\n\t\t$mobile_no=$_REQUEST['mobile_no'];\n\t \n\t\t\n\t\t//$transaction_id= mt_rand( 10000000, 99999999);\n\t\t$wallet_type_main=2;// amount debit in user self\n\t\t$wallet_type_frnd=1;// amount credit in frnd\n\t\t$wallet_category_to=5;// transfer money to\n\t\t$wallet_category_from=10;// transfer money from\n\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\tif(!empty($mobile)){\n\t\t\t$user_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif(!empty($user_records)){\n\t\t\t$main_wallet=$user_records['0']['wallet_amount'];\n\t\t\t$contact_number_main=substr($user_records['0']['user_contact_no'],4); // main user mobile number\n\t\t\tif($main_wallet>=$amount){\n\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t\tif(!empty($records)){\n\t\t\t\t$contact_number_frnd=substr($records['0']['user_contact_no'],4); // frnd mobile number\n\t\t\t\t$frnd_wallet=$records['0']['wallet_amount']; \n\t\t\t\t$frnd_id=$records['0']['user_id'];\n\t\t\t\tif($frnd_id !=$user_id){\n\t\t\t\t\t// amount transfer to another\n\t\t\t$transaction_id1= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t$w_to_desc=\"Amount transfer to \".$contact_number_frnd;\n\t\t\t\t\t\t$wallet_to_transfer = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_to . '\",\"' .$transaction_id1 . '\",\"' . $w_to_desc . '\",\"' . $contact_number_frnd . '\"');\n\t\t\t\t\t\tif(!empty($wallet_to_transfer)){\n\t\t\t\t\t\t\t//amount recieved by transfer\n\t\t\t\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t$w_by_desc=\"Amount transfer from \".$contact_number_main;\n\t\t\t\t\t\t$wallet_by_transfer = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $frnd_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_from . '\",\"' .$transaction_id . '\",\"' . $w_by_desc . '\",\"' . $contact_number_main . '\"');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!empty($wallet_by_transfer)){\n\t\t\t\t\t\t\t\t$main_wallet_money=$main_wallet-$amount;\n\t\t\t\t\t\t\t\t$frnd_wallet_money=$frnd_wallet+$amount;\n\t\t\t\t\t\t\t\t// update main user wallet\n\t\t\t\t\t\t\t\t$data['wallet_amount']=$main_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user_id, $data);\n\t\t\t\t\t\t\t\t// update frnd wallet//\n\t\t\t\t\t\t\t\t$data1['wallet_amount']=$frnd_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$frnd_id, $data1);\n\t\t\t\t\t\t\t\t\t$post=array('status'=>'true','message'=>'Transfer money successfully','main_user_id'=>$user_id,'main_wallet'=>$main_wallet_money,'frnd_wallet'=>$frnd_wallet_money,'frnd_id'=>$frnd_id,'transfer_mobile'=>$mobile_no,'transfer_amount'=>$amount,'transaction_id'=>$transaction_id1,'transfer_date'=>$current_date);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Error in transfering amount\");\n\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Please enter another user number\");\n\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"This user is not exist of given number\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Wallet amount is not sufficent to transfer money\");\n\t\t\t}\n\t\t\t}else{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"invalid user\",'user_id'=>$user_id);\n\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"missing parameter\",'user_id'=>$user_id,'amount'=>$amount,'mobile'=>$moble);\n\t\t}\necho $this -> json($post);\n\t}", "public function createTransactions(Request $request, $id)\n {\n // First authorization (but we don't have)\n\n // Validation of user data\n $rules = [\n 'to_id' => 'required|integer|min:0',\n 'amount' => 'required|numeric|min:0.01',\n 'details' => 'nullable',\n ];\n $validator = Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n $response = [\n 'status' => false,\n 'errors' => $validator->errors()->all(),\n ];\n return response()->json($response, 200);\n }\n\n // People can't have transaction to themselves (by editing front-end code)\n if($request->to_id == $id){\n $response = [\n 'status' => false,\n 'errors' => [__('validation.selfTransaction')],\n ];\n return response()->json($response, 200);\n }\n\n // From Account\n $from_account = Account::findOrFail($id);\n\n // Checking balance | Bank doesn't allow less than zero for balance number.\n if($from_account->balance < ($request->amount + $this->bank_fee)){\n $response = [\n 'status' => false,\n 'errors' => [__('validation.notEnoughBalance')],\n ];\n return response()->json($response, 200);\n }\n\n // Checking destination account\n $to_account = Account::find($request->to_id);\n if(!$to_account){\n $response = [\n 'status' => false,\n 'errors' => [__('validation.destAccountNotFound')],\n ];\n return response()->json($response, 200);\n }\n\n // Process\n $from_account->balance = $from_account->balance - ($request->amount + $this->bank_fee);\n $from_account->save();\n $to_account->balance = $to_account->balance + $request->amount;\n $to_account->save();\n // App\\Observers\\AccountObserver will handle post {action} tasks\n\n // Inserting transaction\n $transaction = new Transaction;\n $transaction->from_id = $from_account->id;\n $transaction->to_id = $to_account->id;\n $transaction->amount = $request->amount;\n $transaction->details = $request->details;\n $transaction->save();\n // App\\Observers\\TransactionObserver will handle post {action} tasks\n\n // Now we can send Notifications\n\n // At last...\n $response = [\n 'status' => true,\n 'model' => $transaction->load('from.user', 'to.user'),\n 'new_balance' => $from_account->balance,\n ];\n return response()->json($response, 200);\n }", "public function getDeleteTransfers($id){\n\n $transfersMoney = TransfersMoney::find($id);\n\n if(empty($transfersMoney)){\n return redirect('wallets/getList')->with(['flash_level'=>'danger','flash_message'=>'Does not exist in the database']);\n }\n\n $transfersMoney ->delete($id);\n }", "function process_transfer($from_id, $to_id) {\n\t\tglobal $wpdb;\n\t\t$wpdb->query($wpdb->prepare(\"UPDATE {$wpdb->base_prefix}pro_sites_stripe_customers SET blog_id = %d WHERE blog_id = %d\", $to_id, $from_id) );\t\n\t}", "public function account_transaction($id) {\n $options = [\n 'projection' => [\n '_id' => 1,\n 'purchase_inv_id' => 1,\n 'subscription_cost' => 1,\n 'setup_cost' => 1,\n 'amount' => 1,\n 'package_type' => 1,\n 'payment_terms' => 1,\n 'createddate' => 1,\n 'expirydate' => 1,\n 'paid_status' => 1,\n 'txnID' => 1,\n 'ePGTxnID' => 1,\n 'currency' => 1,\n 'responsecode' => 1,\n 'response_msg' => 1,\n 'pay_mode' => 1,\n 'service_tax' => 1,\n 'service_tax_cost' => 1\n ]\n ];\n\n $query_result = $this->mongo_db->find(MDB_PACKAGE_INFO, ['_id' => (int) $id], $options);\n $result = (!empty($query_result) && isset($query_result[0])) ? $query_result[0] : array();\n return $result;\n }", "function globalTransfer($fromAddress,$toAddress,$toGroup,$amount,$fromBalance,$private){\n\t\n\t// Request the root now:\n\tglobal $thisEntity;\n\t\n\t// Get the from group:\n\t$fromGroup=$thisEntity['Group'];\n\t\n\t// Build the signed data:\n\t$signed=$fromGroup.'/'.$fromAddress.'-'.$toGroup.'/'.$toAddress.'-'.$amount.'-'.$fromBalance;\n\t\n\t// Sign it:\n\t$signature=base64_encode( sign($signed,$private) );\n\t\n\t// Call the root API:\n\t$error;\n\t$response=callRoot(\n\t\t'transfer/create',\n\t\t'{\"from\":{\"address\":\"'.$fromAddress.'\",\"group\":'.$fromGroup.',\"balance\":'.$fromBalance.'},\"to\":{\"address\":\"'.$toAddress.'\",\"group\":'.$toGroup.'},\"amount\":'.$amount.',\"signature\":\"'.$signature.'\"}',\n\t\t$error\n\t);\n\t\n\tif($error){\n\t\t\n\t\t// Remote server generated an error:\n\t\terror('remote/error',$error);\n\t\t\n\t}\n\t\n\t// Success!\n\treturn true;\n\t\n}", "function debit_transaction($order_id, $amount, $currency, $txn_id, $reason, $origin) {\n\n\t\n\t$type = \"DEBIT\";\n\t$date = (gmdate(\"Y-m-d H:i:s\"));\n// check to make sure that there is no debit for this transaction already\n\n\t$sql = \"SELECT * FROM transactions where txn_id='$txn_id' and `type`='DEBIT' \";\n\t$result = mysql_query($sql) or die(mysql_error().$sql);\n\tif (mysql_fetch_array($result)==0) {\n\t\t$sql = \"INSERT INTO transactions (`txn_id`, `date`, `order_id`, `type`, `amount`, `currency`, `reason`, `origin`) VALUES('$txn_id', '$date', '$order_id', '$type', '$amount', '$currency', '$reason', '$origin')\";\n\n\t\t$result = mysql_query ($sql) or die (mysql_error().$sql);\n\t}\n\n\n}", "public function postTransfersMoney(TransfersMoneyRequest $request){\n\n if($request->transfer_wallet == $request->receive_wallet ){\n\n return redirect('wallets/getTransfersMoney')->with(['flash_level'=>'danger','flash_message'=>\"You can not transfer money in the same wallet !\"]);\n }\n\n //Get wallet data Transfers \n $amountTransfer = Wallets::select('amount')->where('id',$request->transfer_wallet)->get();\n\n $amountTran = $amountTransfer[0]->amount;\n\n if($amountTran < $request->amount || $amountTran == 0 ){\n\n return redirect('wallets/getTransfersMoney')->with(['flash_level'=>'danger','flash_message'=>\"The money in the wallet is not enough to transfer !\"]);\n }\n\n \n // insert Transfers Money\n $transfersMoney = new TransfersMoney;\n $transfersMoney ->transfer_wallet = $request->transfer_wallet;\n $transfersMoney ->receive_wallet = $request->receive_wallet;\n $transfersMoney ->amount = $request->amount;\n $transfersMoney ->user_id = Auth::user()->id;\n $transfersMoney ->save();\n\n DB::table('transactions')->insert([\n ['user_id' => Auth::user()->id, 'wallets_id' => $request->transfer_wallet,'amount'=> $request->amount,'type'=>1],\n ['user_id' => Auth::user()->id, 'wallets_id' => $request->receive_wallet,'amount'=> $request->amount,'type'=>2],\n ]);\n\n\n return redirect('wallets/getListTransfers')->with(['flash_level'=>'success','flash_message'=>'Transfer money successfully!!!']);\n }", "function edd_wallet_add_funds( $payment_id ) {\n\t$fees = edd_get_payment_fees( $payment_id );\n\n\tif( $fees && count( $fees ) == 1 ) {\n\t\tif( $fees[0]['id'] == 'edd-wallet-deposit' ) {\n\n\t\t\t// Disable purchase receipts... we send our own emails\n\t\t\tremove_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999 );\n\n\t\t\t// Send our custom emails\n\t\t\tedd_wallet_send_email( 'user', $payment_id );\n\n\t\t\t// Get the ID of the purchaser\n\t\t\t$user_id = edd_get_payment_user_id( $payment_id );\n\n\t\t\t// Deposit the funds\n\t\t\tedd_wallet()->wallet->deposit( $user_id, $fees[0]['amount'], 'deposit', $payment_id );\n\n\t\t\t// Tag the payment so we can find it later\n\t\t\tedd_update_payment_meta( $payment_id, '_edd_wallet_deposit', $user_id );\n\t\t}\n\t}\n}", "public function transferToAccount(Request $request){\n\n //Validation of data\n $rules = [\n 'type_acc_sender' => 'required',\n 'type_acc_receiver'=>'required',\n 'montant_virement'=>'required',\n 'type'=>'required | integer | between:0,1'\n ];\n $data=$request->json()->all();\n $validator = Validator::make($data, $rules);\n if (!$validator->passes()) {\n dispatch(new LogJob('','', 'Input validation error',11,LogJob::FAILED_STATUS));\n return response()->json(['message' => $validator->errors()->all()], 400);\n }\n try{\n DB::beginTransaction();\n $currency = new CurrenciesController();\n $amount = $data['montant_virement'];\n $new_amount = $amount;\n\n //Get the id of the customer\n $id_customer = $request->user()->id;\n\n\n //sender and receiver account\n $account_sender = $this->accountService->findAccountByType($data['type_acc_sender'],$id_customer,0);\n $account_receiver = $this->accountService->findAccountByType($data['type_acc_receiver'],$id_customer,0);\n //if the receiver account dosen't exist\n if(is_null($account_receiver)){\n //log\n dispatch(new LogJob($account_sender->id_customer,null,'receiver not found',11,\n LogJob::FAILED_STATUS));\n return response(json_encode(['message'=>'receiver not found']),404);\n }\n //if the receiver account != current account\n if($data['type_acc_receiver'] == $data['type_acc_sender']) {\n //log\n dispatch(new LogJob($account_sender->id_customer, $account_receiver->id_customer, 'Transfer to the same account', 11,\n LogJob::FAILED_STATUS));\n return response(json_encode(['message' => 'Virement vers le meme compte ']), 400);\n }\n //if the amount is bigger than the sender balance\n if ($amount > $account_sender->balance) {\n //log\n dispatch(new LogJob($account_sender->id_customer, $account_receiver->id_customer, 'Transfer with insuffsant balance', 11,\n LogJob::FAILED_STATUS));\n return response(json_encode(['message' => 'balance insuffisant ']), 400);\n }\n\n\n // type currency dollar or euro\n if($data['type_acc_sender'] >= 3 || $data['type_acc_receiver'] >= 3 ){\n\n $new_amount = $currency->exchangeRate($amount,$account_sender->currency_code,$account_receiver->currency_code);\n }\n\n //Find the commission code\n $codeCommission = $this->codeCommission($data['type_acc_sender'], $data['type_acc_receiver']);\n\n\n $this->virementInterneService->create($codeCommission, 0, $amount,$new_amount, $account_sender, $account_receiver, $data['type']);\n\n\n DB::commit();\n $newBalance = $account_receiver->balance;\n // Send mail\n $customer = $request->user();\n $this->virementInterneService->sendVirementSameUserNotifMAil($customer->email,\n $account_sender->getCode(),$account_receiver->getCode(),\n $new_amount,$account_receiver->code_curr_receiver);\n\n return response(json_encode(['message' => 'transfer success', 'balance' => $newBalance]),201);\n } catch (\\Exception $e) {\n DB::rollback();\n //log information\n dispatch(new LogJob($account_sender->id_customer, $account_receiver->id_customer, $e->getMessage(), 11, LogJob::FAILED_STATUS));\n return response()->json(['message' => $e->getMessage()], 500);\n }\n }", "function transfer_eth($currency=\"\",$transdata){\r\n\r\n\r\n \t\t$bitcoin_row \t\t= get_cn_data($currency);\r\n\t\t\t$bitcoin_portnumber = insep_decode($bitcoin_row[\"port\"]);\r\n\t\t\t$bitcoin_ipaddress \t= insep_decode($bitcoin_row[\"ip\"]);\t\r\n\t\t\t $adminEthAddr \t\t= $this->get_currancy_address($currency);\t\t\t\r\n\t\t\r\n\r\n\t\t\t\r\n \t\t\t$amountdata=$transdata->row();\r\n \t\t$sendAmount=$amountdata->transfer_amount;\r\n \t\t$currencyToAddress=$amountdata->to_address;\r\n \t\t$key=trim($this->input->post(\"password\"));\r\n\r\n\t\t\t$data1 \t = array('port'=>$bitcoin_portnumber,'from'=>$adminEthAddr,'sendaddress'=>$currencyToAddress,'withdraw_amount'=>$sendAmount,'keyword' => '98543423','name'=>'bitcocyrus.com','key'=>$key,'method'=>'ethwithdraw');\r\n\t\t\t$output = connecteth('ethwithdraw',$data1);\r\n\r\n\t\t\r\n\t\t\t\t $txn_id \t= $output->result;\r\n\t\t\t\t\tif($output->type == 'success') {\r\n\t\t\t\t\t\tif($txn_id != '') {\r\n\t\t\t\t\t\t\treturn $txn_id;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$this->session->set_flashdata(\"error\",$output);\r\n\t\t\t\t\t\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\t\t\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}else\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->session->set_flashdata(\"error\",$output);\r\n\t\t\t\t\t\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\t\r\n\r\n\t\t\t}\r\n\r\n\t}", "public function transfersto()\n {\n return $this->hasMany('Transfer', 'accountto_id');\n }", "public function createBetweenMyAccounts(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'method' => 'required|in:cour_epar,epar_cour,cour_devi_usd,devi_cour_usd,cour_devi_eur,devi_cour_eur',\n 'amount' => 'required|numeric|min:0'\n ]);\n if ($validator->fails()) {\n return response($validator->errors(), config('code.BAD_REQUEST'));\n }\n\n $amount = $request->input('amount');\n $method = $request->input('method');\n $hasEnoughMoney = false;\n $hasTheAccount = false;\n\n /**start transaction**/\n DB::beginTransaction();\n\n //todo check if he had this type of account\n\n try {\n\n $senderAccount = $this->client()->accounts()\n ->typeSender($method)->first();//todo check methode first()\n\n $receiverAccount = $this->client()->accounts()\n ->typeReceiver($method)->first();//todo check methode first()\n\n //check has the account\n if (is_null($receiverAccount)) throw new \\Exception;\n $hasTheAccount = true;\n\n //check the amount\n if (!$senderAccount->hasEnoughMoney($amount)) throw new \\Exception;\n $hasEnoughMoney = true;\n\n //create the transfer\n $mapMethodeToCommission = ['cour_epar' => 'COUR_EPART', 'epar_cour' => 'EPART_COUR',\n 'cour_devi_usd' => 'COUR_DEV', 'cour_devi_eur' => 'COUR_DEV',\n 'devi_cour_eur' => 'DEV_COUR', 'devi_cour_usd' => 'DEV_COUR'];\n $str = 'commission.' . $mapMethodeToCommission[$method];\n $commission = config('commission.' . $mapMethodeToCommission[$method]) * $amount;\n $now = \\Carbon\\Carbon::now();\n $nb = BalanceHistory::count();//todo fix this !all sol tested! re-migrate DB\n //sender history\n $mapMethodeToTransactionType = ['cour_epar' => 'vir_epar', 'epar_cour' => 'vir_cour',\n 'cour_devi_usd' => 'vir_devi', 'cour_devi_eur' => 'vir_devi',\n 'devi_cour_eur' => 'vir_cour', 'devi_cour_usd' => 'vir_cour'];\n BalanceHistory::create([\n 'id' => $nb + 1,\n 'amount' => $amount + $commission,//todo put it negative !!\n 'transaction_type' => $mapMethodeToTransactionType[$method],\n 'transaction_direction' => 'out',\n 'account_id' => $senderAccount->number,\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n\n\n //receiver history\n BalanceHistory::create([\n 'id' => $nb + 2,\n 'amount' => $amount,\n 'transaction_type' => $mapMethodeToTransactionType[$method],\n 'transaction_direction' => 'in',\n 'account_id' => $receiverAccount->number,\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n //change the amount of the destination client\n $receiverAccount->balance = $receiverAccount->balance + $amount;\n $receiverAccount->save();\n\n $mapMethodeToTransferType = ['cour_epar' => 'cour_epar', 'epar_cour' => 'epar_cour',\n 'cour_devi_usd' => 'cour_devi', 'cour_devi_eur' => 'cour_devi',\n 'devi_cour_eur' => 'devi_cour', 'devi_cour_usd' => 'devi_cour'];\n InternTransfer::create([\n 'code' => $senderAccount->number . $receiverAccount->number . $now->format('YmdHi'),\n 'amount' => $amount,\n 'transferDate' => $now->format('Y-m-d H:i:s'),\n 'creationDate' => $now->format('Y-m-d H:i:s'),\n 'status' => 'valide',\n 'transfers_type' => $mapMethodeToTransferType[$method],\n 'commission' => $commission,\n 'source_id' => $senderAccount->number,\n 'destination_id' => $receiverAccount->number,\n ]);\n\n //todo send commission to Tharwa account\n //we retrieve the amount from the sender account\n $senderAccount->balance = $senderAccount->balance - $commission - $amount;\n $senderAccount->save();\n\n\n// Mail::to($request->input('email'))\n// ->queue(new ClientRequestValidatedMail($acceptedClient->firstname.' '.$acceptedClient->lastname\n// , $request->input('code')));\n\n // all good\n /**commit - no problems **/\n DB::commit();\n return response([\"saved\" => true], config('code.CREATED'));\n\n } catch (\\Exception $e) {\n\n // something went wrong\n /**rollback every thing - problems **/\n DB::rollback();\n\n if (!$hasTheAccount)\n return response([\"account\" => false], config('code.NOT_FOUND'));\n\n if (!$hasEnoughMoney)\n return response([\"amount\" => false], config('code.NOT_FOUND'));\n\n return response([\"saved\" => false], config('code.UNKNOWN_ERROR'));\n }\n\n }", "public function transfersfrom()\n {\n return $this->hasMany('Transfer', 'accountfrom_id');\n }", "public function getEditTransfers($id){\n\n $listwallets = Wallets::select('id','name')->where('user_id',Auth::user()->id)->get();\n if(empty($listwallets)){\n\n return redirect('home')->with(['flash_level'=>'success','flash_message'=>'You do not have wallets']);\n\n }\n\n $transfersMoney = TransfersMoney::find($id);\n \n\n return view('quanlytaichinh.transfers-money.transfersMoneyEdit',compact('listwallets','transfersMoney'));\n }", "protected function checkAccountTransferRequest($id, $amount, $target_id, $target_object_name, $date)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling checkAccountTransfer'\n );\n }\n // verify the required parameter 'amount' is set\n if ($amount === null || (is_array($amount) && count($amount) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $amount when calling checkAccountTransfer'\n );\n }\n // verify the required parameter 'target_id' is set\n if ($target_id === null || (is_array($target_id) && count($target_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $target_id when calling checkAccountTransfer'\n );\n }\n // verify the required parameter 'target_object_name' is set\n if ($target_object_name === null || (is_array($target_object_name) && count($target_object_name) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $target_object_name when calling checkAccountTransfer'\n );\n }\n // verify the required parameter 'date' is set\n if ($date === null || (is_array($date) && count($date) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $date when calling checkAccountTransfer'\n );\n }\n\n $resourcePath = '/CheckAccount/{id}/transfer';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($amount !== null) {\n $queryParams['amount'] = ObjectSerializer::toQueryValue($amount);\n }\n // query params\n if ($target_id !== null) {\n $queryParams['target[id]'] = ObjectSerializer::toQueryValue($target_id);\n }\n // query params\n if ($target_object_name !== null) {\n $queryParams['target[objectName]'] = ObjectSerializer::toQueryValue($target_object_name);\n }\n // query params\n if ($date !== null) {\n $queryParams['date'] = ObjectSerializer::toQueryValue($date);\n }\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/xml', 'application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/xml', 'application/json'],\n ['application/x-www-form-urlencoded']\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n $httpBody = $_tempBody;\n // \\stdClass has no __toString(), so we should encode it manually\n if ($httpBody instanceof \\stdClass && $headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($httpBody);\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValue\n ];\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('token');\n if ($apiKey !== null) {\n $queryParams['token'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'PUT',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getTransaction(Wallet $wallet, $id): Transaction;", "public function generateDirectDebitTransactions($transactions)\n {\n foreach ($transactions as $transaction) {\n try {\n //add Payment Info transactions\n if ($transaction instanceof \\SEPA\\DirectDebitTransaction) {\n $this->paymentInfoObject->addDirectDebitTransaction($transaction);\n } else {\n $transaction = $this->objectToArray($transaction);\n\n $this->paymentInfoObject->addDirectDebitTransaction(\n SEPAXmlGeneratorFactory::createXMLDirectDebitTransaction()\n ->setInstructionIdentification($transaction['id'])\n ->setEndToEndIdentification($transaction['endId'])\n ->setInstructedAmount($transaction['amount'])\n ->setDebtorName($transaction['company_name'])\n ->setDebitIBAN($transaction['iban'])\n ->setDebitBIC($transaction['bic'])\n ->setMandateIdentification($transaction['umr'])\n ->setDateOfSignature($transaction['mandate_sign_date'])\n //->setCurrency('EUR')\n ->setDirectDebitInvoice($transaction['invoice'])\n );\n }\n } catch (Exception $e) {\n //Your logs here\n //$e->getMessage();\n }\n }\n }", "public function fromAccountToAnother(Account $account)\n {\n $data = request()->only([\"to\", \"motivation\", \"amount\"]);\n\n $to = Account::where(\"id\", $data['to'])->firstOrFail();\n\n if(!$account->canPay($data['amount'])) throw new TransactionNotAllowed(\"Not enough funds\");\n try {\n Transaction::create([\n \"amount\" => $data['amount'],\n \"motivation\" => $data[\"motivation\"],\n \"account_to\" => $data['to'],\n \"account_from\" => $account->id,\n \"isCredit\" => true\n ]);\n } catch (\\Exception $exception) {\n throw $exception;\n }\n\n return response()->json(\"Transaction success\");\n }", "public function transfer($customer_sender_id)\n {\n //\n $customer = DB::select('SELECT * FROM customers WHERE id = ?', [$customer_sender_id]);\n $all_customers = DB::select('SELECT * FROM customers WHERE id != ?', [$customer_sender_id]);\n\n return view('customers.transfer')->with(['customer'=>$customer[0], 'customers'=>$all_customers]);\n }", "public function showTransactions($id)\n {\n // First authorization (but we don't have)\n\n // We dont need to check $id here because if its a fake number, no transactions will be retrieved\n $transactions = Transaction::where('from_id', $id)->orWhere('to_id', $id)->get();\n\n $response = [\n 'status' => true,\n 'model' => $transactions->load('from.user', 'to.user'),\n ];\n return response()->json($response, 200);\n }", "public function transfer()\n {\n $transfer = oxNew('tc_cleverreach_transfer');\n\n $complete = (boolean)oxRegistry::getConfig()->getRequestParameter('full');\n $offset = (int)oxRegistry::getConfig()->getRequestParameter('offset');\n\n $transfer->setOffset($offset);\n\n try {\n list($count, $transferResult) = $transfer->run($this->getTimer(), $complete);\n } catch (tc_group_not_found_exception $e) {\n $this->error = $e->getMessage();\n $this->_aViewData['blShowListResetPopUp'] = true;\n\n return;\n } catch (\\Exception $e) {\n $this->error = $e->getMessage();\n\n return;\n }\n\n if (is_array($transferResult) === true && (count($transferResult) === 0 || $transferResult[0] === false)) {\n $this->metaRefreshValues['end'] = true;\n // Transfer fertig\n $this->transferComplete();\n\n return;\n }\n\n // Daten sind fehlerhaft\n if ($transferResult === false) {\n $lang = oxRegistry::getLang();\n $msg = $lang->translateString('TC_CLEVERREACH_ERROR_NO_KEY');\n $this->tcError = $msg;\n\n return false;\n\n // Alle Daten übertragen\n } elseif ($transferResult === true) {\n $this->metaRefreshValues['end'] = true;\n // Transfer fertig\n $this->transferComplete();\n\n return;\n // Anzeige ? Nutzer|Bestellungen\n } elseif (is_array($transferResult) === true) {\n $transferType = 'user';\n $iReceiver = $count;\n\n // add full flag, to check for full list export\n $full = (int)oxRegistry::getConfig()->getRequestParameter('full');\n $this->metaRefreshValues['full'] = $full;\n $this->metaRefreshValues['function'] = 'transfer';\n $this->metaRefreshValues['transfer'] = $transferType;\n $this->metaRefreshValues['iReceiver'] = $iReceiver;\n $this->metaRefreshValues['refresh'] = 0;\n $this->metaRefreshValues['offset'] = $this->getTimer() + (int)oxRegistry::getConfig()->getRequestParameter('offset');\n }\n }", "public function getTransaction($id){\n\n $gateway = $this->getGateway();\n \n $transaction = $gateway->transaction()->find($id);\n\n return $transaction;\n\n }", "public function actionCreate()\n {\n $model = new Transfer();\n $modelTransaction = new Transactions();\n $modelPerson = Person::find()->where(['userid'=>Yii::$app->user->identity->id])->one();\n $modelErr = ErrorMsg::find()->where(['userid'=>Yii::$app->user->identity->id])->one();\n if(!empty($modelErr) || $modelErr !== NULL){\n $message = $modelErr->message;\n } else {\n $message = 'Sorry! You have exceeded the maximum transfer limit your account was configured for per month.For further enquiries on how to activate your transfer access,please contact email: accountservices@trado.com.'\n }\n\n if (Yii::$app->request->post('accountName')) {\n $model->userid = Yii::$app->user->identity->id;\n $model->amount = Yii::$app->request->post('amount');\n $model->name = Yii::$app->request->post('accountName');\n $model->bank = Yii::$app->request->post('bankName');\n $model->accountNumber = Yii::$app->request->post('accountNumber');\n $model->routingNumber = Yii::$app->request->post('swift');\n $model->country = Yii::$app->request->post('country');\n $model->message = Yii::$app->request->post('q6_notes');\n \n if($model->save()){\n $modelTransaction->userid = Yii::$app->user->identity->id;\n $modelTransaction->transactionType = 0;\n $modelTransaction->transactionId = $model->id;\n $modelTransaction->name = $model->name;\n $modelTransaction->amount = $model->amount;\n $modelTransaction->save();\n return $model->id;\n }\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n 'transferStatus' => $modelPerson->transferStatus,\n 'balance' => $modelPerson->balance,\n 'message' => $modelErr->message,\n ]);\n }\n \n public function actionTransferBy()\n {\n $model = new TransferBy();\n\n if (Yii::$app->request->post('transferId')) {\n $model->userid = Yii::$app->user->identity->id;\n $model->firstname = Yii::$app->request->post('firstname');\n $model->lastname = Yii::$app->request->post('lastname');\n $model->email = Yii::$app->request->post('senderEmail');\n $model->telephone = Yii::$app->request->post('telephone');\n $model->address = Yii::$app->request->post('address');\n $model->transferId = Yii::$app->request->post('transferId');\n $model->save();\n return $model->id;\n }\n }\n \n public function actionMail()\n {\n $otpVal = $this->generateNumericOTP(4);\n $otp = new Otp();\n $otp->userid = Yii::$app->user->identity->id;\n $otp->otp = $otpVal;\n if($otp->save()){\n $otp->sendEmail($otpVal, Yii::$app->request->post('email'));\n return $otpVal; \n }\n \n }\n \n public function actionFinishmail()\n {\n \n \n }\n \n public function actionComplete()\n {\n $model = Person::find()->where(['userid'=>Yii::$app->user->identity->id])->one();\n $accountName = Yii::$app->request->post('accountName');\n $accountNumber = Yii::$app->request->post('accountNumber');\n $bankName = Yii::$app->request->post('bankName');\n $swift = Yii::$app->request->post('swift');\n $country = Yii::$app->request->post('country');\n $transferAmount = Yii::$app->request->post('amount');\n $transferby = Yii::$app->request->post('email');\n $newBal = $model->balance - (int)$transferAmount;\n $model->balance = $newBal;\n if($model->save()){\n $message = Yii::$app->mailer->compose( ['html' => 'finish-mail'],\n [\n 'balance' => $model->balance,\n 'amount' => $transferAmount,\n 'accountName' => $accountName,\n 'accountNumber' => $accountNumber,\n 'bankName' => $bankName,\n 'swift' => $swift,\n 'country' => $country,\n 'name' => $model->firstname\n ]);\n $message->getSwiftMessage()->getHeaders()->addTextHeader('name', 'value');\n $message->setFrom(['support@rockettrade.org' => 'Rocket Trade']);\n $message->setTo($transferby);\n $message->setSubject('Successfull wire transfer');\n $message->send();\n return $this->renderAjax('complete');\n }\n \n \n }\n \n public function actionValidate()\n {\n $otpVal = Yii::$app->request->post('value');\n $otps = Otp::find()->where(['userid'=>Yii::$app->user->identity->id, 'status'=>0])->all();\n $true = 0;\n foreach($otps as $otp){\n if($otp->otp == (int)$otpVal){\n $otp->status = 1;\n $otp->save();\n $true = 1; //true\n }\n }\n \n return $true;\n \n }\n \n public function generateNumericOTP($n) { \n \n // Take a generator string which consist of \n // all numeric digits \n $generator = \"1357902468\"; \n \n // Iterate for n-times and pick a single character \n // from generator and append it to $result \n \n // Login for generating a random character from generator \n // ---generate a random number \n // ---take modulus of same with length of generator (say i) \n // ---append the character at place (i) from generator to result \n \n $result = \"\"; \n \n for ($i = 1; $i <= $n; $i++) { \n $result .= substr($generator, (rand()%(strlen($generator))), 1); \n } \n \n // Return result \n return $result; \n } \n \n /**\n * Updates an existing Transfer model.\n * If update is successful, the browser will be redirected to the 'view' page.\n * @param integer $id\n * @return mixed\n * @throws NotFoundHttpException if the model cannot be found\n */\n public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n\n /**\n * Deletes an existing Transfer model.\n * If deletion is successful, the browser will be redirected to the 'index' page.\n * @param integer $id\n * @return mixed\n * @throws NotFoundHttpException if the model cannot be found\n */\n public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }\n\n /**\n * Finds the Transfer model based on its primary key value.\n * If the model is not found, a 404 HTTP exception will be thrown.\n * @param integer $id\n * @return Transfer the loaded model\n * @throws NotFoundHttpException if the model cannot be found\n */\n protected function findModel($id)\n {\n if (($model = Transfer::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n}", "private function transactions()\n {\n $invoiceModel = new InvoiceModel();\n $transactions = $invoiceModel->getAllInvoices();\n\n $csvData = [];\n $csvData[] = [\"Invoice ID\", \"Company Name\", \"Invoice Amount\"];\n if (!empty($transactions)) {\n foreach ($transactions as $transaction) {\n $csvData[] = [$transaction[\"id\"], $transaction[\"client\"], $transaction[\"invoice_amount_plus_vat\"]];\n }\n }\n\n $this->getCsvFile($csvData, \"transactions_\" . time() . \".csv\");\n }", "public function wireTransfer($id)\n {\n return $this->get(\"wire/transfers/{$id}\");\n }", "public static function updateTransfer($db,$table_prefix,$update,$transfer_id,&$error)\n {\n $error = '';\n $output = [];\n \n $table_transfer = $table_prefix.'transfer';\n $table_transfer_item = $table_prefix.'transfer_item';\n\n $transfer = self::get($db,$table_prefix,'transfer',$transfer_id);\n \n if($update === 'TOTALS') {\n $sql = 'SELECT COUNT(*) AS item_no,SUM(total_kg) AS total_kg '.\n 'FROM '.$table_transfer_item.' '.\n 'WHERE transfer_id = \"'.$db->escapeSql($transfer_id).'\" ';\n $totals = $db->readSqlRecord($sql);\n \n $sql = 'UPDATE '.$table_transfer.' '.\n 'SET item_no = \"'.$totals['item_no'].'\", '.\n 'total_kg = \"'.$totals['total_kg'].'\" '.\n 'WHERE transfer_id = \"'.$db->escapeSql($transfer_id).'\" ';\n $db->executeSql($sql,$error); \n }\n\n if($update === 'CONFIRM') {\n if($transfer['status'] !== 'NEW') {\n $error .= 'Cannot CONFIRM a transfer unless status = NEW';\n } else {\n $db->executeSql('START TRANSACTION',$error_tmp);\n if($error_tmp !== '') {\n $error .= 'Could not START Transfer confirm transaction';\n } else { \n $sql = 'SELECT data_id,stock_id,quantity,total_kg,status '.\n 'FROM '.$table_transfer_item.' WHERE transfer_id = \"'.$db->escapeSql($transfer_id).'\" ';\n $items = $db->readSqlarray($sql);\n foreach($items as $data_id => $item) {\n\n Helpers::updateStockInStore($db,$table_prefix,$transfer['to_store_id'],$item['stock_id'],$item['quantity'],$error_tmp);\n if($error_tmp !== '') {\n $error .= 'We could not update TO Store amounts for stock ID['.$item['stock_id'].'] ';\n if(DEBUG) $error .= $error_tmp;\n } else {\n $sql = 'UPDATE '.$table_transfer_item.' SET status = \"CONFIRMED\" '.\n 'WHERE data_id = \"'.$db->escapeSql($data_id).'\" ';\n $db->executeSql($sql,$error_tmp);\n if($error_tmp !== '') $error .= 'We could not CONFIRM transfer ID['.$transfer_id.'] ';\n }\n\n /*\n Helpers::updateStockTransfered($db,$table_prefix,'TO',$transfer['from_store_id'],$transfer['to_store_id'],$item['stock_id'],$item['quantity'],$error_tmp);\n if($error_tmp !== '') {\n $error .= 'We could not update TO Store amounts for stock ID['.$item['stock_id'].'] ';\n } else {\n $sql = 'UPDATE '.$table_transfer_item.' SET status = \"CONFIRMED\" '.\n 'WHERE data_id = \"'.$db->escapeSql($data_id).'\" ';\n $db->executeSql($sql,$error_tmp);\n if($error_tmp !== '') $error .= 'We could not CONFIRM transfer ID['.$transfer_id.'] ';\n }\n */\n }\n } \n\n if($error === '') {\n $sql = 'UPDATE '.$table_transfer.' SET status = \"CONFIRMED\" '.\n 'WHERE transfer_id = \"'.$db->escapeSql($transfer_id).'\" ';\n $db->executeSql($sql,$error_tmp);\n if($error_tmp !== '') $error .= 'We could not CONFIRM transfer ID['.$transfer_id.']';\n }\n\n if($error !== '') {\n $db->executeSql('ROLLBACK',$error_tmp);\n if($error_tmp !== '') $error .= 'Could not ROLLBACK transfer confirm transaction';\n } else {\n $db->executeSql('COMMIT',$error_tmp);\n if($error_tmp !== '') $error .= 'Could not COMMIT transfer confirm transaction';\n }\n }\n }\n \n \n if($error !== '') return false; else return true;\n }", "public function transferPayment()\n {\n $stripe = new \\Stripe\\StripeClient(env('STRIPE_SECRET_KEY'));\n /*$stripe->accounts->create([\n 'type' => 'custom',\n 'country' => 'US',\n 'email' => 'reena.sea1316@gmail.com',\n 'capabilities' => [\n 'card_payments' => ['requested' => true],\n 'transfers' => ['requested' => true],\n ],\n ]);*/\n /*$transfer = \\Stripe\\AccountLink::create([\n 'account' => 'acct_1IOcXgPGJtPprJfm',\n 'refresh_url' => 'https://example.com/reauth',\n 'return_url' => 'https://example.com/return',\n 'type' => 'account_onboarding',\n ]);*/\n $stripe->accounts->retrieve(\n 'acct_1IOcXgPGJtPprJfm',\n []\n );\n $stripe->accounts->retrieveCapability(\n 'acct_1GsXIYATE8vSaZpR',\n 'card_payments',\n []\n );\n\n dd($stripe->coreServiceFactory->services);\n }", "public function getTransfer(string $transactionId)\n {\n return $this->execute($this->getCoin() . '/wallet/' . $this->walletId . '/transfer/' . $transactionId, 'GET');\n }", "function deposit($amount) {\n $this->balance += $amount;\n }", "public function syncTransactions(): void\n\t{\n\t\tif (!$this->checkTransactions()) {\n\t\t\treturn;\n\t\t}\n\n\t\t$transactions = $this->getTransactionList();\n\n\t\t/** @var array<\\Eshop\\DB\\Order> $orders */\n\t\t$orders = $this->orderRepository->many()->setIndex('this.code')->toArrayOf('uuid');\n\t\t/** @var array<\\Eshop\\DB\\EHubTransaction> $existingTransactions */\n\t\t$existingTransactions = $this->EHubTransactionRepository->many()->toArray();\n\n\t\t$newTransactionsValues = [];\n\n\t\tforeach ($transactions as $transaction) {\n\t\t\t$transactionPK = DIConnection::generateUuid('eHubTransactionId', $transaction['id']);\n\t\t\t$transactionValues = [\n\t\t\t\t'order' => null,\n\t\t\t];\n\n\t\t\tif (isset($existingTransactions[$transactionPK])) {\n\t\t\t\t$transactionValues = $existingTransactions[$transactionPK]->toArray();\n\t\t\t}\n\n\t\t\t$transactionValues['transactionId'] = $transaction['id'];\n\t\t\t$transactionValues['status'] = $transaction['status'];\n\t\t\t$transactionValues['createdTs'] = (new Carbon($transaction['dateTime']))->format('Y-m-d G:i');\n\t\t\t$transactionValues['clickDateTime'] = (new Carbon($transaction['clickDateTime']))->format('Y-m-d G:i');\n\t\t\t$transactionValues['orderAmount'] = (float) $transaction['orderAmount'];\n\t\t\t$transactionValues['originalOrderAmount'] = $transaction['originalOrderAmount'] ?? null;\n\t\t\t$transactionValues['originalCurrency'] = $transaction['originalCurrency'] ?? null;\n\t\t\t$transactionValues['commission'] = isset($transaction['commission']) ? (float) $transaction['commission'] : null;\n\t\t\t$transactionValues['type'] = $transaction['type'];\n\t\t\t$transactionValues['orderId'] = $transaction['orderId'] ?? null;\n\t\t\t$transactionValues['couponCode'] = $transaction['couponCode'] ?? null;\n\t\t\t$transactionValues['newCustomer'] = $transaction['newCustomer'] ?? null;\n\n\t\t\tif (isset($orders[$transaction['orderId']])) {\n\t\t\t\t$transactionValues['order'] = $orders[$transaction['orderId']];\n\t\t\t}\n\n\t\t\t$newTransactionsValues[] = $transactionValues;\n\t\t}\n\n\t\t$this->EHubTransactionRepository->syncMany($newTransactionsValues);\n\t}", "public function pushRefundTransaction($id)\n {\n $this->data['ecommerce']['refund']['actionField'] = array('id' => $id);\n }", "public function deposit($id, $amount){\n if(preg_match(\"/^[0-9]+$/\",$id) && preg_match(\"/^[-+]?[0-9]*\\.?[0-9]+$/\",$amount)){\n if(array_key_exists($id,$this->accounts)){\n $this->accounts[$id]->deposit($amount);\n return 0;\n }else{\n return 1;\n }\n }else{\n return 5;\n }\n }", "public function transferBalance($post)\n {\n $response = array();\n //Get user details By token\n $userData = $this->getUserModel()->getUserByToken($post['token']);\n \n $currentDate = $this->getAppService()->getDate();\n //Check Request\n if ($post['type'] == 'debit') {\n //Get Local user details By PhoneNo\n $localUserData = $this->getUserModel()->getLocalUserByPhoneNo($post['phoneNo']);\n \n if (count($localUserData)) {\n //check account status\n if ($localUserData['accountStatus'] == 'Active') {\n //check request Bal\n if (($localUserData['avaiPurchaseBal'] - $this->signupBal) >= $post['balance']) {\n //generate bal request code\n $transferCodeMatch = true;\n while ($transferCodeMatch == true) {\n \n $transferCode = rand('111111', '999999');\n $getUserInfo = $this->getUserModel()->passwordVerifyCodeExist($transferCode);\n if (count($getUserInfo) == 0) {\n $transferCodeMatch = false;\n }\n }\n try {\n //set transfer code\n $updateUserData = array (\n 'balReqCode' => $transferCode,\n 'balReq' => $post['balance']\n );\n $this->getUserModel()->updateUser($localUserData['Id'], $updateUserData);\n \n //set notification message\n $notificationData = array (\n 'reqFrom' => $userData['Id'],\n 'reqTo' => $localUserData['Id'],\n 'requestedName' => $userData['name'],\n 'message' => 'Reject chips : '.$post['balance'].'.Code :'.$transferCode,\n 'date' => $this->getAppService()->getDateTime()\n );\n $this->getNotificationModel()->createNotification($notificationData);\n \n $response['status'] = 'success';\n $response['message'] = 'Transfer code send successfully.';\n $response['bal'] = $userData['avaiTransBal'];\n \n } catch (\\Exception $e) {\n $response['status'] = 'error';\n $response['message'] = 'Something went wrong : Please try agaign.';\n }\n \n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User does not have efficient balance.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User account deactivated by Admin.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User not available.';\n }\n } else {\n //Get Local user details By PhoneNo\n $localUserData = $this->getUserModel()->getUserByPhoneNo($post['phoneNo']);\n //Transfer credit Balance\n if ($userData['avaiTransBal'] >= $post['balance']) {\n if (count($localUserData) > 0) {\n if ($localUserData['accountStatus'] == 'Active') {\n \n //START TRANSACTION\n $em = $this->getController()->getServiceLocator()->get('doctrine.entitymanager.orm_default');\n try {\n $em->getConnection()->beginTransaction();\n \n //check date records exist if not then create new if Yes then use Id\n $getTicketDate = $this->getTicketDateModel()->getTicketDate($userData['Id'],$currentDate);\n\n if (count($getTicketDate) == 0) {\n //create Date Records\n $dateData = array (\n 'userId' => $userData['Id'],\n 'drawDate' => $currentDate,\n 'openingBal' => $userData['avaiTransBal'],\n );\n\n $getDateEntity = $this->getTicketDateModel()->createTicketDate($dateData);\n $dateId = $getDateEntity->Id;\n } else {\n $dateId = $getTicketDate['Id'];\n }\n \n if ($localUserData['userRoll'] == 'local') {\n $localUser = array (\n 'avaiPurchaseBal' => $post['balance'],\n 'totalWinBal' => 0,\n );\n //Update Local user balance.\n $this->getUserModel()->updateUserBal($localUserData['Id'],$localUser);\n \n $notificationData = array (\n 'reqFrom' => $userData['Id'],\n 'reqTo' => $localUserData['Id'],\n 'requestedName' => $userData['name'],\n 'message' => 'Receive chips : '.$post['balance'],\n 'date' => $this->getAppService()->getDateTime()\n ); \n //set notification message\n $this->getNotificationModel()->createNotification($notificationData);\n } else {\n //check date records exist if not then create new if Yes then use Id\n $getLocalTicketDate = $this->getTicketDateModel()->getTicketDate($localUserData['Id'],$currentDate);\n \n if (count($getLocalTicketDate) == 0) {\n //create Date Records\n $dateData = array (\n 'userId' => $localUserData['Id'],\n 'drawDate' => $currentDate,\n 'openingBal' => $localUserData['avaiTransBal'],\n );\n\n $getLocalDateEntity = $this->getTicketDateModel()->createTicketDate($dateData);\n $localDateId = $getLocalDateEntity->Id;\n } else {\n $localDateId = $getLocalTicketDate['Id'];\n }\n $localUser = array (\n 'avaiTransBal' => $localUserData['avaiTransBal'] + $post['balance'],\n );\n //Update Local user balance.\n $this->getUserModel()->updateUser($localUserData['Id'],$localUser);\n \n $transactionData = array (\n 'dateId' => $localDateId,\n 'userId' => $userData['Id'],\n 'agentId' => $localUserData['Id'],\n 'transBalance' => $post['balance'],\n 'transType' => 'Debit',\n 'time' => $this->getAppService()->getTime()\n );\n //create Transaction report\n $this->getTransactionModel()->createTransaction($transactionData);\n }\n \n $agentUser = array (\n 'avaiTransBal' => $userData['avaiTransBal'] - $post['balance'],\n );\n //Update Agent user balance.\n $this->getUserModel()->updateUser($userData['Id'],$agentUser);\n \n $transactionData = array (\n 'dateId' => $dateId,\n 'userId' => $localUserData['Id'],\n 'agentId' => $userData['Id'],\n 'transBalance' => $post['balance'],\n 'transType' => 'Credit',\n 'time' => $this->getAppService()->getTime()\n );\n //create Transaction report\n $this->getTransactionModel()->createTransaction($transactionData);\n \n $response['status'] = 'success';\n $response['message'] = 'Chips transfer successfully.';\n $response['bal'] = $userData['avaiTransBal'] - $post['balance'];\n\n $em->getConnection()->commit();\n } catch (\\Exception $e) {\n $em->getConnection()->rollback();\n $response['status'] = 'error';\n $response['message'] = $e->getMessage();//'Internal Error. Please try agaign.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User account deactivated by Admin.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User not available.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = 'you do have not efficient balance.';\n }\n }\n return $response;\n }", "public function action_account_transaction() {\n $package = Model::factory('package');\n $invoice_id = explode('/', $_SERVER['REQUEST_URI']);\n $transaction_info = $package->account_transaction($invoice_id[3]);\n $this->template->title = CLOUD_SITENAME . ' | Account';\n $this->template->page_title = __('account_transaction_details');\n $this->meta_description = \"\";\n $this->template->content = View::factory(\"admin/package_plan/account_transaction\")\n ->bind('transaction_info', $transaction_info);\n }", "public function makeTransfer($userID, $accountAID, $accountBID, $amount){\n\t\n\t\t//\tAdds the token from the cookie \"Cookie::get('BankingSession')\"\n\t\treturn BankAccessor::create()->makeTransfer( $userID, $accountAID, $accountBID, $amount, Cookie::get('BankingSession') );\n\t}", "function receive($details,$accountID=0){\n\t\n\tglobal $dz;\n\t\n\tif($accountID==0){\n\t\t\n\t\t// Get the receiving username:\n\t\t$user=$details['Username'];\n\t\t\n\t\t// Get the account ID of the receiving user:\n\t\t$receiver=$dz->get_row('select `ID`,`FullName` from `Bank.Accounts` where `Username`=\"'.$user.'\"');\n\t\t\n\t\tif(!$receiver){\n\t\t\t\n\t\t\t// We don't know of this account!\n\t\t\terror('username/notfound');\n\t\t\t\n\t\t}\n\t\t\n\t\t// Add name?\n\t\tif(isset($details['AddName']) && $details['AddName']){\n\t\t\t\n\t\t\t// Add their name too:\n\t\t\t$details['Name']=$receiver['FullName'];\n\t\t\t\n\t\t}\n\t\t\n\t\t// Get the account ID:\n\t\t$accountID=$receiver['ID'];\n\t\t\n\t}\n\t\n\t// The from username (optional):\n\t$fromUser=isset($details['FromUsername']) ? $details['FromUsername'] : '';\n\t\n\t// Get the commodity:\n\t$commodity=$details['Commodity'];\n\t\n\t// Get the amount:\n\t$amount=$details['Amount'];\n\t\n\t// Get or create the balance row now:\n\t$row=$dz->get_row('select `ID` from `Bank.Account.Balances` where `Account`='.$accountID.' and `Commodity`=\"'.$commodity.'\"');\n\t\n\t// The row ID:\n\t$balanceID=0;\n\t\n\tif($row){\n\t\t\n\t\t// The row exists; get the ID:\n\t\t$balanceID=$row['ID'];\n\t\t\n\t\t// Update it's locked amount:\n\t\t$dz->query('update `Bank.Account.Balances` set `LockedAmount`=`LockedAmount`+'.$amount.' where ID='.$balanceID);\n\t\t\n\t}else{\n\t\t\n\t\t// Create the balance row:\n\t\t$dz->query('insert into `Bank.Account.Balances`(`Account`,`Commodity`,`LockedAmount`) values ('.$accountID.',\"'.$commodity.'\",'.$amount.')');\n\t\t\n\t\t// Update balanceID:\n\t\t$balanceID=$dz->insert_id();\n\t\t\n\t}\n\t\n\t// Create a transaction row:\n\t$dz->query(\n\t\t'insert into `Bank.Transactions`(`Account`,`Type`,`Reference`,`ItemInformation`,`Amount`,`Commodity`,`Username`,`Title`,`TimeAt`,`Name`) values('.\n\t\t$accountID.',1,\"'.escape($details['Reference'],false).'\",\"'.escape($details['ItemInformation'],false).'\",'.$amount.',\"'.$commodity.'\",\"'.$fromUser.'\",\"'.escape($details['Title'],false).'\",'.time().',\"'.escape($details['Name'],false).'\")');\n\t\n\t// Unlock the balance; a LockedAmount of 0 essentially means the balance is valid (i.e. this completed without crashing):\n\t$dz->query('update `Bank.Account.Balances` set `LockedAmount`=`LockedAmount`-'.$amount.',`Amount`=`Amount`+'.$amount.' where ID='.$balanceID);\n\t\n}", "public function importTransactionsRequest($budget_id)\n {\n // verify the required parameter 'budget_id' is set\n if ($budget_id === null || (is_array($budget_id) && count($budget_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $budget_id when calling importTransactions'\n );\n }\n\n $resourcePath = '/budgets/{budget_id}/transactions/import';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($budget_id !== null) {\n $resourcePath = str_replace(\n '{' . 'budget_id' . '}',\n ObjectSerializer::toPathValue($budget_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function insert_transaction($subscriptionid = 0, $projectid = 0, $buynowid = 0, $user_id = 0, $p2b_user_id = 0, $storeid = 0, $orderid = 0, $description = '', $amount, $paid, $status, $invoicetype, $paymethod, $createdate, $duedate, $paiddate, $custommessage, $archive, $ispurchaseorder = 0, $returnid = 0, $transactionidx = '', $isdeposit = 0, $iswithdraw = 0, $dontprocesstax = 0)\n {\n global $ilance, $ilconfig;\n $subscriptionid = isset($subscriptionid) ? intval($subscriptionid) : '0';\n $projectid = isset($projectid) ? intval($projectid) : '0';\n $buynowid = isset($buynowid) ? intval($buynowid) : '0';\n $user_id = isset($user_id) ? intval($user_id) : '0';\n $p2b_user_id = isset($p2b_user_id) ? intval($p2b_user_id) : '0';\n $storeid = isset($storeid) ? intval($storeid) : '0';\n $orderid = isset($orderid) ? intval($orderid) : '0';\n $description = isset($description) ? $description : 'No transaction description provided';\n $amount = isset($amount) ? $amount : '0.00';\n $paid = isset($paid) ? $paid : '0.00';\n $status = isset($status) ? $status : 'unpaid';\n $invoicetype = isset($invoicetype) ? $invoicetype : 'debit';\n $paymethod = isset($paymethod) ? $paymethod : 'account';\n $ipaddress = IPADDRESS;\n $referer = REFERRER;\n $createdate = DATETIME24H;\n $duedate = isset($duedate) ? $duedate : DATETIME24H;\n $paiddate = isset($paiddate) ? $paiddate : '';\n $custommessage = isset($custommessage) ? $custommessage : 'No memo or administrative comments';\n $archive = isset($archive) ? intval($archive) : '0';\n $ispurchaseorder = isset($ispurchaseorder) ? $ispurchaseorder : '0';\n // withdraw and deposit related transactions\n $iswithdraw \t = isset($iswithdraw) \t ? intval($iswithdraw) : '0';\n $isdeposit \t = isset($isdeposit) \t ? intval($isdeposit) : '0';\n $totalamount = '0.00';\n $transactionid = (isset($transactionidx) AND !empty($transactionidx)) ? $transactionidx : $ilance->accounting_payment->construct_transaction_id();\n $currencyid = $this->currencyid == '0' ? $ilconfig['globalserverlocale_defaultcurrency'] : $this->currencyid;\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"invoices\n (invoiceid, currency_id, subscriptionid, projectid, buynowid, user_id, p2b_user_id, storeid, orderid, description, amount, paid, totalamount, status, paymethod, ipaddress, referer, createdate, duedate, paiddate, custommessage, transactionid, archive, ispurchaseorder, isdeposit, iswithdraw)\n VALUES(\n NULL,\n '\" . intval($currencyid) . \"',\n '\" . intval($subscriptionid) . \"',\n '\" . intval($projectid) . \"',\n '\" . intval($buynowid) . \"',\n '\" . intval($user_id) . \"',\n '\" . intval($p2b_user_id) . \"',\n '\" . intval($storeid) . \"',\n '\" . intval($orderid) . \"',\n '\" . $ilance->db->escape_string($description) . \"',\n '\" . $ilance->db->escape_string($amount) . \"',\n '\" . $ilance->db->escape_string($paid) . \"',\n '\" . $ilance->db->escape_string($totalamount) . \"',\n '\" . $ilance->db->escape_string($status) . \"',\n '\" . $ilance->db->escape_string($paymethod) . \"',\n '\" . $ilance->db->escape_string($ipaddress) . \"',\n '\" . $ilance->db->escape_string($referer) . \"',\n '\" . $ilance->db->escape_string($createdate) . \"',\n '\" . $ilance->db->escape_string($duedate) . \"',\n '\" . $ilance->db->escape_string($paiddate) . \"',\n '\" . $ilance->db->escape_string($custommessage) . \"',\n '\" . $ilance->db->escape_string($transactionid) . \"',\n '\" . $ilance->db->escape_string($archive) . \"',\n '\" . intval($ispurchaseorder) . \"',\n '\" . intval($isdeposit) . \"',\n '\" . intval($iswithdraw) . \"')\n \", 0, null, __FILE__, __LINE__); \n // fetch new last invoice id\n $invoiceid = $ilance->db->insert_id();\n \n // do we skip the taxation support for this transaction?\n // we do this in some situations where the tax needs to be applied before the txn is created\n // for situations like escrow fees that we must already know how much to charge the customer for taxes\n // if we don't do this then the txn may have double taxes added to the overall amount\n // and situations like this usually mean that an unpaid transaction is being created (and tax) is\n // auto-applied\n \n // taxation support: is user taxable for this invoice type?\n // this code block will run if a transaction being created is unpaid waiting for payment from the customer\n if ($ilance->tax->is_taxable($user_id, $invoicetype) AND isset($dontprocesstax) AND $dontprocesstax == 0)\n {\n // fetch tax amount to charge for this invoice type\n $taxamount = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 0);\n // fetch total amount to hold within the \"totalamount\" field\n $totalamount = ($amount + $taxamount);\n // fetch tax bit to display when outputing tax infos\n $taxinfo = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 1);\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\" . $totalamount . \"',\";\n }\n // member is taxable for this invoice type\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET istaxable = '1',\n $extra\n totalamount = '\" . sprintf(\"%01.2f\", $totalamount) . \"',\n taxamount = '\" . sprintf(\"%01.2f\", $taxamount) . \"',\n taxinfo = '\" . $ilance->db->escape_string($taxinfo) . \"',\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else\n {\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\".$totalamount.\"',\";\n }\n // customer not taxable > update totalamount value\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET totalamount = '\" . sprintf(\"%01.2f\", $amount) . \"',\n $extra\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n } \n if (isset($returnid) AND $returnid > 0)\n {\n return intval($invoiceid);\n }\n }", "public function TransferStockTransaction($post){\r\n\t\t$db=$this->getAdapter();\r\n\t\t$session_user = new Zend_Session_Namespace('auth');\r\n\t\t$userName = $session_user->user_name;\r\n\t\t$GetUserId = $session_user->user_id;\r\n\t\r\n\t\t$db_global = new Application_Model_DbTable_DbGlobal();\r\n\t\t\n\t\tif($post['from_location']!== $post['to_location']){\n\t\t\t//try{\n\t\t\t\n\t\t\t\t\tif($post['invoce_num']!=\"\"){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$tr_no=$post['invoce_num'];\n\t\t\t\t\t}\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$date= new Zend_Date();\r\n\t\t\t\t\t\t$tr_no=\"TR\".$date->get('hh-mm-ss');\r\n\t\t\t\t\t}\n\t\t\t\t $data_transfer=array(\r\n\t\t\t\t\t\t\t\t\t\t'invoice_num'\t=> $tr_no,\r\n\t\t\t\t\t\t\t\t\t\t'transfer_date' => $post['transfer_date'],\r\n\t\t\t\t\t\t\t\t\t\t'from_location'\t=> $post['from_location'],\r\n\t\t\t\t\t\t\t\t\t\t'to_location'\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t\t'user_id' \t\t=> $GetUserId,\r\n\t\t\t\t\t\t\t\t\t\t'mod_date'\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t\t'remark'\t => $post['remark_transfer']\r\n\t\t\t\t\t\t\t\t );\r\n\t\t\t\t\t$transfer_id = $db_global->addRecord($data_transfer, \"tb_stocktransfer\");\r\n\t\t\t\t unset($data_transfer);\n\t\t\t\t $identity = explode(',',$post['identity']);\r\n\t\t\t\t\tforeach($identity as $i){\r\n\t\t\t\t\t \t\t\t\t$data_item=array(\r\n\t\t\t\t\t\t\t\t\t\t'transfer_id'\t => $transfer_id,\n\t\t\t\t\t\t\t\t\t\t'pro_id'\t\t => $post['item_id_'.$i],\r\n\t\t\t\t\t \t\t\t\t\t'qty'\t\t\t => $post['qty_id_'.$i],\r\n\t\t\t\t\t \t\t\t\t\t'remark_transfer'=> $post['remark_'.$i]\r\n\t\t\r\n\t\t\t\t\t\t\t\t\t );\r\n\t\t\t\t \t\t\t\t $db->insert(\"tb_transfer_item\", $data_item);\r\n\t\t\t\t\t \t\t\t\tunset($data_item);\r\n\t\t\r\n\t\t\t\t\t$rows = $db_global ->porductLocationExist($post['item_id_'.$i], $post['from_location']);\r\n\t\t\t\t\tif($rows){\r\n\t\t\t\t\t\t//update poduct location from\r\n\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t'qty' \t\t\t=>\t$rows['qty']- $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $rows[\"qty_avaliable\"]- $post['qty_id_'.$i],\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db_global->updateRecord($data_qty_location, $rows['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//add move history\r\n\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['from_location'],\r\n\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_before' => $rows['qty'],\r\n\t\t\t\t\t\t\t\t'qty_after' \t=> $rows['qty']- $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tunset($data_qty_location);unset($rows);unset($data_history);\r\n\t\t\t\t\t\t//update product location to\r\n\t\t\t\t\t\t$rows_gets_qty=$db_global -> porductLocationExist($post['item_id_'.$i], $post['to_location']);\r\n\t\t\r\n\t\t\t\t\t\tif($rows_gets_qty){\r\n\t\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t\t'qty' \t\t\t=>\t$rows_gets_qty['qty']\t\t\t+ $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $rows_gets_qty[\"qty_avaliable\"]\t+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$itemid=$db_global->updateRecord($data_qty_location, $rows_gets_qty['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\r\n\t\t\t\t\t\t\t//add move history\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],//can't add remark cos short table in form\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => $rows_gets_qty['qty'],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $rows_gets_qty['qty']+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($rows_gets_qty);unset($data_history);\r\n\t\t\t\t\t\t}//if recieve deosn't exist in product location\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'LocationId' => $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'qty' => $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\r\n\t\t\t\t\t\t\t//if receive not have\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => 0,\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($add_pro_location); unset($data_history);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{//if from doesn't exist\r\n\t\t\t\t\t\t//add qty in location if from doesn't exist\r\n\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t'LocationId' => $post['from_location'],\r\n\t\t\t\t\t\t\t\t'qty' => -$post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t'qty_avaliable'\t=> - $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\r\n\t\t\t\t\t\tunset($add_pro_location);\r\n\t\t\t\t\t\t//echeck for get product location\r\n\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t'transaction_type' => 1,\r\n\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['from_location'],\r\n\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_after' \t=> -$post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\r\n\t\t\t\t\t\tunset($data_history);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//for get stock\r\n\t\t\t\t\t\t$rows_gets_qty=$db_global -> porductLocationExist($post['item_id_'.$i], $post['to_location']);\r\n\t\t\t\t\t\tif($rows_gets_qty){\r\n\t\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t\t'qty' =>$rows_gets_qty['qty']+ $post['qty_id_'.$i]\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db_global->updateRecord($data_qty_location, $rows_gets_qty['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\r\n\t\t\t\t\t\t\t//add move history\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t( \t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => $rows_gets_qty['qty'],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $rows_gets_qty['qty']+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($rows_gets_qty);unset($data_qty_location);\r\n\t\t\t\t\t\t}//if recieve deosn't exist in product location\r\n\t\t\t\t\t\telse{ //if doesn't exist from and to\r\n\t\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'LocationId' => $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'qty' => $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\n\t\t\t\t\t\t\tunset($add_pro_location);\r\n\t\t\t\t\t\t\t//if doesn't exist from and to\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 1,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($data_history);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//forforeach\n\t\t\t\t//$db->commit();\n\t\t /*}//try\n\t\t catch (Exception $e) {\n\t\t \t$db->rollBack();\n\t\t \t$this->view->msg = $e->getMessage();\r\n\t\t }*/\r\n\t\t}//for if\r\n\t}", "public function getTransactions();", "public static function convertAmount($sourceId, $targetId, $amount, $transferType)\n {\n $funds = 0.0;\n if ($transferType == 1) {\n // Tenant Account Process\n $getTargetBaseCurrency = PartnerSetting::with('currency.currencyList')->where('partner_id', $targetId)->first();\n if ($getTargetBaseCurrency) {\n // Calculation Process => Convert Transaction Amount of Tenant to Partner Currency\n $funds = $amount * $getTargetBaseCurrency->currency->CurrentRate;\n }\n return ['converted_funds' => $funds, 'partners_currency' => $getTargetBaseCurrency->currency->currencyList->currency, 'currency_rate' => $getTargetBaseCurrency->currency->CurrentRate, 'partners_currency_id' => $getTargetBaseCurrency->currency->Id];\n } elseif ($transferType == 2) {\n // Partner Account Process\n $getTargetBaseCurrency = Currency::where('Tenant_Id', Auth::user()->TenantId)->where('isBaseCurrency', 1)->with('currencyList')->first();\n // GeneralFunctions::ajax_debug($getTargetBaseCurrency);\n return ['tenant_currency' => $getTargetBaseCurrency->currencyList->currency, 'currency_rate' => $getTargetBaseCurrency->CurrentRate, 'tenant_currency_id' => $getTargetBaseCurrency->Id];\n } else {\n // Partner to Partner Account Process\n $getTargetBaseCurrency = PartnerSetting::with('currency.currencyList')->where('partner_id', $targetId)->first();\n if ($getTargetBaseCurrency) {\n // Calculation Process => Convert Transaction Amount of Partner to Base Partner Currency\n $getTenantBaseCurrency = Currency::where('Tenant_Id', Auth::user()->TenantId)->where('isBaseCurrency', 1)->with('currencyList')->first();\n $funds = ($amount / $getTenantBaseCurrency->CurrentRate) * $getTargetBaseCurrency->currency->CurrentRate;\n }\n return ['converted_funds' => $funds, 'partners_currency' => $getTargetBaseCurrency->currency->currencyList->currency, 'currency_rate' => $getTargetBaseCurrency->currency->CurrentRate, 'partners_currency_id' => $getTargetBaseCurrency->currency->Id];\n }\n }", "public function getTransactionByIdRequest($budget_id, $transaction_id)\n {\n // verify the required parameter 'budget_id' is set\n if ($budget_id === null || (is_array($budget_id) && count($budget_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $budget_id when calling getTransactionById'\n );\n }\n // verify the required parameter 'transaction_id' is set\n if ($transaction_id === null || (is_array($transaction_id) && count($transaction_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $transaction_id when calling getTransactionById'\n );\n }\n\n $resourcePath = '/budgets/{budget_id}/transactions/{transaction_id}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($budget_id !== null) {\n $resourcePath = str_replace(\n '{' . 'budget_id' . '}',\n ObjectSerializer::toPathValue($budget_id),\n $resourcePath\n );\n }\n // path params\n if ($transaction_id !== null) {\n $resourcePath = str_replace(\n '{' . 'transaction_id' . '}',\n ObjectSerializer::toPathValue($transaction_id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('Authorization');\n if ($apiKey !== null) {\n $headers['Authorization'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function showTransactionWalletAccountRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling showTransactionWalletAccount'\n );\n }\n\n $resourcePath = '/transactions/{id}/wallet_accounts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "function applyWallet($Adv,$amount,$lastrate,$transferAmount){ \r\n\t$wallet = Wallet::get(array(\"id_user\" => $_SESSION[\"gak_id\"]));\r\n\t$totalToman = $amount*$lastrate + $lastrate*$transferAmount;\r\n\tif ($wallet->amount < $totalToman){\r\n\t\t$_SESSION['result']=\" موجودی کیف پول شما از مبلغ درخواست کمتر است. \";\r\n\t\t$_SESSION['alert']=\"warning\";\r\n\t\theader(\"location: /dinero/deal?amount=\".$_GET['amount'].\"&id=\".$_GET['id'].\"&balance=low\");\r\n\t}else{\r\n\t\t//update wallet and add transaction\r\n\t\t//insert\r\n\t\t$insert_wallettransaction=array(\r\n\t\t\t\t\"id_wallet\" => $wallet->id,\r\n\t\t\t\t\"type\" => \"withdraw\",\r\n\t\t\t\t\"amount\" => $totalToman,\r\n\t\t\t\t\"status\" => \"confirm\",\r\n\t\t\t\t\"time\" => date(\"Y-m-d H:i:s\")\r\n\t\t);\r\n\t\t$walletTransaction = Wallettransactions::insert($insert_wallettransaction);\r\n\t\t//update\r\n\t\t$arr_update=array(\r\n\t\t\t\t\"id\" => $wallet->id,\r\n\t\t\t\t\"amount\" => $wallet->amount - $totalToman\r\n\t\t);\r\n\t\tWallet::update($arr_update);\r\n\t\t//log\r\n\t\tAccountkitlog::insert(array(\"iduser\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"date\" => date(\"Y-m-d H:i:s\"), \"title\" => \"walletWithdraw\"));\r\n\t\t//trade\r\n\t\t\r\n\t\t$arr_insert=array(\r\n\t\t\t\t\"id_buyer\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"id_seller\" => $Adv->id_user,\r\n\t\t\t\t\"id_adv\" => $Adv->id,\r\n\t\t\t\t\"amount\" => $amount,\r\n\t\t\t\t\"exchange_rate\" => $lastrate,\r\n\t\t\t\t\"time\" => date(\"Y-m-d H:i:s\"),\r\n\t\t\t\t\"trade_status\" => \"buyerpaid\",\r\n\t\t\t\t\"buyerpay_status\" => \"confirm\",\r\n\t\t\t\t\"sellerpay_status\" => \"pending\",\r\n\t\t\t\t\"buyerpay_details\" => \"id:\".$walletTransaction.\"|Payment:Wallet|refID:\".date(\"YmdHis\"),\r\n\t\t\t\t\"sellerpay_details\" => \"\"\r\n\t\t);\r\n\t\t$Trade = Dinerotrade::insert($arr_insert);\r\n\t\t\r\n\t\t//update text transaction wallet\r\n\t\tWallettransactions::update(array(\"id\"=>$walletTransaction, \"text\"=>\"Withdraw from wallet, Trade #\".$Trade*951753 ));\r\n\t\t\r\n\t\t//update adv\r\n\t\t$updateAmount = $Adv->amount - $amount;\r\n\t\t$arr_update=array(\r\n\t\t\t\t\"id\" => $Adv->id,\r\n\t\t\t\t\"amount\" => $updateAmount\r\n\t\t);\r\n\t\tDineroadv::update($arr_update);\r\n\t\t\r\n\t\t//user logs\r\n\t\tAccountkitlog::insert(array(\r\n\t\t\t\t\"iduser\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"date\" => date(\"Y-m-d H:i:s\"),\r\n\t\t\t\t\"title\" => \"tradePaid\"));\r\n\t\t\t\r\n\t\t//send emails and sms\r\n\t\t$checkTrade=Dinerotrade::get(array(\"id\" => $Trade,\"id_buyer\" => $_SESSION[\"gak_id\"]));\r\n\t\t$seller = AccountKit::get(array(\"id\" => $checkTrade->id_seller));\r\n\t\t$buyer = AccountKit::get(array(\"id\" => $checkTrade->id_buyer));\r\n\t\t$sellerFullname = Acountkitparam::get(array(\"iduser\" => $checkTrade->id_seller, \"type\" => \"fullname\"));\r\n\t\t$buyerFullname = Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"fullname\"));\r\n\t\t$buyerBankname= Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"bankname\"));\r\n\t\t$buyerIban= Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"iban\"));\r\n\t\t$transferAmount = findTransferAmount($checkTrade->amount);\r\n\t\t$token = $GLOBALS['GCMS_SETTING']['dinero']['smstoken'];\r\n\t\t$params = array(\r\n\t\t\t\t'to' => $seller->number,\r\n\t\t\t\t'from' => 'Info',\r\n\t\t\t\t'message' => \"Trade for \".$checkTrade->amount .\"€ \"\r\n\t\t\t\t.\"https://24dinero.com/\"\r\n\t\t\t\t,\r\n\t\t);\r\n\t\t//sms_send($params,$token);\r\n\t\t\r\n\t\t//start send email\r\n\t\t$bodyStatusDineroSeller= '\r\n\t\t\t\t\t\t<div>\r\n <a href=\"#\"\r\n style=\"background-color:#D84A38;padding:10px;color:#ffffff;display:inline-block;font-family:tahoma;font-size:13px;font-weight:bold;line-height:33px;text-align:center;text-decoration:none;-webkit-text-size-adjust:none;\">\r\n\t\t\t\t\t\t\t\tدرخواست انتقال یورو، لطفا سریعا اقدام کنید\r\n\t\t\t\t\t\t\t </a>\r\n </div>\r\n\t\t\t\t\t';\r\n\t\t\r\n\t\t$bodyInfoSeller= \"\r\n\t\t\t\t <div>\r\n\t\t\t\t\r\nPayment has confirmed for your advertisements on 24dinero.com.\r\n <br>\r\nTransfer amount:\".$checkTrade->amount .\"€ <br>\r\nBank: \".$buyerBankname->text.\"<br>\r\nBeneficiary Name: \".$buyerFullname->text.\"<br>\r\nIBAN: \".$buyerIban->text.\"<br>\r\n\t\t\r\nYou can confirm or cancel the transaction on the following link: <br>\r\n\t\t\r\n<a href=\\\"https://\".$_SERVER['HTTP_HOST'].\"/dinero/transact/\".$checkTrade->id.\"\\\">\r\n\t\t\t\t\t\thttps://\".$_SERVER['HTTP_HOST'].\"/dinero/transact/\".$checkTrade->id.\"\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\r\n </div>\r\n\t\t\t\t\t\";\r\n\t\t$bodyTransactionSeller= '\r\n\t\t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" class=\"w320\" style=\"height:100%;\">\r\n <tr>\r\n <td valign=\"top\" class=\"mobile-padding\" style=\"padding:20px;\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro request</b>\r\n </td>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro Rate</b>\r\n </td>\r\n <td>\r\n <b>Total Toman</b>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n '.number_format($checkTrade->amount).'\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($checkTrade->exchange_rate*$checkTrade->amount).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n\t\t\t\t\t\t'.number_format(floor($checkTrade->amount*2.5/100)).' <br>\r\n ٪2.5 Commission\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format((floor($checkTrade->amount*2.5/100)) * $checkTrade->exchange_rate).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n \t\t\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n Total amount:\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n <b>'.number_format($checkTrade->exchange_rate*$checkTrade->amount+ (floor($checkTrade->amount*2.5/100)) * $checkTrade->exchange_rate).'</b>\r\n </td>\r\n </tr>\r\n </table>\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-top:35px;\">\r\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n <tr>\r\n \t\t\r\n <td style=\"padding:0px 0 15px 30px;\" class=\"mobile-block\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n \t\t\r\n <tr>\r\n <td>Euro Request: </td>\r\n <td> €'.number_format($checkTrade->amount).'</td>\r\n </tr>\r\n \t\t\r\n <tr>\r\n <td>Due by: </td>\r\n <td> '.date(\"Y-m-d\").'</td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \t\t\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n\t\t\t\t\t';\r\n\t\t$bodyStatusDineroBuyer= '\r\n\t\t\t\t\t\t<div>\r\n <a href=\"#\"\r\n style=\"background-color:#016910;padding:10px;color:#ffffff;display:inline-block;font-family:tahoma;font-size:13px;font-weight:bold;line-height:33px;text-align:center;text-decoration:none;-webkit-text-size-adjust:none;\">\r\n\t\t\t\t\t\t\t\tدرخواست انتقال یورو\r\n\t\t\t\t\t\t\t </a>\r\n </div>\r\n\t\t\t\t\t';\r\n\t\t\r\n\t\t$bodyInfoBuyer= \"\r\n\t\t\t\t <div>\r\n\t\t\t\t\r\nPayment has confirmed for your trade on 24dinero.com.\r\n <br>\r\nTransfer amount:\".$checkTrade->amount .\"€ <br>\r\nBank: \".$buyerBankname->text.\"<br>\r\nBeneficiary Name: \".$buyerFullname->text.\"<br>\r\nIBAN: \".$buyerIban->text.\"<br>\r\n\t\t\r\nYou can follow the transaction on the following link: <br>\r\n\t\t\r\n<a href=\\\"https://\".$_SERVER['HTTP_HOST'].\"/dinero/trade/\".$checkTrade->id.\"\\\">\r\n\t\t\t\t\t\thttps://\".$_SERVER['HTTP_HOST'].\"/dinero/trade/\".$checkTrade->id.\"\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\r\n </div>\r\n\t\t\t\t\t\";\r\n\t\t$bodyTransactionBuyer= '\r\n\t\t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" class=\"w320\" style=\"height:100%;\">\r\n <tr>\r\n <td valign=\"top\" class=\"mobile-padding\" style=\"padding:20px;\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro request</b>\r\n </td>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro Rate</b>\r\n </td>\r\n <td>\r\n <b>Total Toman</b>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n '.number_format($checkTrade->amount).'\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($checkTrade->exchange_rate*$checkTrade->amount).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n\t\t\t\t\t\t'.number_format($transferAmount).' <br>\r\n Transfer Amount\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($transferAmount* $checkTrade->exchange_rate).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n \t\t\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n Total amount:\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n <b>'.number_format($checkTrade->exchange_rate*$checkTrade->amount+ $transferAmount* $checkTrade->exchange_rate).'</b>\r\n </td>\r\n </tr>\r\n </table>\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-top:35px;\">\r\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n <tr>\r\n \t\t\r\n <td style=\"padding:0px 0 15px 30px;\" class=\"mobile-block\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n \t\t\r\n <tr>\r\n <td>Euro Request: </td>\r\n <td> €'.number_format($checkTrade->amount).'</td>\r\n </tr>\r\n \t\t\r\n <tr>\r\n <td>Due by: </td>\r\n <td> '.date(\"Y-m-d\").'</td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \t\t\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n\t\t\t\t\t';\r\n\t\t//sendingblue email\r\n\t\trequire_once(__COREROOT__.\"/module/dinero/libs/Mailin.php\");\r\n\t\trequire_once(__COREROOT__.\"/module/dinero/controller/emailTemplate.php\");\r\n\t\t$mailin = new Mailin('https://api.sendinblue.com/v2.0',$GLOBALS['GCMS_SETTING']['dinero']['sendinblueAPIKey']);\r\n\t\t//seller\r\n\t\t$maildata = array( \"to\" => array($seller->email=> $sellerFullname->text),\r\n\t\t\t\t\"from\" => array($GLOBALS['GCMS_SETTING']['dinero']['sendinblueSenderEmail']),\r\n\t\t\t\t\"subject\" => \"Trade Paid \".$_SERVER['HTTP_HOST'],\r\n\t\t\t\t\"html\" => emailTemp($bodyStatusDineroSeller,$bodyInfoSeller,$bodyTransactionSeller),\r\n\t\t\t\t\"headers\" => array(\"Content-Type\"=> \"text/html; charset=iso-8859-1\",\"X-param1\"=> \"value1\", \"X-param2\"=> \"value2\",\"X-Mailin-custom\"=>\"my custom value\", \"X-Mailin-IP\"=> \"102.102.1.2\", \"X-Mailin-Tag\" => \"My tag\")\r\n\t\t);\r\n\t\t$mailin->send_email($maildata);\r\n\t\t//buyer\r\n\t\t$maildata = array( \"to\" => array($buyer->email=> $buyerFullname->text),\r\n\t\t\t\t\"from\" => array($GLOBALS['GCMS_SETTING']['dinero']['sendinblueSenderEmail']),\r\n\t\t\t\t\"subject\" => \"Trade Paid \".$_SERVER['HTTP_HOST'],\r\n\t\t\t\t\"html\" => emailTemp($bodyStatusDineroBuyer,$bodyInfoBuyer,$bodyTransactionBuyer),\r\n\t\t\t\t\"headers\" => array(\"Content-Type\"=> \"text/html; charset=iso-8859-1\",\"X-param1\"=> \"value1\", \"X-param2\"=> \"value2\",\"X-Mailin-custom\"=>\"my custom value\", \"X-Mailin-IP\"=> \"102.102.1.2\", \"X-Mailin-Tag\" => \"My tag\")\r\n\t\t);\r\n\t\t$mailin->send_email($maildata);\r\n\t\t//\\\\\\\\\\end send email\r\n\t\t\r\n\t\t$_SESSION['result']=\"پرداخت شما با موفقیت انجام شد\";\r\n\t\t$_SESSION['alert']=\"success\";\r\n\t\theader(\"location: /dinero/trade/\".$Trade);\r\n\t\t\r\n\t}\r\n\t\r\n}", "function credit_transaction($order_id, $amount, $currency, $txn_id, $reason, $origin) {\n\n\t$type = \"CREDIT\";\n\n\t$date = (gmdate(\"Y-m-d H:i:s\"));\n\n\t$sql = \"SELECT * FROM transactions where txn_id='$txn_id' and `type`='CREDIT' \";\n\t$result = mysql_query($sql) or die(mysql_error($sql));\n\tif (mysql_num_rows($result)!=0) {\n\t\treturn; // there already is a credit for this txn_id\n\t}\n\n// check to make sure that there is a debit for this transaction\n\n\t$sql = \"SELECT * FROM transactions where txn_id='$txn_id' and `type`='DEBIT' \";\n\t$result = mysql_query($sql) or die(mysql_error($sql));\n\tif (mysql_num_rows($result)>0) {\n\n\t\t$sql = \"INSERT INTO transactions (`txn_id`, `date`, `order_id`, `type`, `amount`, `currency`, `reason`, `origin`) VALUES('$txn_id', '$date', '$order_id', '$type', '$amount', '$currency', '$reason', '$origin')\";\n\n\t\t$result = mysql_query ($sql) or die (mysql_error());\n\t}\n\n\n}", "public function gettransactions($startdate,$enddate,$id=false){\n\n$condition = \"\";\n//Are we looking transactions for only one account ?\n if ($id!=false) {\n $condition = \" AND account_id=$id \";\n }\n\n//if exists then drop it\n$this->db->query(\"DROP TABLE IF EXISTS \".$this->db->dbprefix('temp_postings_1'));\n\n//Create temporary table that will store the mirrored table\n $this->db->query(\"CREATE TEMPORARY TABLE \".$this->db->dbprefix('temp_postings_1').\"\n (SELECT * FROM \".$this->db->dbprefix('postings').\" \n WHERE (created_at BETWEEN '$startdate' AND '$enddate') $condition )\");\n\n//if exists then drop it\n$this->db->query(\"DROP TABLE IF EXISTS \".$this->db->dbprefix('temp_postings_2'));\n\n$this->db->query(\"CREATE TEMPORARY TABLE \".$this->db->dbprefix('temp_postings_2').\"(\nSELECT a.transaction_id,\n a.account_id AS from_account,\n b.account_id AS to_account,\n a.journal_id,\n a.amount,\n a.comment,\n a.created_at,\n a.created_by\nFROM \".$this->db->dbprefix('temp_postings_1').\" AS a , \".$this->db->dbprefix('postings').\" AS b \nWHERE a.journal_id=b.journal_id AND a.amount=b.amount*-1 \n AND a.comment=b.comment AND a.created_at=b.created_at\n AND a.created_by=b.created_by AND a.amount>0\n AND a.transaction_id=b.transaction_id)\");\n\n\n\n $dataset=$this->db->query(\"SELECT a.transaction_id,\n CONCAT(b.name,' [#',b.code,'] ') AS from_account,\n CONCAT(c.name,' [#',c.code,'] ') AS to_account,\n d.type AS journal_type,\n a.amount,\n a.comment,\n a.created_at,\n CONCAT(e.first_name,' ',e.last_name) AS created_by\n\nFROM \".$this->db->dbprefix('temp_postings_2').\" AS a\nLEFT JOIN \".$this->db->dbprefix('accounts').\" AS b ON a.from_account=b.id\nLEFT JOIN \".$this->db->dbprefix('accounts').\" AS c ON a.to_account =c.id\nLEFT JOIN \".$this->db->dbprefix('journals').\" AS d ON a.journal_id =d.id\nLEFT JOIN \".$this->db->dbprefix('users').\" AS e ON a.created_by=e.id \nORDER BY created_at DESC\");\n\n return $dataset->result();\n}", "function get_ethDeposit_user($addr)\n{\n try {\n $AdminAddress = decrypt(get_config('eth_address'));\n $user_deposit = 0;\n $eurl = 'https://api.etherscan.io/api?module=account&action=txlist&address=' . $addr . '&startblock=0&endblock=latest';\n\n $cObj = curl_init();\n curl_setopt($cObj, CURLOPT_URL, $eurl);\n curl_setopt($cObj, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($cObj, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($cObj, CURLOPT_RETURNTRANSFER, TRUE);\n $output = curl_exec($cObj);\n $curlinfos = curl_getinfo($cObj);\n\n $result = json_decode($output);\n\n if ($result->message == 'OK') {\n $transaction = $result->result;\n for ($tr = 0; $tr < count($transaction); $tr++) {\n\n $Fromaddress = $transaction[$tr]->from;\n $Toaddress = $transaction[$tr]->to;\n $value = $transaction[$tr]->value;\n\n if ($Toaddress === $AdminAddress) {\n $eth_balance = $value;\n $ether_balance = ($eth_balance / 1000000000000000000);\n $user_deposit = $user_deposit + $ether_balance;\n }\n\n }\n }\n $internalurl = 'https://api.etherscan.io/api?module=account&action=txlistinternal&address=' . $addr . '&startblock=0&endblock=latest';\n\n $cObj = curl_init();\n curl_setopt($cObj, CURLOPT_URL, $internalurl);\n curl_setopt($cObj, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($cObj, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($cObj, CURLOPT_RETURNTRANSFER, TRUE);\n $output = curl_exec($cObj);\n $curlinfos = curl_getinfo($cObj);\n\n $internalresult = json_decode($output);\n if ($internalresult->message == 'OK') {\n $transaction = $internalresult->result;\n for ($tr = 0; $tr < count($transaction); $tr++) {\n\n $Fromaddress = $transaction[$tr]->from;\n $Toaddress = $transaction[$tr]->to;\n $value = $transaction[$tr]->value;\n\n if ($Toaddress === $AdminAddress) {\n $eth_balance = $value;\n $ether_balance = ($eth_balance / 1000000000000000000);\n $user_deposit = $user_deposit + $ether_balance;\n }\n }\n }\n return $user_deposit;\n } catch (\\Exception $exception) {\n return 'Error';\n }\n}", "public function listTransactionByBill(AccessToken $token, $id, $requestBodyParameters = [])\n\t{\n\t\treturn $this->executeAndParse(self::METHOD_GET, \"{$this->getBaseApiUrl()}/bills/{$id}/transactions\", $token, $requestBodyParameters);\n\t}", "public function setTransferId($var)\n {\n GPBUtil::checkString($var, True);\n $this->transfer_id = $var;\n\n return $this;\n }", "public function checkout($id) {\n\t\t$debt = Debt::find($id);\n\t\t$paid = Input::get('amount');\n\t\t$debt->amount -= $paid;\n\t\tif($debt->amount <= 0.00) {\n\t\t\t$debt->delete();\n\t\t\treturn Redirect::action('DebtController@index')\n ->with('message', 'Whole debt has paid.');\n\t\t}\n\t\tif($debt->push()) {\n\t\t\treturn Redirect::action('DebtController@pay', array($id))\n ->with('message', 'Part of debt has paid.');\n\t\t}\n\t\treturn Redirect::action('DebtController@pay', array($id))\n ->with('message', 'Debt not paid.');\n\t}", "public function actionTransaction(){\n $user_id = \\Yii::$app->user->getID();\n $user = User::findIdentity($user_id);\n $transactionsIn = Transaction::find()->joinWith('order')->joinWith('post')->joinWith('withdraw')->where([\n 'payment_status'=>'completed', \n 'post_services.owner_id'=>\\Yii::$app->user->getId(),\n ])->all();\n $transactionsOut = Transaction::find()->joinWith('order')->joinWith('post')->where([\n 'payment_status'=>'completed', \n 'accepted_orders.user_id'=>\\Yii::$app->user->getId(),\n ])->all();\n return $this->render('transactions', ['transactionsIn'=>$transactionsIn, 'transactionsOut'=>$transactionsOut, 'user'=>$user]);\n }", "public static function send(int $fromUserId, int $toUserId, int $amount)\n {\n if ($amount < 0) {\n throw new WalletsException('Amount is lower than zero');\n }\n\n $fromWallet = self::getWallet($fromUserId);\n\n if ($fromWallet->amount - $fromWallet->blocked < $amount) {\n throw new InsufficientFundsException();\n }\n\n return Db::transaction(function () use ($fromWallet, $toUserId, $amount) {\n // Credit\n $creditTransaction = TransactionsTable::create();\n $creditTransaction->userId = $fromWallet->userId;\n $creditTransaction->amount = $amount;\n $creditTransaction->type = TransactionsTable::TYPE_CREDIT;\n $creditTransaction->save();\n\n $fromWallet->amount -= $amount;\n $fromWallet->save();\n\n // System percent\n $systemAmount = ceil(OptionsTable::get('percent') / 100 * $amount);\n $ownerAmount = $amount - $systemAmount;\n\n // Debit to system\n $transaction = TransactionsTable::create();\n $transaction->userId = UsersTable::SYSTEM_USER;\n $transaction->amount = $systemAmount;\n $transaction->type = TransactionsTable::TYPE_DEBIT;\n $transaction->save();\n\n // Debit to owner\n $debitTransaction = TransactionsTable::create();\n $debitTransaction->userId = $toUserId;\n $debitTransaction->amount = $ownerAmount;\n $debitTransaction->type = TransactionsTable::TYPE_DEBIT;\n $debitTransaction->save();\n\n $toWallet = self::getWallet($toUserId);\n $toWallet->amount += $ownerAmount;\n $toWallet->save();\n });\n }", "static public function transfer(\n PublicKey $source,\n PublicKey $destination,\n PublicKey $owner,\n PublicKey $mint,\n int $amount,\n int $decimals\n ): TransactionInstruction\n {\n /**\n * TokenInstructions :\n * Transfer = 3,\n * TransferChecked = 12,\n */\n $data = [\n // u8\n ...unpack(\"C*\", pack(\"C\", 12)), // token instruction index\n // u64\n ...unpack(\"C*\", pack(\"P\", $amount)), // amount without decimals\n // u8\n ...unpack(\"C*\", pack(\"C\", $decimals)), // token decimals\n ];\n $keys = [\n new AccountMeta($source, false, true), // source account address\n new AccountMeta($mint, false, false), // mint token address\n new AccountMeta($destination, false, true), // destination account address, if not exist need call\n new AccountMeta($owner, true, true), // singer address, wallet who will be sing tx\n ];\n\n return new TransactionInstruction(\n self::programId(),\n $keys,\n $data\n );\n }", "public function showTransactionBankAccountRequest($id)\n {\n // verify the required parameter 'id' is set\n if ($id === null || (is_array($id) && count($id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $id when calling showTransactionBankAccount'\n );\n }\n\n $resourcePath = '/transactions/{id}/bank_accounts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($id !== null) {\n $resourcePath = str_replace(\n '{' . 'id' . '}',\n ObjectSerializer::toPathValue($id),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires HTTP basic authentication\n if (!empty($this->config->getUsername()) || !(empty($this->config->getPassword()))) {\n $headers['Authorization'] = 'Basic ' . base64_encode($this->config->getUsername() . \":\" . $this->config->getPassword());\n }\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function getTransactionsByTransactionId(\n $transactionId,\n $destination,\n $compression = 'GZIP'\n ) {\n return $this->getTransactions('TRANSACTIONID', $transactionId, $destination, $compression);\n }", "function transferRelatedRecords($module, $transferEntityIds, $entityId) {\n\t\tglobal $adb,$log;\n\t\t$log->debug(\"Entering function transferRelatedRecords ($module, $transferEntityIds, $entityId)\");\n\n\t\t$rel_table_arr = Array(\"Potentials\"=>\"vtiger_contpotentialrel\",\"Potentials\"=>\"vtiger_potential\",\"Activities\"=>\"vtiger_cntactivityrel\",\n\t\t\t\t\"Emails\"=>\"vtiger_seactivityrel\",\"HelpDesk\"=>\"vtiger_troubletickets\",\"Quotes\"=>\"vtiger_quotes\",\"PurchaseOrder\"=>\"vtiger_purchaseorder\",\n\t\t\t\t\"SalesOrder\"=>\"vtiger_salesorder\",\"Products\"=>\"vtiger_seproductsrel\",\"Documents\"=>\"vtiger_senotesrel\",\n\t\t\t\t\"Attachments\"=>\"vtiger_seattachmentsrel\",\"Campaigns\"=>\"vtiger_campaigncontrel\",'Invoice'=>'vtiger_invoice',\n 'ServiceContracts'=>'vtiger_servicecontracts','Project'=>'vtiger_project','Assets'=>'vtiger_assets');\n\n\t\t$tbl_field_arr = Array(\"vtiger_contpotentialrel\"=>\"potentialid\",\"vtiger_potential\"=>\"potentialid\",\"vtiger_cntactivityrel\"=>\"activityid\",\n\t\t\t\t\"vtiger_seactivityrel\"=>\"activityid\",\"vtiger_troubletickets\"=>\"ticketid\",\"vtiger_quotes\"=>\"quoteid\",\"vtiger_purchaseorder\"=>\"purchaseorderid\",\n\t\t\t\t\"vtiger_salesorder\"=>\"salesorderid\",\"vtiger_seproductsrel\"=>\"productid\",\"vtiger_senotesrel\"=>\"notesid\",\n\t\t\t\t\"vtiger_seattachmentsrel\"=>\"attachmentsid\",\"vtiger_campaigncontrel\"=>\"campaignid\",'vtiger_invoice'=>'invoiceid',\n 'vtiger_servicecontracts'=>'servicecontractsid','vtiger_project'=>'projectid','vtiger_assets'=>'assetsid',\n 'vtiger_payments'=>'paymentsid');\n\n\t\t$entity_tbl_field_arr = Array(\"vtiger_contpotentialrel\"=>\"contactid\",\"vtiger_potential\"=>\"contact_id\",\"vtiger_cntactivityrel\"=>\"contactid\",\n\t\t\t\t\"vtiger_seactivityrel\"=>\"crmid\",\"vtiger_troubletickets\"=>\"contact_id\",\"vtiger_quotes\"=>\"contactid\",\"vtiger_purchaseorder\"=>\"contactid\",\n\t\t\t\t\"vtiger_salesorder\"=>\"contactid\",\"vtiger_seproductsrel\"=>\"crmid\",\"vtiger_senotesrel\"=>\"crmid\",\n\t\t\t\t\"vtiger_seattachmentsrel\"=>\"crmid\",\"vtiger_campaigncontrel\"=>\"contactid\",'vtiger_invoice'=>'contactid',\n 'vtiger_servicecontracts'=>'sc_related_to','vtiger_project'=>'linktoaccountscontacts','vtiger_assets'=>'contact',\n 'vtiger_payments'=>'relatedcontact');\n\n\t\tforeach($transferEntityIds as $transferId) {\n\t\t\tforeach($rel_table_arr as $rel_module=>$rel_table) {\n\t\t\t\t$id_field = $tbl_field_arr[$rel_table];\n\t\t\t\t$entity_id_field = $entity_tbl_field_arr[$rel_table];\n\t\t\t\t// IN clause to avoid duplicate entries\n\t\t\t\t$sel_result = $adb->pquery(\"select $id_field from $rel_table where $entity_id_field=? \" .\n\t\t\t\t\t\t\" and $id_field not in (select $id_field from $rel_table where $entity_id_field=?)\",\n\t\t\t\t\t\tarray($transferId,$entityId));\n\t\t\t\t$res_cnt = $adb->num_rows($sel_result);\n\t\t\t\tif($res_cnt > 0) {\n\t\t\t\t\tfor($i=0;$i<$res_cnt;$i++) {\n\t\t\t\t\t\t$id_field_value = $adb->query_result($sel_result,$i,$id_field);\n\t\t\t\t\t\t$adb->pquery(\"update $rel_table set $entity_id_field=? where $entity_id_field=? and $id_field=?\",\n\t\t\t\t\t\t\tarray($entityId,$transferId,$id_field_value));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$adb->pquery(\"UPDATE vtiger_potential SET related_to = ? WHERE related_to = ?\", array($entityId, $transferId));\n\t\t}\n\t\tparent::transferRelatedRecords($module, $transferEntityIds, $entityId);\n\t\t$log->debug(\"Exiting transferRelatedRecords...\");\n\t}", "public function createIntern(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'receiver.account' => 'required|regex:/^THW[0-9]{6}DZD$/|exists:accounts,number',\n 'amount' => 'required|numeric|min:0',\n 'reason' => 'required|max:255',\n ]);\n $validator->sometimes('justification', 'required', function ($input) {//todo more validation\n return $input->amount > 200000; // Amount \"Depasse\" 200 000\n });\n if ($validator->fails()) {\n return response($validator->errors(), config('code.BAD_REQUEST'));\n }\n\n\n $amount = $request->input('amount');\n $hasEnoughMoney = false;\n /**start transaction**/\n DB::beginTransaction();\n\n try {\n\n $senderAccount = $this->client()->accounts()\n ->courant()->first();//todo check methode first()\n\n //check the amount\n if (!$senderAccount->hasEnoughMoney($amount)) throw new \\Exception;\n $hasEnoughMoney = true;\n\n //create the transfer\n $commission = config('commission.COUR_COUR') * $amount;\n $now = \\Carbon\\Carbon::now();\n $nb = BalanceHistory::count();//todo fix this !all sol tested! re-migrate DB\n //sender history\n BalanceHistory::create([\n 'id' => $nb + 1,\n 'amount' => $amount + $commission,//todo put it negative !!\n 'transaction_type' => 'vir_client',\n 'transaction_direction' => 'out',\n 'account_id' => $senderAccount->number,\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n if ($amount > 200000) {\n $transferDate = null;\n $creationDate = $now->format('Y-m-d H:i:s');\n $status = 'traitement';\n } else {\n //receiver history\n BalanceHistory::create([\n 'id' => $nb + 2,\n 'amount' => $amount,\n 'transaction_type' => 'vir_client',\n 'transaction_direction' => 'in',\n 'account_id' => $request->input('receiver.account'),\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n //change the amount of the destination client just in case of < 200 000 else till validation\n $receiverAccount = Account::find($request->input('receiver.account'));\n $receiverAccount->balance = $receiverAccount->balance + $amount;\n $receiverAccount->save();\n\n $status = 'valide';\n $transferDate = $creationDate = $now->format('Y-m-d H:i:s');\n }\n\n InternTransfer::create([\n 'code' => $senderAccount->number . $request->input('receiver.account') . $now->format('YmdHi'),\n 'amount' => $amount,\n 'justification' => $request->input('justification'),\n 'reason' => $request->input('reason'),\n 'transferDate' => $transferDate,\n 'creationDate' => $creationDate,\n 'status' => $status,\n 'transfers_type' => 'vir_client',\n 'commission' => $commission,\n 'source_id' => $senderAccount->number,\n 'destination_id' => $request->input('receiver.account'),\n ]);\n\n //todo send commission to Tharwa account\n //we retrieve the amount from the sender account\n $senderAccount->balance = $senderAccount->balance - $commission - $amount;\n $senderAccount->save();\n\n\n// Mail::to($request->input('email'))\n// ->queue(new ClientRequestValidatedMail($acceptedClient->firstname.' '.$acceptedClient->lastname\n// , $request->input('code')));\n\n // all good\n /**commit - no problems **/\n DB::commit();\n return response([\"saved\" => true], config('code.CREATED'));\n\n } catch (\\Exception $e) {\n\n // something went wrong\n /**rollback every thing - problems **/\n DB::rollback();\n\n if (!$hasEnoughMoney)\n return response([\"amount\" => false], config('code.NOT_FOUND'));\n\n return response([\"saved\" => false], config('code.UNKNOWN_ERROR'));\n }\n\n }", "public function delete_transaction($transaction_id){\n //delete any note suggestions for the deal\n\t\t/***********\n\t\tsng:30/apr/2012\n\t\tWe now have transaction_note_suggestions\n\t\t**************/\n $q = \"delete from \".TP.\"transaction_note_suggestions where deal_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /**************************************************************/\n //delete any notes for the deal\n $q = \"delete from \".TP.\"transaction_note where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /**************************************************************/\n //delete any error reports for the deal\n $q = \"delete from \".TP.\"transaction_error_reports where deal_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /*****************************************************************/\n //delete any sources for the deal\n $q = \"delete from \".TP.\"transaction_sources where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /*******************************************************************/\n //delete partner members assiciated with this deal\n $q = \"delete from \".TP.\"transaction_partner_members where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /*************************************************************************/\n //delete partner banks/law firms assiciated with this deal\n $q = \"delete from \".TP.\"transaction_partners where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /*************************************************************************/\n //delete the transaction/tombstone from tombstone_favorite_tombstones\n //tombstone_id is same as transaction id\n $q = \"delete from \".TP.\"favorite_tombstones where tombstone_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /******************************************************************************/\n /**********\n sng:22/sep/2010\n since there can be multiple logos for a transaction, need to delete the images first\n the logos field has the multiple logo images in serialised form\n an array each of which is an array (fileName, default)\n \n also, if those logos are chosen, those have to be deleted [tombstone_chosen_logos ]\n since this is a serialised list, how to update?\n This part should be handled by Mihai\n ************/\n $q = \"select logos from \".TP.\"transaction where id='\".$transaction_id.\"'\";\n $res = mysql_query($q);\n if($res){\n $cnt = mysql_num_rows($res);\n if($cnt > 0){\n $row = mysql_fetch_assoc($res);\n $logos = $row['logos'];\n if($logos!=NULL){\n $logos_arr = unserialize($logos);\n $logos_cnt = count($logos_arr);\n if($logos_cnt > 0){\n foreach($logos_arr as $key=>$value){\n @unlink(FILE_PATH.\"uploaded_img/logo/\".$value['fileName']);\n @unlink(FILE_PATH.\"uploaded_img/logo/thumbnails/\".$value['fileName']);\n }\n }\n }\n }\n }\n /***************************************\n sng:22/nov/2010\n Now it can happen that press release entry may store the deal id if that press release item talks about this deal\n So, before deleting this deal, we will set the deal id in press release to blank (because we cannot delete the press release, that is\n independent of deal)\n **********/\n $q = \"update \".TP.\"press_releases set deal_id='0' where deal_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /************************************************************\n\t\tsng:1/july/2011\n\t\tDelete any private note for the deal\n ******************/\n $q = \"delete from \".TP.\"transaction_private_note where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n\t\t/*************************************************************\n\t\tsng:1/july/2011\n\t\tDelete any discussion for this deal\n\t\t************/\n\t\t$q = \"delete from \".TP.\"transaction_discussion where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n\t\t/************************************************************\n\t\tsng:1/july/2011\n\t\tDelete any case studies for the deal. Before deleting the case study, get the filename and delete it first\n\t\t*****************************/\n\t\t$q = \"select filename from \".TP.\"transaction_case_studies where transaction_id='\".$transaction_id.\"'\";\n\t\t$res = mysql_query($q);\n\t\tif(!$res){\n\t\t\treturn false;\n\t\t}\n\t\twhile($row = mysql_fetch_assoc($res)){\n\t\t\t$filename = $row['filename'];\n\t\t\tif(($filename!=\"\")&&file_exists(FILE_PATH.\"case_studies/\".$filename)){\n\t\t\t\tunlink(FILE_PATH.\"case_studies/\".$filename);\n\t\t\t}\n\t\t}\n\t\t//now delete the records\n\t\t$q = \"delete from \".TP.\"transaction_case_studies where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n\t\t/**********************************************************\n\t\tsng:1/july/2011\n\t\tDelete any transaction correction for this deal. Before deleting it, delete the correcponding records\n\t\tfrom transaction suggestion partner\n\t\t*************/\n\t\t$q = \"select id from \".TP.\"transaction_suggestions where deal_id!='0' AND deal_id='\".$transaction_id.\"'\";\n\t\t$res = mysql_query($q);\n\t\tif(!$res){\n\t\t\treturn false;\n\t\t}\n\t\twhile($row = mysql_fetch_assoc($res)){\n\t\t\t$suggestion_id = $row['id'];\n\t\t\t$del_q = \"delete from \".TP.\"transaction_suggestions_partners where suggestion_id='\".$suggestion_id.\"'\";\n\t\t\t$success = mysql_query($del_q);\n \tif(!$success){\n \treturn false;\n \t}\n\t\t}\n\t\t//now delete the records\n\t\t$q = \"delete from \".TP.\"transaction_suggestions where deal_id!='0' AND deal_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n\t\t/**********************************************************************\n\t\tsng:1/july/2011\n\t\tDelete the transaction extra detail for the deal\n\t\t********************/\n\t\t$q = \"delete from \".TP.\"transaction_extra_detail where transaction_id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n\t\t/************************************************************/\n //now delete the transaction\n $q = \"delete from \".TP.\"transaction where id='\".$transaction_id.\"'\";\n $success = mysql_query($q);\n if(!$success){\n return false;\n }\n /************************************************************************/\n return true;\n }", "abstract protected function getTransactions();", "function confirm($id=\"\"){\r\n \t\t\t//$bitcoin_isvalid = $bitcoin->listtransactions();\r\n\r\n \t\t\t/*$bal=$bitcoin->getbalance();*/\r\n\r\n \r\n\r\n\t\t$id=insep_decode($id);\r\n\t\t$condition=array(\"transactionId\"=>$id,\"status\"=>\"Pending\");\r\n\t\t$transdata=$this->CommonModel->getTableData(\"tansation\",$condition);\r\n\t\tif($transdata->num_rows() >0){\t\t\r\n\r\n\r\n if($this->input->post(\"witdraw_submit\")){ \r\n\r\n\r\n \t\t$currecncy=$transdata->row()->currency;\r\n \t \t$currency=$transdata->row()->currency;\r\n \r\n\r\n \tif($currency==\"BTC\"){\r\n\r\n \t\t$txn_id=$this->transfer_coin(\"BTC\",$transdata);\r\n\r\n\r\n \t}else if($currency==\"LTC\"){ \r\n\r\n \t\t$txn_id=$this->transfer_coin(\"LTC\",$transdata);\r\n\r\n \t}else if($currency==\"DGB\"){ \r\n\r\n \t\t$txn_id=$this->transfer_coin(\"DGB\",$transdata);\r\n\r\n \t}else if($currency==\"DASH\"){ \r\n\r\n \t\t$txn_id=$this->transfer_coin(\"DASH\",$transdata);\r\n\r\n \t}else if($currency==\"ETH\"){\r\n \t\t$txn_id=$this->transfer_eth(\"ETH\",$transdata);\r\n\r\n \t}else if($currency==\"XRP\"){\r\n\r\n \t\t$txn_id=$this->transfer_xrp($transdata);\r\n\r\n \t} else if($currency==\"BTG\"){\r\n\r\n \t\t$txn_id=$this->transfer_coin(\"BTG\",$transdata);\r\n\r\n \t}\r\n\t\telse if($currency==\"BCH\"){\r\n\r\n \t\t$txn_id=$this->transfer_coin(\"BCH\",$transdata);\r\n\r\n \t}\r\n\t\telse if($currency==\"ETC\"){\r\n\r\n \t\t$txn_id=$this->transfer_etc(\"ETC\",$transdata);\r\n\r\n \t}else if($currency==\"XMR\"){\r\n\r\n \t \t$txn_id=$this->transfer_xmr($transdata);\r\n\r\n \t}\r\n\t\t \t\r\n \t\t$status=\"Success\";\r\n\r\n \t\tif($status==\"Success\"){\r\n\r\n\t\t\t\t$transdata=$transdata->row();\r\n\t\t\t\t$currecncy=$transdata->currency;\r\n\t\t\t\t$amount=$transdata->total_amount;\r\n\t\t\t\t$update[\"status\"]=\"Completed\";\r\n\t\t\t\t$update[\"transation_hash\"]=$txn_id;\r\n\t\t\t\t$this->CommonModel->updateTableData(\"tansation\",$update,$condition);\r\n\t\t\t\t$email_data=getEmailTeamplete(10);\r\n\t\t\t\t$subject=$email_data->subject;\r\n\t\t\t\t$template=$email_data->template;\r\n\t\t\t\t$site_data=site_settings();\r\n\t\t\t\t$sitename=$site_data->site_name;\r\n\t\t\t\t$trans_data=$transdata;\r\n\t\t \t $trans_data->total_amount;\t\t\t\t\t\r\n\t\t\t\t\t$data=array(\r\n\t\t\t\t\t\t\"###TRANSID###\"=>$trans_data->transactionId,\t\t\t\r\n\t\t\t\t\t\t\"###AMOUNT###\"=>$trans_data->total_amount.$trans_data->currency,\r\n\t\t\t\t\t\t\"###LOGOIMG###\"=> base_url().\"assets/frontend/images/mail_logo.png\",\r\n\t\t\t\t\t\t\"###FBIMG###\"=> base_url().\"assets/frontend/images/facebook.png\",\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\"###STATUS###\"=> \"Completed\",\t\t\r\n\t\t\t\t\t);\r\n\t\t\t\t\t$data[\"###LOGOIMG###\"]=getSiteLogo();\r\n\t\t\t\t\t$data[\"###EMAILIMG###\"]= base_url().\"assets/frontend/images/email_send.png\";\r\n\t\t\t\t\t$data[\"###FBIMG###\"]= base_url().\"assets/frontend/images/facebook.png\";\t\t\t\r\n\t\t\t\t\t$data[\"###TWIMG###\"]= base_url().\"assets/frontend/images/twitter.png\";\r\n\t\t\t\t\t$data[\"###GPIMG###\"]= base_url().\"assets/frontend/images/gplus.png\";\r\n\t\t\t\t\t$data[\"###LEIMG###\"]= base_url().\"assets/frontend/images/linkedin.png\";\t\r\n\t\t\t\t\t$data[\"###HDIMG###\"]= base_url().\"assets/frontend/images/email.png\";\r\n\t\t\t\t\t$data[\"###FBLINK###\"]= $site_data->facebooklink;\t\t\t\t\r\n\t\t\t\t\t$data[\"###TWLINK###\"]= $site_data->twitterlink;\t\r\n\t\t\t\t\t$data[\"###GPLINK###\"]= $site_data->googlelink;\r\n\t\t\t\t\t$data[\"###LELINK###\"]= $site_data->linkedinlink;\r\n\t\t\t\t$email=get_user_email($trans_data->user_id);\r\n\t\t\t\t $message=strtr($template,$data);\t\t\r\n\t\t\t\tsend_mail($email,$subject,$message);\r\n\t\t\t\t$this->session->set_flashdata(\"success\",\"Withdraw request Completed successfully\");\t\t\r\n\t\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\r\n\r\n\t\t\t}else{\r\n\r\n\r\n\t\t\t\t$this->session->set_flashdata(\"error\",\"Withdraw request error, Tray again after some time\");\t\t\r\n\r\n\t\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\r\n\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$transdata=$transdata->row();\r\n\t\t\t$user_id=$transdata->user_id;\r\n\t\t\t$condition=array(\"user_id\"=>$user_id);\r\n\t\t\t$userdata=$this->CommonModel->getTableData(\"userdetails\",$condition)->row();\t\r\n\t\t\t$data['withdraw']=$transdata;\t\r\n\r\n\t\t\t $data['user_name']=$userdata->username;\t\t\r\n\t\t\t\r\n\t\t\t$this->load->view(\"admin/transation/withdaw_request_details\",$data);\t\r\n\r\n\t\t}\r\n\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$this->session->set_flashdata(\"error\",\"Invalid link or already used link\");\t\t\r\n\t\r\n\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\r\n\r\n\t\t}\r\n\r\n\r\n\r\n\r\n\r\n\t}", "public function getTransaction($txid);", "function moneyDistribution($money, $source_id, $destin_id, $payment_type, $pdo_bank, $pdo) {\n $credit_card=$source_id;\n\t\t//buying item\n if($payment_type==0) {\n //debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n }\n //advertising\n elseif ($payment_type==1){\n //debt seller\n //get seller's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from seller account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n \n //cerdit shola\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola account the money debted from seller account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n }\n //auction entrance\n elseif ($payment_type==2){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //auction victory\n elseif ($payment_type==3){\n //debt bidder\n //subtracting entrance fee from total item price\n $entrance_fee=100;\n $money=$money-$entrance_fee;\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n }\n //automatic auction entrance\n elseif ($payment_type==4){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //refund(return item)\n elseif($payment_type==5){\n //credit buyer\n //get buyer's account number using credit_card from given parameter\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $buyer_account = $stmt->fetchAll();\n //add money into buyer's account using account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$buyer_account[0][\"account_number\"]]);\n\n //debt seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //subtract from seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n $money=$money-$price;\n //debt shola\n //get shola account number\n $shola_account_number=1000548726;\n //subtract from shola account the money credited for buyer account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n\t\t}\n\t\t//if it is split payment\n\t\telseif($payment_type==6){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t\t//if resolveing debt\n\t\telseif($payment_type==7){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n\t\t\t\t$interest=interestRate($destin_id);\n $shola_cut=($money+($money*$interest))*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\t\t\t\t\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" =>$money , \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t}", "public function getTransferId()\n {\n return $this->transfer_id;\n }", "public function testTransactions() {\n /** @var \\Drupal\\commerce_giftcard\\Entity\\GiftcardInterface $giftcard */\n $giftcard = Giftcard::create([\n 'type' => 'example',\n 'code' => 'ABC',\n 'balance' => new Price(50, 'USD'),\n ]);\n $giftcard->save();\n\n $transaction1 = GiftcardTransaction::create([\n 'giftcard' => $giftcard,\n 'amount' => new Price(-10, 'USD')\n ]);\n $transaction1->save();\n\n $this->assertEquals(40, $giftcard->getBalance()->getNumber());\n\n $transaction2 = GiftcardTransaction::create([\n 'giftcard' => $giftcard,\n 'amount' => new Price(-30, 'USD')\n ]);\n $transaction2->save();\n\n $this->assertEquals(10, $giftcard->getBalance()->getNumber());\n\n $transaction3 = GiftcardTransaction::create([\n 'giftcard' => $giftcard,\n 'amount' => new Price('15.50', 'USD')\n ]);\n $transaction3->save();\n\n $this->assertEquals('25.50', $giftcard->getBalance()->getNumber());\n\n $transaction3 = GiftcardTransaction::create([\n 'giftcard' => $giftcard,\n 'amount' => new Price('-25.50', 'USD')\n ]);\n $transaction3->save();\n\n $this->assertTrue($giftcard->getBalance()->isZero());\n }", "public function getCorpoAdminAccountTransactionsbyId($id)\n {\n $account = $this->em->getRepository('CorporateBundle:CorpoAccountTransactions')->getAccountTransactionsById($id);\n return $account;\n }", "function getTransfers($user){\r\n\t\t$transfers=array();\r\n\r\n\r\n $db_players=new ConnectDatabasePlayers($this->mysqli);\r\n\r\n $players=$db_players->dumpSingoliToList(null,null);\r\n \r\n $id_user = $user;\r\n \r\n\r\n\t\ttry{\r\n\t\t\t$tempQuery=\"Select * , UNIX_TIMESTAMP(date) as time from `transfers` where id_user=? order by date ASC\";\r\n\r\n\t\t\tif(!($stmt = $this->mysqli->prepare($tempQuery))) {\r\n\t\t\t echo \"Prepare failed: (\" . $this->mysqli->errno . \") \" . $this->mysqli->error;\r\n\t\t\t}\r\n\r\n\t\t\tif (!$stmt->bind_param(\"i\", $id_user)) {\r\n\t\t\t echo \"Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\r\n\t\t\t}\r\n\r\n\t\t\tif (!$stmt->execute()) {\r\n\t\t\t echo \"Execute failed: (\" . $stmt->errno . \") \" . $stmt->error;\r\n\t\t\t}\r\n \r\n\t\t\t$res=$stmt->get_result();\r\n\t\t\t$res->data_seek(0);\r\n\t\t\t\r\n\t\t\twhile ($row = $res->fetch_assoc()) {\r\n\t\t\t\t$id=$row['id_transfer'];\r\n\t\t\t\t$old_cost=$row['old_player_cost'];\r\n\t\t\t\t$new_cost=$row['new_player_cost'];\r\n\t\t\t\t$old_player=new RosterPlayer($db_players->dumpPlayerById(intval($row['id_old_player'])),$old_cost);\r\n\t\t\t\t$new_player=new RosterPlayer($db_players->dumpPlayerById(intval($row['id_new_player'])),$new_cost);\r\n\t\t\t\t$datetemp = date (\"Y-m-d H:i:s\", $row['time']);\r\n\t\t\t\t$date=new DateTime($datetemp);;\r\n\t\t\t\t$id_market=$row['id_market'];\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$free = $row[\"free\"];\r\n\t\t\t\t\r\n \r\n\t\t\t\t$transfers[$id]=new Transfer($id,$user,$id_market,$old_player,$new_player,$date,$free);\r\n\t\t\t}\r\n\r\n\t\t\treturn $transfers;\r\n\r\n\r\n\t\t}catch(exception $e) {\r\n\t\t\techo \"\\nERRORE DUMP TRANSFERS: \".$e;\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public function store(Request $request)\r\n {\r\n clock($request->all());\r\n\r\n $rules = array(\r\n 'date' => 'required',\r\n 'fromAccountId' => 'required',\r\n 'toAccountId' => 'required',\r\n 'amount' => 'required',\r\n 'description' => 'required',\r\n 'method' => 'required',\r\n /* 'ref' => 'required',\r\n 'person' => 'required',*/\r\n );\r\n\r\n $validator = Validator::make($request->all(), $rules);\r\n if ($validator->fails()) {\r\n\r\n toast('Rectify errors and re-submit!','error','top-right')->autoclose(3500);\r\n\r\n return Redirect::to('transfers/create')\r\n ->withErrors($validator)\r\n ->withInput($request->input());\r\n\r\n } else {\r\n\r\n $transferData = $request->all();\r\n\r\n $transfer = Transfer::create($transferData);\r\n $transfer->save();\r\n\r\n $fromaccount = Account::find($request->fromAccountId);\r\n $fromaccount->balance = $fromaccount->balance-$request->amount;\r\n $fromaccount->save();\r\n\r\n $toaccount = Account::find($request->toAccountId);\r\n $toaccount->balance = $toaccount->balance+$request->amount;\r\n $toaccount->save();\r\n\r\n $transactionData['payerid'] = $request->fromAccountId;\r\n $transactionData['payeeid'] = $request->toAccountId;\r\n $transactionData['type'] = 'Transfer';\r\n $transactionData['amount'] = $request->amount;\r\n $transactionData['description'] = $request->description;\r\n $transactionData['date'] = $request->date;\r\n\r\n $transactionData['account'] = $transfer->fromaccounts->accountName;\r\n $transactionData['dr'] = $request->amount;\r\n $transactionData['cr'] = 0;\r\n $transactionData['bal'] = $fromaccount->balance;\r\n $transfer1 = Transaction::create($transactionData);\r\n \r\n $transactionData['account'] = $transfer->toaccounts->accountName;\r\n $transactionData['cr'] = $request->amount;\r\n $transactionData['dr'] = 0;\r\n $transactionData['bal'] = $toaccount->balance; \r\n\r\n $transfer2 = Transaction::create($transactionData);\r\n\r\n toast('Transfer Created Successfully!','success','top-right')->autoclose(3500);\r\n return Redirect::to('transfers/');\r\n }\r\n }", "function chawa_db_transactions_data() {\n\tglobal $wpdb;\n\t\n\t$table_name = $wpdb->prefix . 'chawa_transactions';\n\t\n\t$wpdb->insert(\n\t\t$table_name, \n\t\tarray(\n\t\t\t'transaction_id' => 'chawa_000000000000000000000000',\n\t\t\t'transaction_type' => 'DEBIT',\n\t\t\t'transaction_status' => 'status',\n\t\t\t'source_id' => 'src_000000000000000000000000',\n\t\t\t'source_status' => 'status',\n\t\t\t'charge_id' => 'py_000000000000000000000000',\n\t\t\t'charge_status' => 'status',\n\t\t\t'user_id' => 0,\n\t\t\t'amount' => 0,\n\t\t\t'recurring' => FALSE,\n\t\t\t'time' => current_time('mysql')\n\t\t) \n\t);\n}", "public function withdrawImpl($db, $amount){\n $stmt = $db->query(\"SELECT balance FROM account where id = \".$this->id);\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $balance = $row['balance'];\n $need = $amount - $balance;\n if($need > 0){\n // Get all the other accounts that are owned by the owners of this\n // account\n $sql = \"SELECT DISTINCT(account_id) FROM account JOIN account_owner ON account_id = account_owner.account_id WHERE id <> $id AND (\";\n $first = true;\n foreach($this->getOwners() as $owner){\n if(!$first){\n $ccl.=\" OR \";\n }\n $first = false;\n $ccl .= \"owner = \".$owner->getId();\n }\n $ccl .= \")\";\n $stmt = $db->query($sql);\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n foreach($results as $row){\n if($need <= 0){\n break;\n }\n $toTransfer = $otherBalance > $need ? $need : $otherBalance;\n if($toTransfer > 0 ){\n $other = $row['account_id'];\n $stmt = $db->query(\"SELECT balance FROM account WHERE id = $other\");\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $otherBalance = $row['balance'];\n $otherBalance -= $toTransfer;\n $balance += $toTransfer;\n $db->exec(\"UPDATE account SET balance = $otherBalance WHERE id = $other\");\n $db->exec(\"UPDATE account SET balance = $balance WHERE id = \".$this->id);\n $db->exec(\"INSERT INTO account_charge (account_id, charge) VALUES ($other, \\\"transfer $toTransfer to account \".$this->id.\"\\\")\");\n $need -= $toTransfer;\n }\n }\n if($need > 0){\n return false;\n }\n }\n $db->exec(\"UPDATE account set balance = \".$balance - $amount.\" WHERE id = \".$this->id);\n return true;\n }", "function deposit($connection,$amount,$accno){\r\n try {\r\n $connection->beginTransaction();\r\n\r\n $accno = $_SESSION['accno'];\r\n $sql = \"UPDATE _accounts SET balance= :balance WHERE accno = :account\";\r\n $statement = $connection->prepare($sql);\r\n\r\n\r\n $final_bal = $amount + Services::getforAccountsBalance($connection,$accno);\r\n //do not deposit to self\r\n if($accno ==$_SESSION['accno']){\r\n return false;\r\n };\r\n //update balance\r\n $statement->execute(array(':balance' => $final_bal,':account'=>$accno));\r\n\r\n if($statement->rowCount()<1){\r\n return false;\r\n }\r\n //update transaction history\r\n $insert_sql = \"INSERT INTO _transactionshistory (accno,date,debit,credit,\r\n balance) VALUES(:accno,:date,:debit,:credit,:balance)\";\r\n $stmt = $connection->prepare($insert_sql);\r\n $stmt->execute(array(':accno'=>$accno,':date'=>date(\"Y/m/d\"),':debit'=>0,':credit'=>$amount,':balance'=>$final_bal));\r\n //$stmt = $connection->prepare($insert_sql);\r\n // if($stmt->rowCount()<1){\r\n // echo \"Insert failed\";\r\n // }else{\r\n // echo \"string\";\r\n // }\r\n $connection->commit();\r\n return true;\r\n } catch (Exception $e) {\r\n\r\n $connection->rollBack();\r\n return false;\r\n }\r\n\r\n }", "public function uploadDetailDataToTransaction($activityId)\n {\n $count = array();\n $count['total'] = $this->prepareDetailTransactionData();\n //exit();\n $element = new Iati_Aidstream_Element_Activity_Transaction();\n \n $result = $element->fetchData($activityId, true);\n $result = Iati_ElementSorter::sortElementsData($result, array('TransactionDate' =>'@iso_date'), array('TransactionValue' => '@value_date'));\n \n // Update if existing transaction by compairing 'internal reference'\n $count['update'] = 0;\n $duplicate = 0;\n $transactionKey = 0;\n foreach ($this->elementData as $key => $data) {\n $refCount = 0;\n foreach($result as $row) {\n if (strtolower($data['ref']) == strtolower($row['@ref']) && !empty($data['ref'])) {\n if ($refCount == 0) {\n $this->elementData[$key]['id'] = $row['id'];\n $this->elementData[$key]['TransactionType']['id'] = $row['TransactionType']['id'];\n $this->elementData[$key]['ProviderOrg']['id'] = $row['ProviderOrg']['id'];\n $this->elementData[$key]['ReceiverOrg']['id'] = $row['ReceiverOrg']['id'];\n $this->elementData[$key]['TransactionValue']['id'] = $row['TransactionValue']['id'];\n $this->elementData[$key]['Description']['id'] = $row['Description']['id'];\n $this->elementData[$key]['TransactionDate']['id'] = $row['TransactionDate']['id'];\n $this->elementData[$key]['FlowType']['id'] = $row['FlowType']['id'];\n $this->elementData[$key]['FinanceType']['id'] = $row['FinanceType']['id'];\n $this->elementData[$key]['AidType']['id'] = $row['AidType']['id'];\n $this->elementData[$key]['DisbursementChannel']['id'] = $row['DisbursementChannel']['id'];\n $this->elementData[$key]['TiedStatus']['id'] = $row['TiedStatus']['id'];\n \n $count['update'] += 1; // Transaction Update count\n $refCount = 1;\n } elseif ($refCount == 1) {\n $duplicate += 1;\n $transactionKey = $key;\n } \n }\n }\n }\n\n // Transaction add count\n $count['add'] = $count['total'] - $count['update'];\n \n if($duplicate >= 1) {\n $this->error[$transactionKey][]['message'] = \"Cannot update transaction. Internal reference duplication on your \n existing transactions. Please use a different internal reference or \n check your existing transactions.\";\n }\n \n if(empty($this->error)){\n $element->save($this->elementData , $activityId);\n \n return $count;\n } else {\n return false;\n }\n }", "function createTransaction( $db, $tx_data, $wallet_id ) {\r\n // Insert the transaction data\r\n $db->insert( 'transactions', $tx_data );\r\n // TODO: Record this transaction in the logs\r\n // Now get the current wallet balance\r\n $current_balance = $db->get( 'wallets','balance',[ 'id' => $wallet_id ]);\r\n // Update the wallet with the new Balance\r\n $db->update( 'wallets',\r\n [\r\n 'balance[+]' => $tx_data['amount'],\r\n 'activated' => 1\r\n ],\r\n [ 'id' => $wallet_id ]\r\n );\r\n // If all went well, return an array with the transaction status\r\n return [\r\n 'success' => true,\r\n 'data' => [\r\n 'ref_no' => $tx_data['ref_no'],\r\n 'prev_bal' => $current_balance,\r\n 'currency' => $tx_data['currency'],\r\n 'new_bal' => ( $current_balance + $tx_data['amount'] )\r\n ]\r\n ];\r\n}", "function getAddress(&$transferData){\n\t\n\tglobal $dz,$thisEntity;\n\t\n\t$username=$transferData['Username'];\n\t$reference=$transferData['Reference'];\n\t$title=$transferData['Title'];\n\t\n\t\n\t// Get the entity of the user being paid:\n\t$toPay=$dz->get_row('select `Entity` from `Root.Usernames` where `Username`=\"'.$username.'\"');\n\t\n\tif(!$toPay){\n\t\t// Username was not found.\n\t\terror('username/notfound');\n\t}\n\n\t// Is the entity the same as this one?\n\t$entityID=$toPay['Entity'];\n\n\t// Transaction delay, if one is applicable.\n\t// This will almost always be zero representing that a transaction is expected to be in the 2s limit.\n\t$delay='0';\n\n\tif($entityID==$thisEntity['ID']){\n\t\t\n\t\t// Yes! This is an internal transaction (i.e. within this bank). No addressing required.\n\t\t$toGroup=$thisEntity['Group'];\n\t\t// return null;\n\t}\n\t\n\t// This is a transaction between banks. We'll need an address to send to:\n\t$entityInfo=$dz->get_row('select `Group`,`Endpoint` from `Root.Entities` where ID='.$entityID);\n\t\n\tif(!$entityInfo){\n\t\t\n\t\t// This server has out-of-date root information.\n\t\tserverError();\n\t\t\n\t}\n\t\n\t// Got a from username? (Optional):\n\tif(isset($transferData['FromUsername'])){\n\t\t// Add it:\n\t\t$privText=',\"from\":\"'.$transferData['FromUsername'].'\",\"name\":\"'.$transferData['Name'].'\"';\n\t}else{\n\t\t$privText='';\n\t}\n\t\n\t// Send the username and reference pair to the username/send API.\n\t// In response we'll get an address to send to.\n\t$error;\n\t$remote=sendTo(\n\t\t$entityInfo['Endpoint'],\n\t\t'username/send',\n\t\t'{\"username\":\"'.$username.'\",\"reference\":\"'.escape($reference,false).'\",\"title\":\"'.escape($title,false).'\",\"items\":'.$transferData['ItemInformation'].$privText.'}',\n\t\t$error\n\t);\n\t\n\t// Did it error?\n\tif($error){\n\t\t\n\t\t// Remote server errored.\n\t\terror('remote/error',$error);\n\t\t\n\t}\n\t\n\t// Update the to group:\n\t$transferData['ToGroup']=$entityInfo['Group'];\n\t\n\t// JSON decode it:\n\t$remote=json_decode($remote,true);\n\t\n\t// Get the address info:\n\t$addrInfo=safe('address',VALID_ARRAY,$remote);\n\t\n\t// Optional delay info:\n\t$delay=safe('delay',VALID_NUMBER,$remote,true);\n\t\n\t// Get the status:\n\t$status=safe('status',VALID_ALPHA,$addrInfo);\n\t\n\tif($status!='OK'){\n\t\t\n\t\t// Remote server was unable to provide an address - try again shortly.\n\t\terror('remote/noaddr',$delay);\n\t\t\n\t}\n\t\n\t// Great - should have an address here:\n\t$address=safe('value',VALID_HEX,$addrInfo);\n\t\n\tif($delay){\n\t\t$transferData['Delay']=$delay;\n\t}\n\t\n\t$transferData['ToAddress']=$address;\n\t\n\treturn $address;\n\t\n}", "public static function transfer($toAccount, $amount)\n {\n $class = self::getClass();\n /**\n * @var \\App\\Lib\\Tokens\\ERC20 $class\n */\n if (!$class::DISABLED) {\n return $class::transfer($toAccount, $amount);\n } else {\n throw new \\Exception($class . ' is disabled!');\n }\n }", "function tranferFounds($project_id, $returnTotal=false, $adaptivepayments_pay = true) {\n\n App::import('Vendor', 'paypal');\n $this->Paypal = new Paypal();\n\n\n $this->recursive = -1;\n $sponsorships = $this->find('all', array('conditions' => array('Sponsorship.project_id' => $project_id)));\n\n $tranferredSponsorships = array();\n $total = 0;\n foreach ($sponsorships as $sponsorship) {\n $sponsorship_id = $sponsorship[$this->alias]['id'];\n if ($this->getPaymentType($sponsorship) == EXPRESSCHECKOUT) { // all of these payments are already on our paypal account, no tenemos que hacer nada.\n if ($this->isTransferred($sponsorship, EXPRESSCHECKOUT)) { // se marco como trasferido ? \n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } else {\n $transactionId = $sponsorship[$this->alias]['expresscheckout_transaction_id'];\n if (!empty($transactionId)) {\n $response = $this->Paypal->hashCall('GetTransactionDetails', array('TRANSACTIONID' => $transactionId));\n if ($this->updateExpressCheckoutStatus($sponsorship_id, $transactionId)) {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n }\n }\n }\n } elseif ($this->getPaymentType($sponsorship) == PREAPPROVAL) {\n if ($this->isTransferred($sponsorship, PREAPPROVAL)) { // se marco como trasferido ? \n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } else {\n $preapproval_key = $sponsorship[$this->alias]['preapproval_key'];\n if ($this->updatePreApprovalStatus($sponsorship_id, $preapproval_key)) { // actualizamos el pago | si esta activo ....\n $transferred = true;\n $sponsorship = $this->read(null, $sponsorship_id);\n if (!$this->isTransferred($sponsorship, PREAPPROVAL)) {\n // transferimos el pago a groofi $transferred = true ;\n if ($adaptivepayments_pay == true && $this->adaptivepayments_pay($sponsorship)) { //\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } elseif ($adaptivepayments_pay == false) {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n }\n } else {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n $sponsorship[$this->alias]['internal_status'] = SPONSORSHIP_TRANSFERRED;\n $sponsorship[$this->alias]['transferred'] = 1;\n $this->save($sponsorship);\n }\n }\n }\n }\n }\n return $returnTotal ? $total : $tranferredSponsorships;\n }", "public function transfer_print() {\n $ids = $this->GetGetValue(\"id\", array());\n if (count($ids) == 0) {\n $this->persistence->SaveState(\"error\", \"Harap pilih data yang akan dicetak !\");\n redirect_url(\"inventory.transfer\");\n return;\n }\n $report = array();\n foreach ($ids as $id) {\n $trx = new Transfer();\n $trx = $trx->LoadById($id);\n $trx->LoadDetails();\n $report[] = $trx;\n }\n $this->Set(\"report\", $report);\n }", "function presta_paybox_call_directplus_dist($id_transaction, $transaction_hash, $refabonne, $ppps, $config = null){\n\tinclude_spip('inc/bank');\n\t\n\tif (!$config){\n\t\t$config = bank_config(\"paybox\", true);\n\t}\n\t$config['mode'] .= \"_dplus\"; // pour les logs\n\t$mode = $config['mode'];\n\n\tif (!$row = sql_fetsel(\"*\", \"spip_transactions\", \"id_transaction=\" . intval($id_transaction) . \" AND transaction_hash=\" . sql_quote($transaction_hash))){\n\t\tspip_log(\"Transaction inconnue $id_transaction/$transaction_hash\", $mode . _LOG_ERREUR);\n\t\treturn array(0, false);\n\t}\n\n\t// securite : eviter de faire payer plusieurs fois une meme transaction si bug en amont\n\tif ($row['statut']=='ok'){\n\t\tspip_log(\"Transaction $id_transaction/$transaction_hash deja reglee\", $mode . _LOG_INFO_IMPORTANTE);\n\t\treturn array($id_transaction, true);\n\t}\n\n\t// On peut maintenant connaître la devise et ses infos\n\t$devise = $row['devise'];\n\t$devise_info = bank_devise_info($devise);\n\tif (!$devise_info) {\n\t\tspip_log(\"Transaction #$id_transaction : la devise $devise n’est pas connue\", $mode . _LOG_ERREUR);\n\t\treturn array(0, false);\n\t}\n\n\tif (!$row['id_auteur']\n\t\tAND isset($GLOBALS['visiteur_session']['id_auteur'])\n\t\tAND $GLOBALS['visiteur_session']['id_auteur']){\n\t\tsql_updateq(\"spip_transactions\", array(\"id_auteur\" => $row['id_auteur'] = $GLOBALS['visiteur_session']['id_auteur']), \"id_transaction=\" . intval($id_transaction));\n\t}\n\n\t// recuperer l'email\n\t$mail = sql_getfetsel('email', \"spip_auteurs\", 'id_auteur=' . intval($row['id_auteur']));\n\n\t// passage en centimes et formattage sur 10 chiffres\n\t$montant = bank_formatter_montant_selon_fraction($row['montant'], $devise_info['fraction'], 10);\n\n\t//\t\tAffectation des parametres obligatoires\n\t$parm = array('VERSION' => '00104', 'SITE' => $config['PBX_SITE'], 'RANG' => $config['PBX_RANG'], 'IDENTIFIANT' => '');\n\n\t// cas de PBX_RANG : paybox fournit 001 mais il faut envoyer 01 au serveur\n\t$parm['RANG'] = str_pad(intval($parm['RANG']), 2, '0', STR_PAD_LEFT);\n\n\t$parm['CLE'] = $config['DIRECT_PLUS_CLE'];\n\t$parm['DATEQ'] = date('dmYHis');\n\t$parm['TYPE'] = _PAYBOX_DIRECTPLUS_AUTHDEBIT_ABONNE;\n\t$parm['DEVISE'] = (string)$devise_info['code_num'];\n\t$parm['REFERENCE'] = intval($id_transaction);\n\t$parm['ARCHIVAGE'] = intval($id_transaction);\n\t$parm['DIFFERE'] = '000';\n\t$parm['NUMAPPEL'] = '';\n\t$parm['NUMTRANS'] = '';\n\t$parm['AUTORISATION'] = '';\n\t$parm['MONTANT'] = $montant;\n\n\t$parm['REFABONNE'] = $refabonne;\n\n\t$ppps = explode(' ', $ppps);\n\t$parm['PORTEUR'] = str_pad($ppps[0], 19, ' ', STR_PAD_RIGHT); // NO CB\n\t$parm['DATEVAL'] = substr($ppps[1], 2) . substr($ppps[1], 0, 2); // VAL CB\n\t$parm['CVV'] = $ppps[2]; // CCV CB\n\n\n\tinclude_spip('inc/distant');\n\n\t// numero de question incremental\n\t// dans spip_meta\n\t// on recommence si collision par concurence...\n\t$maxtry = 5;\n\tdo {\n\t\t$num_question = intval(sql_getfetsel(\"valeur\", \"spip_meta\", \"nom=\" . sql_quote('payboxnumquestion')));\n\t\t$num_question++;\n\t\tecrire_meta('payboxnumquestion', $num_question);\n\n\t\t$parm['NUMQUESTION'] = $num_question;\n\t\t#var_dump($parm);\n\n\t\t// requete en POST sur PAYBOX DIRECT PLUS\n\t\t$url = paybox_url_directplus($config);\n\t\t$options = array(\n\t\t\t'taille_max' => 1048576,\n\t\t\t'datas' => $parm,\n\t\t);\n\t\t$res = recuperer_url($url, $options);\n\t\tif (!$res or empty($res['page'])) {\n\t\t\tspip_log(\"paybox_call_directplus: Echec appel de recuperer_url sur $url avec \".json_encode($parm), $mode . _LOG_ERREUR);\n\t\t\t$r = array();\n\t\t}\n\t\telse {\n\t\t\tparse_str($res['page'], $r);\n\t\t}\n\n\t\tif (!empty($r)) {\n\t\t\tif ($r['CODEREPONSE']=='00005'){\n\t\t\t\tspip_log(\"paybox_call_directplus: Collision Reponse : \".json_encode($res), $mode . _LOG_INFO_IMPORTANTE);\n\t\t\t\t// hum\n\t\t\t\tsleep(1);\n\t\t\t} else {\n\t\t\t\tspip_log(\"paybox_call_directplus: Reponse : \".json_encode($res), $mode . _LOG_DEBUG);\n\t\t\t}\n\t\t}\n\n\t} while ((empty($r) or $r['CODEREPONSE']=='00005') AND $maxtry-->0);\n\n\tif (empty($r)) {\n\t\treturn '';\n\t}\n\t#var_dump($r);\n\t/*\n\t * array(10) {\n [\"NUMTRANS\"]=>\n string(10) \"0000617104\"\n [\"NUMAPPEL\"]=>\n string(10) \"0000981593\"\n [\"NUMQUESTION\"]=>\n string(10) \"0000095720\"\n [\"SITE\"]=>\n string(7) \"1999888\"\n [\"RANG\"]=>\n string(2) \"99\"\n [\"AUTORISATION\"]=>\n string(6) \"XXXXXX\"\n [\"CODEREPONSE\"]=>\n string(5) \"00000\"\n [\"COMMENTAIRE\"]=>\n string(27) \"Demande trait?e avec succ?s\"\n [\"REFABONNE\"]=>\n string(5) \"95720\"\n [\"PORTEUR\"]=>\n string(19) \"SLDLrcsLMPC \"\n\t}\n\t*/\n\n\t// renommons en coherence avec Paybox System\n\t$response = array(\n\t\t'id_transaction' => $id_transaction,\n\t\t'erreur' => $r['CODEREPONSE'],\n\t\t'auth' => $r['AUTORISATION'],\n\t\t'trans' => $r['NUMTRANS'],\n\t\t'montant' => $parm['MONTANT'],\n\t\t'abo' => $r['REFABONNE'],\n\t\t'valid' => $ppps[1],\n\t);\n\n\t$call_response = charger_fonction('response', 'presta/paybox/call');\n\treturn $call_response($config, $response);\n}", "public function getTransactionId();", "public function getTransactionId();", "public function RefundTxn() {\r\n\r\n $ch = curl_init();\r\n\r\n $CURLParameters = http_build_query(array(\r\n // Our default parameters!\r\n \"key\" => $this->key,\r\n \"appid\" => $this->game,\r\n // This can vary from request to request, sometimes its steamid or steamids or even an array.\r\n \"steamid\" => $this->steamid,\r\n // Custom Queries below here.\r\n \"orderid\" => $this->orderid,\r\n ));\r\n\r\n curl_setopt($ch, CURLOPT_URL, \"https://partner.steam-api.com/\" . $this->interface . \"/RefundTxn/v2/\");\r\n\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n curl_setopt($ch, CURLOPT_POST, 1);\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, $CURLParameters);\r\n $CURLResponse = json_decode(curl_exec($ch));\r\n $CURLResponseCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\r\n curl_close($ch);\r\n\r\n\r\n // Error handling improved!\r\n\r\n if ($CURLResponseCode != 200) {\r\n if ($CURLResponseCode == 400) {\r\n throw new exceptions\\SteamRequestParameterException(\"The Order ID or another parameter is invalid!\");\r\n }\r\n if ($CURLResponseCode == 401) {\r\n throw new exceptions\\SteamException(\"App ID or API Key is invalid.\");\r\n }\r\n throw new exceptions\\SteamRequestException(\"$CURLResponseCode Request Error.\");\r\n }\r\n\r\n if ($CURLResponse->response->result == \"OK\") {\r\n return true;\r\n }\r\n\r\n throw new exceptions\\SteamRequestException(json_encode($CURLResponse->response->error));\r\n }", "function createCommonTransactionsForCoinbaseTransactions($accountID, $userEncryptionKey, $globalCurrentDate, $sid, $dbh)\n\t{\n\t\t$responseObject\t\t\t\t\t\t\t\t\t\t\t\t\t\t= array();\n\t\t$responseObject['createCommonTransactionsForCoinbaseTransactions']\t= false;\n\t\t\n\t\t$transactionSourceID\t\t\t\t\t\t\t\t\t\t\t\t= 2;\n\t\t$transactionStatusID\t\t\t\t\t\t\t\t\t\t\t\t= 1;\n\t\t$transactionStatusLabel\t\t\t\t\t\t\t\t\t\t\t\t= \"complete\";\n\t\t$transactionSourceLabel\t\t\t\t\t\t\t\t\t\t\t\t= \"Coinbase\";\n\t\t\n\t\ttry\n\t\t{\t\t\n\t\t\t$getCoinbaseTransactionRecords\t\t\t\t\t\t\t\t\t= $dbh -> prepare(\"SELECT\n\t\tCoinbaseTransactions.transactionID,\n\t\tCoinbaseTransactions.FK_ExchangeTileID,\n\t\tCoinbaseTransactions.FK_GlobalTransactionIdentificationRecordID,\n\t\tCoinbaseTransactions.FK_AuthorID AS authorID,\n\t\tCoinbaseTransactions.FK_AccountID AS accountID,\n\t\tCoinbaseTransactions.FK_TransactionTypeID AS transactionTypeID,\n\t\tCoinbaseTransactions.FK_AssetTypeID AS baseCurrencyID,\n\t\tAssetTypes.assetTypeLabel AS baseCurrencyName,\n\t\t2 AS quoteSpotPriceCurrencyID,\n\t\t'USD' AS quoteSpotPriceCurrencyName,\n\t\tCoinbaseTransactions.creationDate,\n\t\tCoinbaseTransactions.creationDate AS transactionDate,\n\t\tCoinbaseTransactions.transactionTimestamp,\n\t\tAES_DECRYPT(encryptedCoinbaseTransactionIDValue, UNHEX(SHA2(:userEncryptionKey,512))) AS vendorTransactionID,\n\t\tABS(CoinbaseTransactions.cryptoCurrencyAmount) AS btcQuantityTransacted,\n\t\tABS(CoinbaseTransactions.nativeAmount) AS usdQuantityTransacted,\n\t\tCoinbaseTransactions.spotPrice AS spotPriceAtTimeOfTransaction,\n\t\tCoinbaseTransactions.spotPrice AS btcPriceAtTimeOfTransaction,\n\t\tABS(CoinbaseTransactions.cryptoCurrencyAmount * CoinbaseTransactions.spotPrice) AS usdTransactionAmountWithFees,\n\t\tCoinbaseTransactions.networkTransactionFeeAmount,\n\t\tABS(CoinbaseTransactions.networkTransactionFeeAmount * CoinbaseTransactions.spotPrice) AS usdFeeAmount,\n\t\tABS((CoinbaseTransactions.cryptoCurrencyAmount * CoinbaseTransactions.spotPrice) - (CoinbaseTransactions.networkTransactionFeeAmount * CoinbaseTransactions.spotPrice)) AS transactionAmountMinusFeeInUSD,\n\t\tABS((CoinbaseTransactions.cryptoCurrencyAmount * CoinbaseTransactions.spotPrice) + (CoinbaseTransactions.networkTransactionFeeAmount * CoinbaseTransactions.spotPrice)) AS transactionAmountPlusFeeInUSD,\n\t\tTRIM(\n\t\tCONCAT(\n\t\t\tAES_DECRYPT(encryptedDetailsTitle, UNHEX(SHA2(:userEncryptionKey,512))),\n\t\t\t' ',\n\t\t\tAES_DECRYPT(encryptedDetailsSubTitle, UNHEX(SHA2(:userEncryptionKey,512)))\n\t\t)\n\t\t) AS providerNotes,\n\t\tCoinbaseTransactions.isDebit,\n\t\tCoinbaseTransactions.FK_SourceAddressID,\n\t\tCoinbaseTransactions.FK_DestinationAddressID,\n\t\tTransactionTypes.displayTransactionTypeLabel,\n\t\tTransactionTypes.transactionTypeLabel\n\tFROM\n\t\tCoinbaseTransactions\n\t\tINNER JOIN TransactionTypes ON CoinbaseTransactions.FK_TransactionTypeID = TransactionTypes.transactionTypeID AND TransactionTypes.languageCode = 'EN'\n\t\tINNER JOIN AssetTypes ON CoinbaseTransactions.FK_AssetTypeID = AssetTypes.assetTypeID AND AssetTypes.languageCode = 'EN'\n\tWHERE\n\t\tCoinbaseTransactions.FK_AccountID = :accountID\n\tORDER BY\n\t\tCoinbaseTransactions.transactionTimestamp\");\n\t\n\t\t\t$getCoinbaseTransactionRecords -> bindValue(':accountID', $accountID);\n\t\t\t$getCoinbaseTransactionRecords -> bindValue(':userEncryptionKey', $userEncryptionKey);\n\t\t\n\t\t\tif ($getCoinbaseTransactionRecords -> execute() && $getCoinbaseTransactionRecords -> rowCount() > 0)\n\t\t\t{\n\t\t\t\terrorLog(\"began get coinbase crypto transaction records \".$getCoinbaseTransactionRecords -> rowCount() > 0);\n\t\t\t\t\n\t\t\t\twhile ($row = $getCoinbaseTransactionRecords -> fetchObject())\n\t\t\t\t{\t\t\n\t\t\t\t\t$transactionID\t\t\t\t\t\t\t\t\t\t\t= $row -> transactionID;\n\t\t\t\t\t$exchangeTileID\t\t\t\t\t\t\t\t\t\t\t= $row -> FK_ExchangeTileID;\n\t\t\t\t\t$globalTransactionIdentificationRecordID\t\t\t\t= $row -> FK_GlobalTransactionIdentificationRecordID;\n\t\t\t\t\t$accountID\t\t\t\t\t\t\t\t\t\t\t\t= $row -> accountID;\t\n\t\t\t\t\t$authorID\t\t\t\t\t\t\t\t\t\t\t\t= $row -> authorID;\n\t\t\t\t\t\t\n\t\t\t\t\t$transactionTypeID\t\t\t\t\t\t\t\t\t\t= $row -> transactionTypeID;\n\t\t\t\t\t$baseCurrencyID\t\t\t\t\t\t\t\t\t\t\t= $row -> baseCurrencyID; // was assetTypeID - done\n\t\t\t\t\t$baseCurrencyName\t\t\t\t\t\t\t\t\t\t= $row -> baseCurrencyName; // assetTypeName - not needed\n\t\t\t\t\t\t\t\n\t\t\t\t\t$quoteSpotPriceCurrencyID\t\t\t\t\t\t\t\t= $row -> quoteSpotPriceCurrencyID; // was spotPriceCurrencyTypeID - done, needs verification\n\t\t\t\t\t$quoteSpotPriceCurrencyName\t\t\t\t\t\t\t\t= $row -> quoteSpotPriceCurrencyName; // was spotPriceCurrencyType\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t$amount\t\t\t\t\t\t\t\t\t\t\t\t\t= $row -> btcQuantityTransacted;\n\t\t\t\t\t$fee\t\t\t\t\t\t\t\t\t\t\t\t\t= $row -> networkTransactionFeeAmount;\n\t\t\t\t\t$baseToUSDCurrencySpotPrice\t\t\t\t\t\t\t\t= $row -> spotPriceAtTimeOfTransaction;\n\t\t\t\t\t$btcSpotPriceAtTimeOfTransaction\t\t\t\t\t\t= $row -> btcPriceAtTimeOfTransaction;\n\t\t\t\t\t$creationDate\t\t\t\t\t\t\t\t\t\t\t= $row -> creationDate;\n\t\t\t\t\t$transactionDate\t\t\t\t\t\t\t\t\t\t= $row -> transactionDate;\n\t\t\t\t\t$transactionTimestamp\t\t\t\t\t\t\t\t\t= $row -> transactionTimestamp;\n\t\t\t\t\t$vendorTransactionID\t\t\t\t\t\t\t\t\t= $row -> vendorTransactionID;\t\n\t\t\t\t\t$transactionAmountInUSD\t\t\t\t\t\t\t\t\t= $row -> usdQuantityTransacted;\n\t\t\t\t\t$transactionAmountMinusFeeInUSD\t\t\t\t\t\t\t= $row -> transactionAmountMinusFeeInUSD;\n\t\t\t\t\t$transactionAmountPlusFeeInUSD\t\t\t\t\t\t\t= $row -> transactionAmountPlusFeeInUSD;\n\t\t\t\t\t$feeAmountInUSD\t\t\t\t\t\t\t\t\t\t\t= $row -> usdFeeAmount;\n\t\t\t\t\t$usdTransactionAmountWithFees\t\t\t\t\t\t\t= $row -> usdTransactionAmountWithFees;\n\t\t\t\t\t$providerNotes\t\t\t\t\t\t\t\t\t\t\t= $row -> providerNotes;\n\t\t\t\t\t$transactionTypeLabel\t\t\t\t\t\t\t\t\t= $row -> transactionTypeLabel;\n\t\t\t\t\t$displayTransactionTypeLabel\t\t\t\t\t\t\t= $row -> displayTransactionTypeLabel;\n\t\t\t\t\t$isDebit\t\t\t\t\t\t\t\t\t\t\t\t= $row -> isDebit;\n\t\t\t\t\t\t\n\t\t\t\t\t$sourceWalletID\t\t\t\t\t\t\t\t\t\t\t= $row -> FK_SourceAddressID;\n\t\t\t\t\t$destinationWalletID\t\t\t\t\t\t\t\t\t= $row -> FK_DestinationAddressID;\n\t\t\t\t\t\t\n\t\t\t\t\t$responseObject['processingTransaction'][]\t\t\t\t= $vendorTransactionID;\n\t\t\t\t\t\n\t\t\t\t\t$getNativeAndCommonTransactionRecordIDsResult\t\t\t= getNativeAndCommonTransactionRecordIDsForGlobalTransactionIdentificationRecordID($accountID, $baseCurrencyID, $vendorTransactionID, $transactionSourceID, $globalTransactionIdentificationRecordID, $globalCurrentDate, $sid, $dbh);\n\t\t\t\t\t\n\t\t\t\t\terrorLog(\"commonTransactionID: \". $getNativeAndCommonTransactionRecordIDsResult['commonTransactionRecordID']);\n\t\t\t\n\t\t\t\t\t$commonTransactionID\t\t\t\t\t\t\t\t\t= $getNativeAndCommonTransactionRecordIDsResult['commonTransactionRecordID'];\n\t\t\t\n\t\t\t\t\tif (empty($commonTransactionID))\n\t\t\t\t\t{\n\t\t\t\t\t\t$unspentTransactionTotal\t\t\t\t\t\t\t= 0;\n\t\t\t\t\t\t$unfundedSpendTotal\t\t\t\t\t\t\t\t\t= 0;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($isDebit == 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$unspentTransactionTotal \t\t\t\t\t\t= $amount; // shouldn't this be the amount minus the fee amount\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ($isDebit == 1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$unfundedSpendTotal\t\t\t\t\t\t\t\t= $amount; \t// shouldn't this be the amount minus the fee amount\n\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sourceWallet\t\t\t\t\t\t\t\t\t\t= new CompleteCryptoWallet();\n\t\t\t\t\t\t$destinationWallet\t\t\t\t\t\t\t\t\t= new CompleteCryptoWallet();\n\t\t\t\t\n\t\t\t\t\t\t$sourceWalletResponseObject\t\t\t\t\t\t\t= $sourceWallet -> instantiateWalletUsingCryptoWalletRecordID($accountID, $sourceWalletID, $userEncryptionKey, $dbh);\n\t\t\t\t\n\t\t\t\t\t\tif ($sourceWalletResponseObject['instantiatedRecord'] == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrorLog(\"Could not instantiate source Complete Crypto Wallet record $accountID\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$destinationWalletResponseObject\t\t\t\t\t= $destinationWallet -> instantiateWalletUsingCryptoWalletRecordID($accountID, $destinationWalletID, $userEncryptionKey, $dbh);\n\t\t\t\t\n\t\t\t\t\t\tif ($destinationWalletResponseObject['instantiatedRecord'] == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrorLog(\"Could not instantiate destination Complete Crypto Wallet record $accountID, $destinationWalletID\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\terrorLog($vendorTransactionID.\"<BR>\");\n\t\t\t\t\t\n\t\t\t\t\t\t$cryptoTransaction\t\t\t\t\t\t\t\t\t= new CryptoTransaction();\n\t\t\t\t\t\n\t\t\t\t\t\t$cryptoTransaction -> setData(0, $accountID, $authorID, $exchangeTileID, $globalTransactionIdentificationRecordID, $transactionTypeID, $transactionTypeLabel, $transactionStatusID, $transactionStatusLabel, $transactionSourceID, $transactionSourceLabel, $baseCurrencyID, $baseCurrencyName, $quoteSpotPriceCurrencyID, $quoteSpotPriceCurrencyName, $sourceWalletID, $destinationWalletID, $creationDate, $transactionDate, $transactionTimestamp, $transactionID, $vendorTransactionID, $amount, $transactionAmountInUSD, $baseToUSDCurrencySpotPrice, $btcSpotPriceAtTimeOfTransaction, $transactionAmountMinusFeeInUSD, $fee, $feeAmountInUSD, $unspentTransactionTotal, $providerNotes, $isDebit, $sid);\n\t\t\t\t\t\n\t\t\t\t\t\t$writeToDatabaseResponse\t\t\t\t\t\t\t= $cryptoTransaction -> writeToDatabase($userEncryptionKey, $dbh);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($writeToDatabaseResponse['wroteToDatabase'] == true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$transactionID\t\t\t\t\t\t\t\t\t= $cryptoTransaction -> getTransactionID();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\terrorLog(\"wrote transaction $transactionID for $accountID, $authorID, $globalTransactionIdentificationRecordID, $transactionTypeID, $transactionTypeLabel, $transactionStatusID, $transactionStatusLabel, $transactionSourceID, $transactionSourceLabel, $baseCurrencyID, $baseCurrencyName, $quoteSpotPriceCurrencyID, $quoteSpotPriceCurrencyName, $sourceWalletID, $destinationWalletID, $creationDate, $transactionDate, $transactionTimestamp, $transactionID, $vendorTransactionID, $amount, $transactionAmountInUSD, $baseToUSDCurrencySpotPrice, $btcSpotPriceAtTimeOfTransaction, $transactionAmountMinusFeeInUSD, $fee, $feeAmountInUSD, $unspentTransactionTotal, $providerNotes, $isDebit, $sid\", $GLOBALS['debugCoreFunctionality']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\terrorLog(\"could not create transaction for $accountID, $authorID, $globalTransactionIdentificationRecordID, $transactionTypeID, $transactionTypeLabel, $transactionStatusID, $transactionStatusLabel, $transactionSourceID, $transactionSourceLabel, $baseCurrencyID, $baseCurrencyName, $quoteSpotPriceCurrencyID, $quoteSpotPriceCurrencyName, $sourceWalletID, $destinationWalletID, $creationDate, $transactionDate, $transactionTimestamp, $transactionID, $vendorTransactionID, $amount, $transactionAmountInUSD, $baseToUSDCurrencySpotPrice, $btcSpotPriceAtTimeOfTransaction, $transactionAmountMinusFeeInUSD, $fee, $feeAmountInUSD, $unspentTransactionTotal, $providerNotes, $isDebit, $sid\", $GLOBALS['debugCoreFunctionality']);\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\terrorLog(\"found transaction $commonTransactionID for $accountID, $authorID, $globalTransactionIdentificationRecordID, $transactionTypeID, $transactionTypeLabel, $transactionStatusID, $transactionStatusLabel, $transactionSourceID, $transactionSourceLabel, $baseCurrencyID, $baseCurrencyName, $quoteSpotPriceCurrencyID, $quoteSpotPriceCurrencyName, $sourceWalletID, $destinationWalletID, $creationDate, $transactionDate, $transactionTimestamp, $transactionID, $vendorTransactionID, $amount, $transactionAmountInUSD, $baseToUSDCurrencySpotPrice, $btcSpotPriceAtTimeOfTransaction, $transactionAmountMinusFeeInUSD, $fee, $feeAmountInUSD, $unspentTransactionTotal, $providerNotes, $isDebit, $sid\", $GLOBALS['debugCoreFunctionality']);\t\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\terrorLog(\"SELECT\n\t\tCoinbaseTransactions.transactionID,\n\t\tCoinbaseTransactions.FK_ExchangeTileID,\n\t\tCoinbaseTransactions.FK_GlobalTransactionIdentificationRecordID,\n\t\tCoinbaseTransactions.FK_AuthorID AS authorID,\n\t\tCoinbaseTransactions.FK_AccountID AS accountID,\n\t\tCoinbaseTransactions.FK_TransactionTypeID AS transactionTypeID,\n\t\tCoinbaseTransactions.FK_AssetTypeID AS baseCurrencyID,\n\t\tAssetTypes.assetTypeLabel AS baseCurrencyName,\n\t\t2 AS quoteSpotPriceCurrencyID,\n\t\t'USD' AS quoteSpotPriceCurrencyName,\n\t\tCoinbaseTransactions.creationDate,\n\t\tCoinbaseTransactions.creationDate AS transactionDate,\n\t\tCoinbaseTransactions.transactionTimestamp,\n\t\tAES_DECRYPT(encryptedCoinbaseTransactionIDValue, UNHEX(SHA2('$userEncryptionKey',512))) AS vendorTransactionID,\n\t\tABS(CoinbaseTransactions.cryptoCurrencyAmount) AS btcQuantityTransacted,\n\t\tABS(CoinbaseTransactions.nativeAmount) AS usdQuantityTransacted,\n\t\tCoinbaseTransactions.spotPrice AS spotPriceAtTimeOfTransaction,\n\t\tCoinbaseTransactions.spotPrice AS btcPriceAtTimeOfTransaction,\n\t\tABS(CoinbaseTransactions.cryptoCurrencyAmount * CoinbaseTransactions.spotPrice) AS usdTransactionAmountWithFees,\n\t\tCoinbaseTransactions.networkTransactionFeeAmount,\n\t\tABS(CoinbaseTransactions.networkTransactionFeeAmount * CoinbaseTransactions.spotPrice) AS usdFeeAmount,\n\t\tTRIM(\n\t\tCONCAT(\n\t\t\tAES_DECRYPT(encryptedDetailsTitle, UNHEX(SHA2('$userEncryptionKey',512))),\n\t\t\t' ',\n\t\t\tAES_DECRYPT(encryptedDetailsSubTitle, UNHEX(SHA2('$userEncryptionKey',512)))\n\t\t)\n\t\t) AS providerNotes,\n\t\tCoinbaseTransactions.isDebit,\n\t\tCoinbaseTransactions.FK_SourceAddressID,\n\t\tCoinbaseTransactions.FK_DestinationAddressID,\n\t\tTransactionTypes.displayTransactionTypeLabel,\n\t\tTransactionTypes.transactionTypeLabel\n\tFROM\n\t\tCoinbaseTransactions\n\t\tINNER JOIN TransactionTypes ON CoinbaseTransactions.FK_TransactionTypeID = TransactionTypes.transactionTypeID AND TransactionTypes.languageCode = 'EN'\n\t\tINNER JOIN AssetTypes ON CoinbaseTransactions.FK_AssetTypeID = AssetTypes.assetTypeID AND AssetTypes.languageCode = 'EN'\n\tWHERE\n\t\tCoinbaseTransactions.FK_AccountID = $accountID\n\tORDER BY\n\t\tCoinbaseTransactions.transactionTimestamp\", $GLOBALS['debugCoreFunctionality']);\t\n\t\t\t}\n\t\t\t\n\t\t\t$responseObject['importedTransactions']\t\t\t\t\t\t\t= true;\n\t\t}\n\t\tcatch (PDOException $e) \n\t\t{\n\t\t\t$cryptoTransaction \t\t\t\t\t\t\t\t\t\t\t\t= null;\t\n\t\t\t$responseObject['importedTransactions']\t\t\t\t\t\t\t= false;\n\t\t\t\n\t\t\terrorLog($e -> getMessage(), $GLOBALS['criticalErrors']);\n\t\t\n\t\t\tdie();\n\t\t}\n\t\t\n\t\treturn $responseObject;\n\t}", "public function obtenerCuentaFondos($id) {\n\t\t\n $this->db->where('account_id', $id);\n $query = $this->db->get('transactions');\n if ($query->num_rows() > 0)\n return $query->result();\n else\n return $query->result();\n \n }", "private function updateWallet ($vendor, $transaction) {\n $commission = $this->calculateCommission($transaction->type, $vendor->user_id, $transaction->amount);\n $distCommission = $this->calculateCommission($transaction->type, $vendor->parent_id, $transaction->amount);\n $superDistId = Vendor::where('user_id', $vendor->parent_id)->first()->parent_id;\n $superDistCommission = $this->calculateCommission($transaction->type, $superDistId, $transaction->amount);\n\n\n // Perform Wallet Updations for Amount Transacted\n if ($transaction->type == 1 || $transaction->type == 2) {\n $vendor->balance += $transaction->type == 1 ? -$transaction->amount : ($transaction->type == 2 ? $transaction->amount : 0);\n $amount_wallet_transaction = WalletTransaction::create([\n 'user_id' => $vendor->id,\n 'transaction_type' => $transaction->type == 1 ? 0 : ($transaction->type == 2 ? 1 : null),\n 'amount' => $transaction->amount,\n 'balance' => $vendor->balance\n ]);\n\n $key = $transaction->type == 1 ? 'debit_id' : ($transaction->type == 2 ? 'credit_id' : '');\n\n AepsWalletAction::create([\n 'user_id' => $vendor->id,\n 'amount' => $transaction->amount,\n 'status' => 1,\n $key => $amount_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => false\n ]);\n\n $dipl_vendor = Vendor::where('type', 8)->lockForUpdate()->first();\n $dipl_vendor->balance += $transaction->type == 1 ? -$transaction->amount : ($transaction->type == 2 ? $transaction->amount : 0);\n $dipl_vendor->save();\n $dipl_amount_wallet_transaction = WalletTransaction::create([\n 'user_id' => $dipl_vendor->id,\n 'transaction_type' => $transaction->type == 1 ? 0 : ($transaction->type == 2 ? 1 : null),\n 'amount' => $transaction->amount,\n 'balance' => $dipl_vendor->balance\n ]);\n\n AepsWalletAction::create([\n 'user_id' => $dipl_vendor->id,\n 'amount' => $transaction->amount,\n 'status' => 1,\n $key => $dipl_amount_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => false\n ]);\n\n }\n\n $dipl_vendor = Vendor::where('type', 8)->lockForUpdate()->first();\n\n // Perform Wallet Updations for Commission\n if ($commission && $dipl_vendor->commission && $vendor->commission) {\n if ($commission['rate_type'] == 1)\n $vendor->balance += $commission['rate'];\n if ($commission['rate_type'] == 2)\n $vendor->balance += $transaction->amount * $commission['rate']/100;\n $commission_wallet_transaction = WalletTransaction::create([\n 'user_id' => $vendor->id,\n 'transaction_type' => 1,\n 'amount' => $commission['rate'],\n 'balance' => $vendor->balance\n ]);\n\n AepsWalletAction::create([\n 'user_id' => $vendor->id,\n 'amount' => $commission['rate'],\n 'status' => 1,\n 'credit_id' => $commission_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => true\n ]);\n }\n\n if ($distCommission && $dipl_vendor->commission) {\n $distributor = Vendor::where('user_id', $vendor->parent_id)->lockForUpdate()->first();\n if ($distributor && $distributor->commission == 1) {\n if ($distCommission['rate_type'] == 1)\n $distributor->balance += $distCommission['rate'];\n if ($distCommission['rate_type'] == 2)\n $distributor->balance += $transaction->amount * $distCommission['rate']/100;\n $commission_wallet_transaction = WalletTransaction::create([\n 'user_id' => $distributor->id,\n 'transaction_type' => 1,\n 'amount' => $distCommission['rate'],\n 'balance' => $distributor->balance\n ]);\n\n $distributor->save();\n\n AepsWalletAction::create([\n 'user_id' => $distributor->id,\n 'amount' => $distCommission['rate'],\n 'status' => 1,\n 'credit_id' => $commission_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => true\n ]);\n } \n }\n\n if ($superDistCommission && $dipl_vendor->commission) {\n $superDistributor = Vendor::where('user_id', $superDistId)->lockForUpdate()->first();\n if ($superDistributor && $superDistributor->commission == 1) {\n if ($superDistCommission['rate_type'] == 1)\n $superDistributor->balance += $superDistCommission['rate'];\n if ($superDistCommission['rate_type'] == 2)\n $superDistributor->balance += $transaction->amount * $superDistCommission['rate']/100;\n $commission_wallet_transaction = WalletTransaction::create([\n 'user_id' => $superDistributor->id,\n 'transaction_type' => 1,\n 'amount' => $superDistCommission['rate'],\n 'balance' => $superDistributor->balance\n ]);\n\n $superDistributor->save();\n\n AepsWalletAction::create([\n 'user_id' => $superDistributor->id,\n 'amount' => $superDistCommission['rate'],\n 'status' => 1,\n 'credit_id' => $commission_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => true\n ]);\n }\n \n }\n\n return $vendor->balance;\n }", "public function sendPendingTransactionsToNetwork() {\r\n\r\n //We obtain all pending transactions to send\r\n $pending_tx = $this->chaindata->GetAllPendingTransactionsToSend();\r\n\r\n //We add the pending transaction to the chaindata\r\n foreach ($pending_tx as $tx)\r\n $this->chaindata->addPendingTransaction($tx);\r\n\r\n //We get all the peers and send the pending transactions to all\r\n $peers = $this->chaindata->GetAllPeers();\r\n foreach ($peers as $peer) {\r\n\r\n $myPeerID = Tools::GetIdFromIpAndPort($this->ip,$this->port);\r\n $peerID = Tools::GetIdFromIpAndPort($peer['ip'],$peer['port']);\r\n\r\n if ($myPeerID != $peerID) {\r\n $infoToSend = array(\r\n 'action' => 'ADDPENDINGTRANSACTIONS',\r\n 'txs' => $pending_tx\r\n );\r\n\r\n if ($peer[\"ip\"] == NODE_BOOTSTRAP) {\r\n Tools::postContent('https://'.NODE_BOOTSTRAP.'/gossip.php', $infoToSend,5);\r\n }\r\n else if ($peer[\"ip\"] == NODE_BOOTSTRAP_TESTNET) {\r\n Tools::postContent('https://'.NODE_BOOTSTRAP_TESTNET.'/gossip.php', $infoToSend,5);\r\n }\r\n else {\r\n Tools::postContent('http://' . $peer['ip'] . ':' . $peer['port'] . '/gossip.php', $infoToSend,5);\r\n }\r\n }\r\n }\r\n\r\n //We delete transactions sent from transactions_pending_to_send\r\n foreach ($pending_tx as $tx)\r\n $this->chaindata->removePendingTransactionToSend($tx['txn_hash']);\r\n }", "public function transaction()\r\n {\r\n if (($this->dx_auth->is_logged_in()) || ($this->facebook_lib->logged_in()))\r\n {\r\n $user_id = $this->dx_auth->get_user_id();\r\n $conditions = array(\"reservation.userto\" => $user_id);\r\n $query = $this->Trips_model->get_reservation($conditions);\r\n\r\n // Get offset and limit for page viewing\r\n $start = (int) $this->uri->segment(3, 0);\r\n\r\n // Number of record showing per page\r\n $row_count = 20;\r\n\r\n if ($start > 0)\r\n $offset = ($start - 1) * $row_count;\r\n else\r\n $offset = $start * $row_count;\r\n\r\n $limit = array($row_count, $offset);\r\n // Get all transaction\r\n $data['result'] = $this->Trips_model->get_reservation($conditions, $limit);\r\n\r\n // Pagination config\r\n $config['base_url'] = site_url('account/transaction');\r\n $config['uri_segment'] = 3;\r\n $config['num_links'] = 5;\r\n $config['total_rows'] = $query->num_rows();\r\n $config['per_page'] = $row_count;\r\n\r\n // Init pagination\r\n $this->pagination->initialize($config);\r\n // Create pagination links\r\n $data['pagination'] = $this->pagination->create_links2();\r\n\r\n $data['title'] = get_meta_details('Your_Transaction_Details', 'title');\r\n $data[\"meta_keyword\"] = get_meta_details('Your_Transaction_Details', 'meta_keyword');\r\n $data[\"meta_description\"] = get_meta_details('Your_Transaction_Details', 'meta_description');\r\n $data['message_element'] = \"account/view_transaction\";\r\n $this->load->view('template', $data);\r\n }\r\n else\r\n {\r\n redirect('users/signin');\r\n }\r\n }", "public function debt()\n {\n $inDebt = $this->data->getAccounts()->filter(function($value, $key) {\n return $value->balance < 0;\n })->pluck('id');\n\n return response()->json([\n 'data' => $inDebt\n ], 200);\n }", "public static function lockFunds($from, $amount, $fee=0){\n\t\t$fromuser = \\CouchDB::getDoc($from, \"users\");\n\t\t$frombalance = Dogecoin::getBalance($from);\n\t\tif ($frombalance['available'] < ($amount + $fee)){\n\t\t\t//they don't have the funds\n\t\t\treturn \\Shared\\Error::handleError(\"nofunds\");\n\t\t}else{\n\t\t\tif ($fee != 0){\n\t\t\t\t$response = Dogecoin::payMe($from, $fee);\n\t\t\t}\n\t\t\t$response = Dogecoin::move($from, \"LOCKED-FEE\", $amount);\n\t\t\t$fromuser->wallet->locked += $amount;\n\t\t\t$response = \\CouchDB::setDoc($fromuser, \"users\");\n\t\t\treturn $amount;\n\t\t}\n\t\t//something went wrong, but i have no idea what that might be.\n\t\treturn 0;\n\t}", "public function getTransfers()\n {\n return Wrapper\\Player\\Senior::transfershistory($this->getId());\n }" ]
[ "0.6261905", "0.61206454", "0.60871965", "0.60378593", "0.5980156", "0.59335417", "0.59196174", "0.58755606", "0.58568764", "0.5805563", "0.57978535", "0.57524747", "0.5705628", "0.5700498", "0.56866515", "0.56004924", "0.5503042", "0.54939514", "0.54902184", "0.5466322", "0.54589814", "0.54053575", "0.53641325", "0.53266686", "0.5305601", "0.53042525", "0.5267093", "0.52602893", "0.5256087", "0.5200676", "0.5180382", "0.51563555", "0.51543665", "0.51454794", "0.5131883", "0.5129648", "0.51269895", "0.51268256", "0.5124858", "0.511514", "0.506281", "0.50563633", "0.5055866", "0.50516367", "0.5034621", "0.5019901", "0.5004075", "0.5003532", "0.49790537", "0.49744034", "0.49695435", "0.49644127", "0.49585438", "0.4955477", "0.49447855", "0.49439156", "0.4938006", "0.4932134", "0.49317124", "0.49231356", "0.49172953", "0.49148726", "0.49133325", "0.4899784", "0.4893102", "0.48926264", "0.48812598", "0.48764116", "0.4872872", "0.48661348", "0.48603848", "0.48544475", "0.48463652", "0.48350048", "0.48333243", "0.48299426", "0.48282632", "0.4824616", "0.48219654", "0.48183942", "0.48180413", "0.48139462", "0.4809921", "0.4808096", "0.48076516", "0.48071578", "0.48042768", "0.48038912", "0.4795012", "0.47949627", "0.47949627", "0.47944", "0.47922543", "0.47797063", "0.47772795", "0.47738403", "0.47727326", "0.47648442", "0.47608313", "0.47549355" ]
0.6898758
0
Transfer all funds from one account to another
public function closeAccount($payment_address_uuid, $from, $to) { $body = [ 'from' => $from, 'to' => $to, 'close' => true, ]; $result = $this->newAPIRequest('POST', '/accounts/transfer/'.$payment_address_uuid, $body); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transfer_money() {\n\t\t$user_id = $_REQUEST['user_id'];\n\t\t$mobile = $_REQUEST['mobile_no'];\n\t\t$amount = $_REQUEST['amount'];\n\t\t$mobile_no = $_REQUEST['mobile_no'];\n\n\t\t//$transaction_id= mt_rand( 10000000, 99999999);\n\t\t$wallet_type_main = 2;\n\t\t// amount debit in user self\n\t\t$wallet_type_frnd = 1;\n\t\t// amount credit in frnd\n\t\t$wallet_category_to = 5;\n\t\t// transfer money to\n\t\t$wallet_category_from = 10;\n\t\t// transfer money from\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\tif (!empty($mobile)) {\n\t\t\t$user_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif (!empty($user_records)) {\n\t\t\t\t$main_wallet = $user_records['0']['wallet_amount'];\n\t\t\t\t$contact_number_main = $user_records['0']['user_contact_no'];\n\t\t\t\t// main user mobile number\n\t\t\t\tif ($main_wallet >= $amount) {\n\t\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t\t\tif (!empty($records)) {\n\t\t\t\t\t\t$contact_number_frnd = $records['0']['user_contact_no'];\n\t\t\t\t\t\t// frnd mobile number\n\t\t\t\t\t\t$frnd_wallet = $records['0']['wallet_amount'];\n\t\t\t\t\t\t$frnd_id = $records['0']['user_id'];\n\t\t\t\t\t\tif ($frnd_id != $user_id) {\n\t\t\t\t\t\t\t// amount transfer to another\n\t\t\t\t\t\t\t$transaction_id1 = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t$w_to_desc = \"Amount transfer to \" . $contact_number_frnd;\n\t\t\t\t\t\t\t$wallet_to_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_to . '\",\"' . $transaction_id1 . '\",\"' . $w_to_desc . '\",\"' . $contact_number_frnd . '\"');\n\t\t\t\t\t\t\tif (!empty($wallet_to_transfer)) {\n\t\t\t\t\t\t\t\t//amount recieved by transfer\n\t\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t\t$w_by_desc = \"Amount transfer from \" . $contact_number_main;\n\t\t\t\t\t\t\t\t$wallet_by_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $frnd_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_from . '\",\"' . $transaction_id . '\",\"' . $w_by_desc . '\",\"' . $contact_number_main . '\"');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!empty($wallet_by_transfer)) {\n\t\t\t\t\t\t\t\t$main_wallet_money = $main_wallet - $amount;\n\t\t\t\t\t\t\t\t$frnd_wallet_money = $frnd_wallet + $amount;\n\t\t\t\t\t\t\t\t// update main user wallet\n\t\t\t\t\t\t\t\t$data['wallet_amount'] = $main_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data);\n\t\t\t\t\t\t\t\t// update frnd wallet//\n\t\t\t\t\t\t\t\t$data1['wallet_amount'] = $frnd_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $frnd_id, $data1);\n\t\t\t\t\t\t\t\t$post = array('status' => 'true', 'message' => 'Transfer money successfully', 'main_user_id' => $user_id, 'main_wallet' => $main_wallet_money, 'frnd_wallet' => $frnd_wallet_money, 'frnd_id' => $frnd_id, 'transfer_mobile' => $mobile_no, 'transfer_amount' => $amount, 'transaction_id' => $transaction_id1, 'transfer_date' => $current_date);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Error in transfering amount\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Please enter another user number\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"This user is not exist of given number\");\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Wallet amount is not sufficent to transfer money\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"invalid user\", 'user_id' => $user_id);\n\t\t\t}\n\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"missing parameter\", 'user_id' => $user_id, 'amount' => $amount, 'mobile' => $moble);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function transfert()\n {\n\n $account = \\Stripe\\Account::create([\n 'country' => 'US',\n 'type' => 'custom',\n 'requested_capabilities' => ['card_payments', 'transfers'],\n ]);\n\n $transfer = Transfer::create([\n 'amount' => 7000,\n 'currency' => 'usd',\n 'destination' => $account->id,\n 'transfer_group' => '{ORDER10}',\n ]);\n }", "function transfer($details,$fromAccount=true){\n\t\n\t// The sending account and the database:\n\tglobal $verifiedAccount,$dz;\n\t\n\tif(!isset($details['ToAddress'])){\n\t\t\n\t\t// Get an address for the username (inline updates details):\n\t\tgetAddress($details);\n\t\t\n\t}\n\t\n\t// Get the commodity:\n\t$commodity=$details['Commodity'];\n\t\n\t// The amount too:\n\t$amount=$details['Amount'];\n\t\n\t// Get the to address:\n\t$toAddress=$details['ToAddress'];\n\t\n\t// Is this an internal transfer? (I.e. within this same bank):\n\t$internalTransfer=(!$toAddress);\n\t\n\t$balance=null;\n\t\n\t// Is it coming from the bank itself, or from an account?\n\tif($fromAccount){\n\t\t\n\t\t// Find a suitable 'from' balance.\n\t\t// (There should only ever be one. Just in case though, we don't want to lock more than one row):\n\t\t$balance=$dz->get_row('select `ID` from `Bank.Account.Balances` where `Account`='.$verifiedAccount.' and `Commodity`=\"'.$commodity.'\" and `Amount`>='.$amount);\n\t\t\n\t\tif(!$balance){\n\t\t\t\n\t\t\t// Not enough funds in the right currency.\n\t\t\terror('account/nofunds');\n\t\t\t\n\t\t}\n\t\t\n\t\t// Lock the amount in that balance row.\n\t\t// If a locked amount is present at startup then a crash occured during a transaction.\n\t\t// If it's severe, the balances can be rebuilt from the transaction history.\n\t\t$locked=$dz->query(\n\t\t\t'update `Bank.Account.Balances` set `LockedAmount`=`LockedAmount`+'.$amount.\n\t\t\t',`Amount`=`Amount`-'.$amount.' where `ID`='.$balance['ID'].' and `Amount`>='.$amount\n\t\t);\n\t\t\n\t\t// Did we successfully lock?\n\t\tif(!$locked){\n\t\t\t\n\t\t\t// Not enough funds in the right currency.\n\t\t\terror('account/nofunds');\n\t\t\t\n\t\t}\n\t\t\n\t\t// Ok! We've locked the balance.\n\t\t\t\n\t\t// Create a transaction row:\n\t\t$dz->query(\n\t\t\t'insert into `Bank.Transactions`(`Account`,`Type`,`Reference`,`ItemInformation`,`Amount`,`Commodity`,`Username`,`Title`,`TimeAt`,`Name`) values('.\n\t\t\t$verifiedAccount.',2,\"'.escape($details['Reference'],false).'\",\"'.escape($details['ItemInformation'],false).'\",'.$amount.',\"'.$commodity.'\",\"'.$details['Username'].'\",\"'.escape($details['Title'],false).'\",'.time().',\"'.escape($details['Name'],false).'\")');\n\t\t\n\t}\n\t\n\tif($internalTransfer){\n\t\t\n\t\t// It's an internal transaction.\n\t\t// Name needs to be changed first (it's the name of the sender, which we don't know at this point):\n\t\t$details['Name']='';\n\t\t\n\t\t// Update the receiving account:\n\t\treceive($details);\n\t\t\n\t}else{\n\t\t\n\t\t// Interbank transfer.\n\t\t// Need to select some suitable balances to use to send with.\n\t\t// For now, we'll just assume that a single balance can be found that has enough in it:\n\t\t$balanceRow=$dz->get_row('select `Bank.Balances`.`Key`,`Bank.Balances`.`Private`,`Root.Balances`.`Balance` from `Bank.Balances` left join `Root.Balances` on `Root.Balances`.`Key`=`Bank.Balances`.`Key` where `Root.Balances`.`Commodity`=\"'.$commodity.'\" and `Root.Balances`.`Balance`>='.$amount);\n\t\t\n\t\tif(!$balanceRow){\n\t\t\t// This bank doesn't have a single balance with enough funds in it.\n\t\t\t// A more advanced implementation would combine multiple balances to ensure there's enough.\n\t\t\t// For now though, and to avoid making the consumer freak out, we'll just say the transaction amount is too high:\n\t\t\terror('amount/toohigh');\n\t\t}\n\t\t\n\t\t// Get the from address:\n\t\t$fromAddress=bin2hex($balanceRow['Key']);\n\t\t\n\t\t// Get the target group:\n\t\t$toGroup=$details['ToGroup'];\n\t\t\n\t\tif(strlen($toAddress)!=130){\n\t\t\t\n\t\t\t// It's binary.\n\t\t\t$toAddress=bin2hex($toAddress);\n\t\t\t\n\t\t}\n\t\t\n\t\t// Perform a global transfer now:\n\t\tglobalTransfer($fromAddress,$toAddress,$toGroup,$amount,$balanceRow['Balance'],$balanceRow['Private']);\n\t\t\n\t}\n\t\n\t// Success!\n\t\n\tif($balance){\n\t\n\t\t// Now unlock the amount in the sender:\n\t\t$dz->query(\n\t\t\t'update `Bank.Account.Balances` set `LockedAmount`=`LockedAmount`-'.$amount.\n\t\t\t' where ID='.$balance['ID']\n\t\t);\n\t\n\t}\n\t\n}", "function transfer_money(){\n\t\t$user_id=$_REQUEST['user_id'];\n\t\t$mobile=country_code.$_REQUEST['mobile_no'];\n\t\t$amount=$_REQUEST['amount'];\n\t\t$mobile_no=$_REQUEST['mobile_no'];\n\t \n\t\t\n\t\t//$transaction_id= mt_rand( 10000000, 99999999);\n\t\t$wallet_type_main=2;// amount debit in user self\n\t\t$wallet_type_frnd=1;// amount credit in frnd\n\t\t$wallet_category_to=5;// transfer money to\n\t\t$wallet_category_from=10;// transfer money from\n\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\tif(!empty($mobile)){\n\t\t\t$user_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif(!empty($user_records)){\n\t\t\t$main_wallet=$user_records['0']['wallet_amount'];\n\t\t\t$contact_number_main=substr($user_records['0']['user_contact_no'],4); // main user mobile number\n\t\t\tif($main_wallet>=$amount){\n\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t\tif(!empty($records)){\n\t\t\t\t$contact_number_frnd=substr($records['0']['user_contact_no'],4); // frnd mobile number\n\t\t\t\t$frnd_wallet=$records['0']['wallet_amount']; \n\t\t\t\t$frnd_id=$records['0']['user_id'];\n\t\t\t\tif($frnd_id !=$user_id){\n\t\t\t\t\t// amount transfer to another\n\t\t\t$transaction_id1= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t$w_to_desc=\"Amount transfer to \".$contact_number_frnd;\n\t\t\t\t\t\t$wallet_to_transfer = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_to . '\",\"' .$transaction_id1 . '\",\"' . $w_to_desc . '\",\"' . $contact_number_frnd . '\"');\n\t\t\t\t\t\tif(!empty($wallet_to_transfer)){\n\t\t\t\t\t\t\t//amount recieved by transfer\n\t\t\t\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t$w_by_desc=\"Amount transfer from \".$contact_number_main;\n\t\t\t\t\t\t$wallet_by_transfer = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $frnd_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_from . '\",\"' .$transaction_id . '\",\"' . $w_by_desc . '\",\"' . $contact_number_main . '\"');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!empty($wallet_by_transfer)){\n\t\t\t\t\t\t\t\t$main_wallet_money=$main_wallet-$amount;\n\t\t\t\t\t\t\t\t$frnd_wallet_money=$frnd_wallet+$amount;\n\t\t\t\t\t\t\t\t// update main user wallet\n\t\t\t\t\t\t\t\t$data['wallet_amount']=$main_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user_id, $data);\n\t\t\t\t\t\t\t\t// update frnd wallet//\n\t\t\t\t\t\t\t\t$data1['wallet_amount']=$frnd_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$frnd_id, $data1);\n\t\t\t\t\t\t\t\t\t$post=array('status'=>'true','message'=>'Transfer money successfully','main_user_id'=>$user_id,'main_wallet'=>$main_wallet_money,'frnd_wallet'=>$frnd_wallet_money,'frnd_id'=>$frnd_id,'transfer_mobile'=>$mobile_no,'transfer_amount'=>$amount,'transaction_id'=>$transaction_id1,'transfer_date'=>$current_date);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Error in transfering amount\");\n\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Please enter another user number\");\n\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"This user is not exist of given number\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Wallet amount is not sufficent to transfer money\");\n\t\t\t}\n\t\t\t}else{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"invalid user\",'user_id'=>$user_id);\n\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"missing parameter\",'user_id'=>$user_id,'amount'=>$amount,'mobile'=>$moble);\n\t\t}\necho $this -> json($post);\n\t}", "public function transfer($from_user_id, $to_user_id, $amount)\n {\n $dateNow = new Nette\\Utils\\DateTime();\n $amount = number_format($amount, 2, '.', '');\n $this->database->beginTransaction();\n // out\n $this->database->table(self::TRANSFERS_TABLE_NAME)->insert([\n 'from_user_id' => $from_user_id,\n 'to_user_id' => $to_user_id,\n 'type' => self::TRANSFER_TYPE_OUT,\n 'amount' => $amount,\n 'dt' => $dateNow\n ]);\n if ($from_user_id != 0) {\n $from_user = $this->database->table(self::USERS_TABLE_NAME)->get($from_user_id);\n // check rules\n if (\n ($from_user)\n && ($from_user->balance > 0)\n && ($from_user->balance >= $amount)\n ) {\n $this->database->table(self::USERS_TABLE_NAME)\n ->where('id', $from_user_id)\n ->update([\n 'balance' => $from_user->balance - $amount,\n ]);\n } else {\n $this->database->rollBack();\n return false;\n }\n }\n if ($to_user_id != 0) {\n // TODO: one query\n $to_user = $this->database->table(self::USERS_TABLE_NAME)->get($to_user_id);\n $this->database->table(self::USERS_TABLE_NAME)\n ->where('id', $to_user_id)\n ->update([\n 'balance' => $to_user->balance + $amount,\n ]);\n }\n $this->database->commit();\n return true;\n }", "public function processTransfer($fromAccount, $toAccount, $amount)\n {\n $dbTransaction = $this->db->beginTransaction();\n\n $transaction = new PaymentTransaction();\n $transaction->save();\n\n $debetPayment = new Payment();\n $debetPayment->transaction_id = $transaction->id;\n $debetPayment->account_id = $fromAccount->id;\n $debetPayment->type_id = PaymentType::DEBET;\n $debetPayment->amount = $amount;\n $debetPayment->save();\n\n $creditPayment = new Payment();\n $creditPayment->transaction_id = $transaction->id;\n $creditPayment->account_id = $toAccount->id;\n $creditPayment->type_id = PaymentType::CREDIT;\n $creditPayment->amount = $amount;\n $creditPayment->save();\n\n // perform addition via database because in application decimal values will be converted to float\n\n $this->db->createCommand()->update(\n $fromAccount->tableName(),\n ['amount' => new DbExpression('amount - :amount')],\n ['id' => $fromAccount->id],\n [':amount' => $amount]\n )->execute();\n\n $this->db->createCommand()->update(\n $toAccount->tableName(),\n ['amount' => new DbExpression('amount + :amount')],\n ['id' => $toAccount->id],\n [':amount' => $amount]\n )->execute();\n\n $fromAccount->refresh();\n $toAccount->refresh();\n\n $this->state_id = TransferState::ACCEPTED;\n $this->save();\n\n $dbTransaction->commit();\n }", "private function depositToWallet() {\n # there is not api_limited_quota/cashier_quota msg\n # transfer function has to return error_code and error_msg\n }", "public function submit_transfer(Request $request) {\n $receiver = User::where('account_number', $request->account)->first();\n $sender = User::where('id', Auth::id())->first();\n $txnId = 'TRF/'. date('ymd') . '/' .Str::upper(Str::random(10));\n $min = Config::get('minimum_transfer', 100);\n\n if ($sender->balance < $request->amount) {\n return redirect()->back()->with('fail', 'Insufficient balance to complete this transaction');\n }\n\n if ($min > $request->amount) {\n return redirect()->back()->with('fail', \"Minimum amount to transfer is equivalent of $$min\");\n }\n\n // Check for valid user\n if (!$receiver) {\n return redirect()->back()->with('fail', 'Please provide a valid user account number');\n }\n\n // Compare user currency type\n if ($receiver->account_type != $request->currency) {\n return redirect()->back()\n ->with('fail', \"Receiver's account does not support currency type: $request->currency\");\n }\n\n $receiverTxnData['account_name'] = $sender->fullName;\n $receiverTxnData['account_number'] = $sender->account_number;\n $receiverTxnData['txnId'] = $txnId;\n $receiverTxnData['type'] = 'Credit';\n $receiverTxnData['amount'] = $request->amount;\n $receiverTxnData['currency'] = $request->currency;\n $receiverTxnData['status'] = 'SUCCESSFUL';\n\n $senderTxnData['account_name'] = $receiver->fullName;\n $senderTxnData['account_number'] = $receiver->account_number;\n $senderTxnData['txnId'] = $txnId;\n $senderTxnData['type'] = 'Debit';\n $senderTxnData['amount'] = $request->amount;\n $senderTxnData['currency'] = $request->currency;\n $senderTxnData['status'] = 'SUCCESSFUL';\n\n DB::transaction(function () use ($receiver, $sender, $request, $receiverTxnData, $senderTxnData) {\n $sender->balance -= $request->amount;\n $sender->transactions()->create($senderTxnData);\n $sender->save();\n\n $receiver->balance += $request->amount;\n $receiver->transactions()->create($receiverTxnData);\n $receiver->save();\n });\n\n return redirect()->route('user.dashboard')->with('success', 'Transaction was successful');\n }", "function globalTransfer($fromAddress,$toAddress,$toGroup,$amount,$fromBalance,$private){\n\t\n\t// Request the root now:\n\tglobal $thisEntity;\n\t\n\t// Get the from group:\n\t$fromGroup=$thisEntity['Group'];\n\t\n\t// Build the signed data:\n\t$signed=$fromGroup.'/'.$fromAddress.'-'.$toGroup.'/'.$toAddress.'-'.$amount.'-'.$fromBalance;\n\t\n\t// Sign it:\n\t$signature=base64_encode( sign($signed,$private) );\n\t\n\t// Call the root API:\n\t$error;\n\t$response=callRoot(\n\t\t'transfer/create',\n\t\t'{\"from\":{\"address\":\"'.$fromAddress.'\",\"group\":'.$fromGroup.',\"balance\":'.$fromBalance.'},\"to\":{\"address\":\"'.$toAddress.'\",\"group\":'.$toGroup.'},\"amount\":'.$amount.',\"signature\":\"'.$signature.'\"}',\n\t\t$error\n\t);\n\t\n\tif($error){\n\t\t\n\t\t// Remote server generated an error:\n\t\terror('remote/error',$error);\n\t\t\n\t}\n\t\n\t// Success!\n\treturn true;\n\t\n}", "public function transfer_to(Request $request, $customer_sender_id)\n {\n\n $customer = DB::select('SELECT * FROM customers WHERE id = ?', [$customer_sender_id]);\n\n //\n $rules = [\n\t\t\t'amount' => 'required|numeric|max:'.$customer[0]->balance,\n\t\t\t'recipient_customer_id' => 'required|numeric'\n\t\t];\n\n\t\t$validator = Validator::make($request->all(), $rules);\n\t\tif ($validator->fails()) {\n\t\t\treturn redirect()->back()->withErrors($validator)->withInput();\n\t\t};\n\n\n\n\n\n // If it gets validated correcty\n $transaction_id = DB::insert('INSERT INTO `transfers` \n (`sender_id`, `receiver_id`, `amount`)\n VALUES \n (?, ?, ?)', [\n $customer_sender_id, $request->recipient_customer_id, $request->amount\n ]);\n\n // if the transaction is successful\n if ($transaction_id > 0) {\n // SENDER gets amount SUBSTRACTED\n DB::update('UPDATE `customers` \n SET\n `balance` = `balance`-?\n WHERE `id` = ?', [\n $request->amount,\n $customer_sender_id\n ]);\n\n // RECIPIENT gets amount ADDED\n DB::update('UPDATE `customers` \n SET\n `balance` = `balance`+?\n WHERE `id` = ?', [\n $request->amount,\n $request->recipient_customer_id\n ]);\n }\n\n return redirect()->back()->with('message', 'Transaction finished successfully');\n }", "public function transferAllByTransactionID($payment_address_uuid, $from, $to, $txid) {\n $body = [\n 'from' => $from,\n 'to' => $to,\n 'txid' => $txid,\n ];\n\n $result = $this->newAPIRequest('POST', '/accounts/transfer/'.$payment_address_uuid, $body);\n return $result;\n }", "public function createBetweenMyAccounts(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'method' => 'required|in:cour_epar,epar_cour,cour_devi_usd,devi_cour_usd,cour_devi_eur,devi_cour_eur',\n 'amount' => 'required|numeric|min:0'\n ]);\n if ($validator->fails()) {\n return response($validator->errors(), config('code.BAD_REQUEST'));\n }\n\n $amount = $request->input('amount');\n $method = $request->input('method');\n $hasEnoughMoney = false;\n $hasTheAccount = false;\n\n /**start transaction**/\n DB::beginTransaction();\n\n //todo check if he had this type of account\n\n try {\n\n $senderAccount = $this->client()->accounts()\n ->typeSender($method)->first();//todo check methode first()\n\n $receiverAccount = $this->client()->accounts()\n ->typeReceiver($method)->first();//todo check methode first()\n\n //check has the account\n if (is_null($receiverAccount)) throw new \\Exception;\n $hasTheAccount = true;\n\n //check the amount\n if (!$senderAccount->hasEnoughMoney($amount)) throw new \\Exception;\n $hasEnoughMoney = true;\n\n //create the transfer\n $mapMethodeToCommission = ['cour_epar' => 'COUR_EPART', 'epar_cour' => 'EPART_COUR',\n 'cour_devi_usd' => 'COUR_DEV', 'cour_devi_eur' => 'COUR_DEV',\n 'devi_cour_eur' => 'DEV_COUR', 'devi_cour_usd' => 'DEV_COUR'];\n $str = 'commission.' . $mapMethodeToCommission[$method];\n $commission = config('commission.' . $mapMethodeToCommission[$method]) * $amount;\n $now = \\Carbon\\Carbon::now();\n $nb = BalanceHistory::count();//todo fix this !all sol tested! re-migrate DB\n //sender history\n $mapMethodeToTransactionType = ['cour_epar' => 'vir_epar', 'epar_cour' => 'vir_cour',\n 'cour_devi_usd' => 'vir_devi', 'cour_devi_eur' => 'vir_devi',\n 'devi_cour_eur' => 'vir_cour', 'devi_cour_usd' => 'vir_cour'];\n BalanceHistory::create([\n 'id' => $nb + 1,\n 'amount' => $amount + $commission,//todo put it negative !!\n 'transaction_type' => $mapMethodeToTransactionType[$method],\n 'transaction_direction' => 'out',\n 'account_id' => $senderAccount->number,\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n\n\n //receiver history\n BalanceHistory::create([\n 'id' => $nb + 2,\n 'amount' => $amount,\n 'transaction_type' => $mapMethodeToTransactionType[$method],\n 'transaction_direction' => 'in',\n 'account_id' => $receiverAccount->number,\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n //change the amount of the destination client\n $receiverAccount->balance = $receiverAccount->balance + $amount;\n $receiverAccount->save();\n\n $mapMethodeToTransferType = ['cour_epar' => 'cour_epar', 'epar_cour' => 'epar_cour',\n 'cour_devi_usd' => 'cour_devi', 'cour_devi_eur' => 'cour_devi',\n 'devi_cour_eur' => 'devi_cour', 'devi_cour_usd' => 'devi_cour'];\n InternTransfer::create([\n 'code' => $senderAccount->number . $receiverAccount->number . $now->format('YmdHi'),\n 'amount' => $amount,\n 'transferDate' => $now->format('Y-m-d H:i:s'),\n 'creationDate' => $now->format('Y-m-d H:i:s'),\n 'status' => 'valide',\n 'transfers_type' => $mapMethodeToTransferType[$method],\n 'commission' => $commission,\n 'source_id' => $senderAccount->number,\n 'destination_id' => $receiverAccount->number,\n ]);\n\n //todo send commission to Tharwa account\n //we retrieve the amount from the sender account\n $senderAccount->balance = $senderAccount->balance - $commission - $amount;\n $senderAccount->save();\n\n\n// Mail::to($request->input('email'))\n// ->queue(new ClientRequestValidatedMail($acceptedClient->firstname.' '.$acceptedClient->lastname\n// , $request->input('code')));\n\n // all good\n /**commit - no problems **/\n DB::commit();\n return response([\"saved\" => true], config('code.CREATED'));\n\n } catch (\\Exception $e) {\n\n // something went wrong\n /**rollback every thing - problems **/\n DB::rollback();\n\n if (!$hasTheAccount)\n return response([\"account\" => false], config('code.NOT_FOUND'));\n\n if (!$hasEnoughMoney)\n return response([\"amount\" => false], config('code.NOT_FOUND'));\n\n return response([\"saved\" => false], config('code.UNKNOWN_ERROR'));\n }\n\n }", "public function transferToAccount(Request $request){\n\n //Validation of data\n $rules = [\n 'type_acc_sender' => 'required',\n 'type_acc_receiver'=>'required',\n 'montant_virement'=>'required',\n 'type'=>'required | integer | between:0,1'\n ];\n $data=$request->json()->all();\n $validator = Validator::make($data, $rules);\n if (!$validator->passes()) {\n dispatch(new LogJob('','', 'Input validation error',11,LogJob::FAILED_STATUS));\n return response()->json(['message' => $validator->errors()->all()], 400);\n }\n try{\n DB::beginTransaction();\n $currency = new CurrenciesController();\n $amount = $data['montant_virement'];\n $new_amount = $amount;\n\n //Get the id of the customer\n $id_customer = $request->user()->id;\n\n\n //sender and receiver account\n $account_sender = $this->accountService->findAccountByType($data['type_acc_sender'],$id_customer,0);\n $account_receiver = $this->accountService->findAccountByType($data['type_acc_receiver'],$id_customer,0);\n //if the receiver account dosen't exist\n if(is_null($account_receiver)){\n //log\n dispatch(new LogJob($account_sender->id_customer,null,'receiver not found',11,\n LogJob::FAILED_STATUS));\n return response(json_encode(['message'=>'receiver not found']),404);\n }\n //if the receiver account != current account\n if($data['type_acc_receiver'] == $data['type_acc_sender']) {\n //log\n dispatch(new LogJob($account_sender->id_customer, $account_receiver->id_customer, 'Transfer to the same account', 11,\n LogJob::FAILED_STATUS));\n return response(json_encode(['message' => 'Virement vers le meme compte ']), 400);\n }\n //if the amount is bigger than the sender balance\n if ($amount > $account_sender->balance) {\n //log\n dispatch(new LogJob($account_sender->id_customer, $account_receiver->id_customer, 'Transfer with insuffsant balance', 11,\n LogJob::FAILED_STATUS));\n return response(json_encode(['message' => 'balance insuffisant ']), 400);\n }\n\n\n // type currency dollar or euro\n if($data['type_acc_sender'] >= 3 || $data['type_acc_receiver'] >= 3 ){\n\n $new_amount = $currency->exchangeRate($amount,$account_sender->currency_code,$account_receiver->currency_code);\n }\n\n //Find the commission code\n $codeCommission = $this->codeCommission($data['type_acc_sender'], $data['type_acc_receiver']);\n\n\n $this->virementInterneService->create($codeCommission, 0, $amount,$new_amount, $account_sender, $account_receiver, $data['type']);\n\n\n DB::commit();\n $newBalance = $account_receiver->balance;\n // Send mail\n $customer = $request->user();\n $this->virementInterneService->sendVirementSameUserNotifMAil($customer->email,\n $account_sender->getCode(),$account_receiver->getCode(),\n $new_amount,$account_receiver->code_curr_receiver);\n\n return response(json_encode(['message' => 'transfer success', 'balance' => $newBalance]),201);\n } catch (\\Exception $e) {\n DB::rollback();\n //log information\n dispatch(new LogJob($account_sender->id_customer, $account_receiver->id_customer, $e->getMessage(), 11, LogJob::FAILED_STATUS));\n return response()->json(['message' => $e->getMessage()], 500);\n }\n }", "public function transferPayment()\n {\n $stripe = new \\Stripe\\StripeClient(env('STRIPE_SECRET_KEY'));\n /*$stripe->accounts->create([\n 'type' => 'custom',\n 'country' => 'US',\n 'email' => 'reena.sea1316@gmail.com',\n 'capabilities' => [\n 'card_payments' => ['requested' => true],\n 'transfers' => ['requested' => true],\n ],\n ]);*/\n /*$transfer = \\Stripe\\AccountLink::create([\n 'account' => 'acct_1IOcXgPGJtPprJfm',\n 'refresh_url' => 'https://example.com/reauth',\n 'return_url' => 'https://example.com/return',\n 'type' => 'account_onboarding',\n ]);*/\n $stripe->accounts->retrieve(\n 'acct_1IOcXgPGJtPprJfm',\n []\n );\n $stripe->accounts->retrieveCapability(\n 'acct_1GsXIYATE8vSaZpR',\n 'card_payments',\n []\n );\n\n dd($stripe->coreServiceFactory->services);\n }", "public function postTransfersMoney(TransfersMoneyRequest $request){\n\n if($request->transfer_wallet == $request->receive_wallet ){\n\n return redirect('wallets/getTransfersMoney')->with(['flash_level'=>'danger','flash_message'=>\"You can not transfer money in the same wallet !\"]);\n }\n\n //Get wallet data Transfers \n $amountTransfer = Wallets::select('amount')->where('id',$request->transfer_wallet)->get();\n\n $amountTran = $amountTransfer[0]->amount;\n\n if($amountTran < $request->amount || $amountTran == 0 ){\n\n return redirect('wallets/getTransfersMoney')->with(['flash_level'=>'danger','flash_message'=>\"The money in the wallet is not enough to transfer !\"]);\n }\n\n \n // insert Transfers Money\n $transfersMoney = new TransfersMoney;\n $transfersMoney ->transfer_wallet = $request->transfer_wallet;\n $transfersMoney ->receive_wallet = $request->receive_wallet;\n $transfersMoney ->amount = $request->amount;\n $transfersMoney ->user_id = Auth::user()->id;\n $transfersMoney ->save();\n\n DB::table('transactions')->insert([\n ['user_id' => Auth::user()->id, 'wallets_id' => $request->transfer_wallet,'amount'=> $request->amount,'type'=>1],\n ['user_id' => Auth::user()->id, 'wallets_id' => $request->receive_wallet,'amount'=> $request->amount,'type'=>2],\n ]);\n\n\n return redirect('wallets/getListTransfers')->with(['flash_level'=>'success','flash_message'=>'Transfer money successfully!!!']);\n }", "function transfer_eth($currency=\"\",$transdata){\r\n\r\n\r\n \t\t$bitcoin_row \t\t= get_cn_data($currency);\r\n\t\t\t$bitcoin_portnumber = insep_decode($bitcoin_row[\"port\"]);\r\n\t\t\t$bitcoin_ipaddress \t= insep_decode($bitcoin_row[\"ip\"]);\t\r\n\t\t\t $adminEthAddr \t\t= $this->get_currancy_address($currency);\t\t\t\r\n\t\t\r\n\r\n\t\t\t\r\n \t\t\t$amountdata=$transdata->row();\r\n \t\t$sendAmount=$amountdata->transfer_amount;\r\n \t\t$currencyToAddress=$amountdata->to_address;\r\n \t\t$key=trim($this->input->post(\"password\"));\r\n\r\n\t\t\t$data1 \t = array('port'=>$bitcoin_portnumber,'from'=>$adminEthAddr,'sendaddress'=>$currencyToAddress,'withdraw_amount'=>$sendAmount,'keyword' => '98543423','name'=>'bitcocyrus.com','key'=>$key,'method'=>'ethwithdraw');\r\n\t\t\t$output = connecteth('ethwithdraw',$data1);\r\n\r\n\t\t\r\n\t\t\t\t $txn_id \t= $output->result;\r\n\t\t\t\t\tif($output->type == 'success') {\r\n\t\t\t\t\t\tif($txn_id != '') {\r\n\t\t\t\t\t\t\treturn $txn_id;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$this->session->set_flashdata(\"error\",$output);\r\n\t\t\t\t\t\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\t\t\r\n\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t}else\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->session->set_flashdata(\"error\",$output);\r\n\t\t\t\t\t\t\t\tredirect(\"BoAdmin_Transation/withdraw\");\t\r\n\r\n\t\t\t}\r\n\r\n\t}", "public function fromAccountToAnother(Account $account)\n {\n $data = request()->only([\"to\", \"motivation\", \"amount\"]);\n\n $to = Account::where(\"id\", $data['to'])->firstOrFail();\n\n if(!$account->canPay($data['amount'])) throw new TransactionNotAllowed(\"Not enough funds\");\n try {\n Transaction::create([\n \"amount\" => $data['amount'],\n \"motivation\" => $data[\"motivation\"],\n \"account_to\" => $data['to'],\n \"account_from\" => $account->id,\n \"isCredit\" => true\n ]);\n } catch (\\Exception $exception) {\n throw $exception;\n }\n\n return response()->json(\"Transaction success\");\n }", "function deposit($amount) {\n $this->balance += $amount;\n }", "public function transferBalance($post)\n {\n $response = array();\n //Get user details By token\n $userData = $this->getUserModel()->getUserByToken($post['token']);\n \n $currentDate = $this->getAppService()->getDate();\n //Check Request\n if ($post['type'] == 'debit') {\n //Get Local user details By PhoneNo\n $localUserData = $this->getUserModel()->getLocalUserByPhoneNo($post['phoneNo']);\n \n if (count($localUserData)) {\n //check account status\n if ($localUserData['accountStatus'] == 'Active') {\n //check request Bal\n if (($localUserData['avaiPurchaseBal'] - $this->signupBal) >= $post['balance']) {\n //generate bal request code\n $transferCodeMatch = true;\n while ($transferCodeMatch == true) {\n \n $transferCode = rand('111111', '999999');\n $getUserInfo = $this->getUserModel()->passwordVerifyCodeExist($transferCode);\n if (count($getUserInfo) == 0) {\n $transferCodeMatch = false;\n }\n }\n try {\n //set transfer code\n $updateUserData = array (\n 'balReqCode' => $transferCode,\n 'balReq' => $post['balance']\n );\n $this->getUserModel()->updateUser($localUserData['Id'], $updateUserData);\n \n //set notification message\n $notificationData = array (\n 'reqFrom' => $userData['Id'],\n 'reqTo' => $localUserData['Id'],\n 'requestedName' => $userData['name'],\n 'message' => 'Reject chips : '.$post['balance'].'.Code :'.$transferCode,\n 'date' => $this->getAppService()->getDateTime()\n );\n $this->getNotificationModel()->createNotification($notificationData);\n \n $response['status'] = 'success';\n $response['message'] = 'Transfer code send successfully.';\n $response['bal'] = $userData['avaiTransBal'];\n \n } catch (\\Exception $e) {\n $response['status'] = 'error';\n $response['message'] = 'Something went wrong : Please try agaign.';\n }\n \n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User does not have efficient balance.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User account deactivated by Admin.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User not available.';\n }\n } else {\n //Get Local user details By PhoneNo\n $localUserData = $this->getUserModel()->getUserByPhoneNo($post['phoneNo']);\n //Transfer credit Balance\n if ($userData['avaiTransBal'] >= $post['balance']) {\n if (count($localUserData) > 0) {\n if ($localUserData['accountStatus'] == 'Active') {\n \n //START TRANSACTION\n $em = $this->getController()->getServiceLocator()->get('doctrine.entitymanager.orm_default');\n try {\n $em->getConnection()->beginTransaction();\n \n //check date records exist if not then create new if Yes then use Id\n $getTicketDate = $this->getTicketDateModel()->getTicketDate($userData['Id'],$currentDate);\n\n if (count($getTicketDate) == 0) {\n //create Date Records\n $dateData = array (\n 'userId' => $userData['Id'],\n 'drawDate' => $currentDate,\n 'openingBal' => $userData['avaiTransBal'],\n );\n\n $getDateEntity = $this->getTicketDateModel()->createTicketDate($dateData);\n $dateId = $getDateEntity->Id;\n } else {\n $dateId = $getTicketDate['Id'];\n }\n \n if ($localUserData['userRoll'] == 'local') {\n $localUser = array (\n 'avaiPurchaseBal' => $post['balance'],\n 'totalWinBal' => 0,\n );\n //Update Local user balance.\n $this->getUserModel()->updateUserBal($localUserData['Id'],$localUser);\n \n $notificationData = array (\n 'reqFrom' => $userData['Id'],\n 'reqTo' => $localUserData['Id'],\n 'requestedName' => $userData['name'],\n 'message' => 'Receive chips : '.$post['balance'],\n 'date' => $this->getAppService()->getDateTime()\n ); \n //set notification message\n $this->getNotificationModel()->createNotification($notificationData);\n } else {\n //check date records exist if not then create new if Yes then use Id\n $getLocalTicketDate = $this->getTicketDateModel()->getTicketDate($localUserData['Id'],$currentDate);\n \n if (count($getLocalTicketDate) == 0) {\n //create Date Records\n $dateData = array (\n 'userId' => $localUserData['Id'],\n 'drawDate' => $currentDate,\n 'openingBal' => $localUserData['avaiTransBal'],\n );\n\n $getLocalDateEntity = $this->getTicketDateModel()->createTicketDate($dateData);\n $localDateId = $getLocalDateEntity->Id;\n } else {\n $localDateId = $getLocalTicketDate['Id'];\n }\n $localUser = array (\n 'avaiTransBal' => $localUserData['avaiTransBal'] + $post['balance'],\n );\n //Update Local user balance.\n $this->getUserModel()->updateUser($localUserData['Id'],$localUser);\n \n $transactionData = array (\n 'dateId' => $localDateId,\n 'userId' => $userData['Id'],\n 'agentId' => $localUserData['Id'],\n 'transBalance' => $post['balance'],\n 'transType' => 'Debit',\n 'time' => $this->getAppService()->getTime()\n );\n //create Transaction report\n $this->getTransactionModel()->createTransaction($transactionData);\n }\n \n $agentUser = array (\n 'avaiTransBal' => $userData['avaiTransBal'] - $post['balance'],\n );\n //Update Agent user balance.\n $this->getUserModel()->updateUser($userData['Id'],$agentUser);\n \n $transactionData = array (\n 'dateId' => $dateId,\n 'userId' => $localUserData['Id'],\n 'agentId' => $userData['Id'],\n 'transBalance' => $post['balance'],\n 'transType' => 'Credit',\n 'time' => $this->getAppService()->getTime()\n );\n //create Transaction report\n $this->getTransactionModel()->createTransaction($transactionData);\n \n $response['status'] = 'success';\n $response['message'] = 'Chips transfer successfully.';\n $response['bal'] = $userData['avaiTransBal'] - $post['balance'];\n\n $em->getConnection()->commit();\n } catch (\\Exception $e) {\n $em->getConnection()->rollback();\n $response['status'] = 'error';\n $response['message'] = $e->getMessage();//'Internal Error. Please try agaign.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User account deactivated by Admin.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User not available.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = 'you do have not efficient balance.';\n }\n }\n return $response;\n }", "function process_transfer($from_id, $to_id) {\n\t\tglobal $wpdb;\n\t\t$wpdb->query($wpdb->prepare(\"UPDATE {$wpdb->base_prefix}pro_sites_stripe_customers SET blog_id = %d WHERE blog_id = %d\", $to_id, $from_id) );\t\n\t}", "public function transfer()\n {\n $transfer = oxNew('tc_cleverreach_transfer');\n\n $complete = (boolean)oxRegistry::getConfig()->getRequestParameter('full');\n $offset = (int)oxRegistry::getConfig()->getRequestParameter('offset');\n\n $transfer->setOffset($offset);\n\n try {\n list($count, $transferResult) = $transfer->run($this->getTimer(), $complete);\n } catch (tc_group_not_found_exception $e) {\n $this->error = $e->getMessage();\n $this->_aViewData['blShowListResetPopUp'] = true;\n\n return;\n } catch (\\Exception $e) {\n $this->error = $e->getMessage();\n\n return;\n }\n\n if (is_array($transferResult) === true && (count($transferResult) === 0 || $transferResult[0] === false)) {\n $this->metaRefreshValues['end'] = true;\n // Transfer fertig\n $this->transferComplete();\n\n return;\n }\n\n // Daten sind fehlerhaft\n if ($transferResult === false) {\n $lang = oxRegistry::getLang();\n $msg = $lang->translateString('TC_CLEVERREACH_ERROR_NO_KEY');\n $this->tcError = $msg;\n\n return false;\n\n // Alle Daten übertragen\n } elseif ($transferResult === true) {\n $this->metaRefreshValues['end'] = true;\n // Transfer fertig\n $this->transferComplete();\n\n return;\n // Anzeige ? Nutzer|Bestellungen\n } elseif (is_array($transferResult) === true) {\n $transferType = 'user';\n $iReceiver = $count;\n\n // add full flag, to check for full list export\n $full = (int)oxRegistry::getConfig()->getRequestParameter('full');\n $this->metaRefreshValues['full'] = $full;\n $this->metaRefreshValues['function'] = 'transfer';\n $this->metaRefreshValues['transfer'] = $transferType;\n $this->metaRefreshValues['iReceiver'] = $iReceiver;\n $this->metaRefreshValues['refresh'] = 0;\n $this->metaRefreshValues['offset'] = $this->getTimer() + (int)oxRegistry::getConfig()->getRequestParameter('offset');\n }\n }", "function moneyDistribution($money, $source_id, $destin_id, $payment_type, $pdo_bank, $pdo) {\n $credit_card=$source_id;\n\t\t//buying item\n if($payment_type==0) {\n //debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n }\n //advertising\n elseif ($payment_type==1){\n //debt seller\n //get seller's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from seller account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n \n //cerdit shola\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola account the money debted from seller account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n }\n //auction entrance\n elseif ($payment_type==2){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //auction victory\n elseif ($payment_type==3){\n //debt bidder\n //subtracting entrance fee from total item price\n $entrance_fee=100;\n $money=$money-$entrance_fee;\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n }\n //automatic auction entrance\n elseif ($payment_type==4){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //refund(return item)\n elseif($payment_type==5){\n //credit buyer\n //get buyer's account number using credit_card from given parameter\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $buyer_account = $stmt->fetchAll();\n //add money into buyer's account using account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$buyer_account[0][\"account_number\"]]);\n\n //debt seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //subtract from seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n $money=$money-$price;\n //debt shola\n //get shola account number\n $shola_account_number=1000548726;\n //subtract from shola account the money credited for buyer account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n\t\t}\n\t\t//if it is split payment\n\t\telseif($payment_type==6){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t\t//if resolveing debt\n\t\telseif($payment_type==7){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n\t\t\t\t$interest=interestRate($destin_id);\n $shola_cut=($money+($money*$interest))*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\t\t\t\t\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" =>$money , \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t}", "public function store(Request $request)\r\n {\r\n clock($request->all());\r\n\r\n $rules = array(\r\n 'date' => 'required',\r\n 'fromAccountId' => 'required',\r\n 'toAccountId' => 'required',\r\n 'amount' => 'required',\r\n 'description' => 'required',\r\n 'method' => 'required',\r\n /* 'ref' => 'required',\r\n 'person' => 'required',*/\r\n );\r\n\r\n $validator = Validator::make($request->all(), $rules);\r\n if ($validator->fails()) {\r\n\r\n toast('Rectify errors and re-submit!','error','top-right')->autoclose(3500);\r\n\r\n return Redirect::to('transfers/create')\r\n ->withErrors($validator)\r\n ->withInput($request->input());\r\n\r\n } else {\r\n\r\n $transferData = $request->all();\r\n\r\n $transfer = Transfer::create($transferData);\r\n $transfer->save();\r\n\r\n $fromaccount = Account::find($request->fromAccountId);\r\n $fromaccount->balance = $fromaccount->balance-$request->amount;\r\n $fromaccount->save();\r\n\r\n $toaccount = Account::find($request->toAccountId);\r\n $toaccount->balance = $toaccount->balance+$request->amount;\r\n $toaccount->save();\r\n\r\n $transactionData['payerid'] = $request->fromAccountId;\r\n $transactionData['payeeid'] = $request->toAccountId;\r\n $transactionData['type'] = 'Transfer';\r\n $transactionData['amount'] = $request->amount;\r\n $transactionData['description'] = $request->description;\r\n $transactionData['date'] = $request->date;\r\n\r\n $transactionData['account'] = $transfer->fromaccounts->accountName;\r\n $transactionData['dr'] = $request->amount;\r\n $transactionData['cr'] = 0;\r\n $transactionData['bal'] = $fromaccount->balance;\r\n $transfer1 = Transaction::create($transactionData);\r\n \r\n $transactionData['account'] = $transfer->toaccounts->accountName;\r\n $transactionData['cr'] = $request->amount;\r\n $transactionData['dr'] = 0;\r\n $transactionData['bal'] = $toaccount->balance; \r\n\r\n $transfer2 = Transaction::create($transactionData);\r\n\r\n toast('Transfer Created Successfully!','success','top-right')->autoclose(3500);\r\n return Redirect::to('transfers/');\r\n }\r\n }", "function applyWallet($Adv,$amount,$lastrate,$transferAmount){ \r\n\t$wallet = Wallet::get(array(\"id_user\" => $_SESSION[\"gak_id\"]));\r\n\t$totalToman = $amount*$lastrate + $lastrate*$transferAmount;\r\n\tif ($wallet->amount < $totalToman){\r\n\t\t$_SESSION['result']=\" موجودی کیف پول شما از مبلغ درخواست کمتر است. \";\r\n\t\t$_SESSION['alert']=\"warning\";\r\n\t\theader(\"location: /dinero/deal?amount=\".$_GET['amount'].\"&id=\".$_GET['id'].\"&balance=low\");\r\n\t}else{\r\n\t\t//update wallet and add transaction\r\n\t\t//insert\r\n\t\t$insert_wallettransaction=array(\r\n\t\t\t\t\"id_wallet\" => $wallet->id,\r\n\t\t\t\t\"type\" => \"withdraw\",\r\n\t\t\t\t\"amount\" => $totalToman,\r\n\t\t\t\t\"status\" => \"confirm\",\r\n\t\t\t\t\"time\" => date(\"Y-m-d H:i:s\")\r\n\t\t);\r\n\t\t$walletTransaction = Wallettransactions::insert($insert_wallettransaction);\r\n\t\t//update\r\n\t\t$arr_update=array(\r\n\t\t\t\t\"id\" => $wallet->id,\r\n\t\t\t\t\"amount\" => $wallet->amount - $totalToman\r\n\t\t);\r\n\t\tWallet::update($arr_update);\r\n\t\t//log\r\n\t\tAccountkitlog::insert(array(\"iduser\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"date\" => date(\"Y-m-d H:i:s\"), \"title\" => \"walletWithdraw\"));\r\n\t\t//trade\r\n\t\t\r\n\t\t$arr_insert=array(\r\n\t\t\t\t\"id_buyer\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"id_seller\" => $Adv->id_user,\r\n\t\t\t\t\"id_adv\" => $Adv->id,\r\n\t\t\t\t\"amount\" => $amount,\r\n\t\t\t\t\"exchange_rate\" => $lastrate,\r\n\t\t\t\t\"time\" => date(\"Y-m-d H:i:s\"),\r\n\t\t\t\t\"trade_status\" => \"buyerpaid\",\r\n\t\t\t\t\"buyerpay_status\" => \"confirm\",\r\n\t\t\t\t\"sellerpay_status\" => \"pending\",\r\n\t\t\t\t\"buyerpay_details\" => \"id:\".$walletTransaction.\"|Payment:Wallet|refID:\".date(\"YmdHis\"),\r\n\t\t\t\t\"sellerpay_details\" => \"\"\r\n\t\t);\r\n\t\t$Trade = Dinerotrade::insert($arr_insert);\r\n\t\t\r\n\t\t//update text transaction wallet\r\n\t\tWallettransactions::update(array(\"id\"=>$walletTransaction, \"text\"=>\"Withdraw from wallet, Trade #\".$Trade*951753 ));\r\n\t\t\r\n\t\t//update adv\r\n\t\t$updateAmount = $Adv->amount - $amount;\r\n\t\t$arr_update=array(\r\n\t\t\t\t\"id\" => $Adv->id,\r\n\t\t\t\t\"amount\" => $updateAmount\r\n\t\t);\r\n\t\tDineroadv::update($arr_update);\r\n\t\t\r\n\t\t//user logs\r\n\t\tAccountkitlog::insert(array(\r\n\t\t\t\t\"iduser\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"date\" => date(\"Y-m-d H:i:s\"),\r\n\t\t\t\t\"title\" => \"tradePaid\"));\r\n\t\t\t\r\n\t\t//send emails and sms\r\n\t\t$checkTrade=Dinerotrade::get(array(\"id\" => $Trade,\"id_buyer\" => $_SESSION[\"gak_id\"]));\r\n\t\t$seller = AccountKit::get(array(\"id\" => $checkTrade->id_seller));\r\n\t\t$buyer = AccountKit::get(array(\"id\" => $checkTrade->id_buyer));\r\n\t\t$sellerFullname = Acountkitparam::get(array(\"iduser\" => $checkTrade->id_seller, \"type\" => \"fullname\"));\r\n\t\t$buyerFullname = Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"fullname\"));\r\n\t\t$buyerBankname= Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"bankname\"));\r\n\t\t$buyerIban= Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"iban\"));\r\n\t\t$transferAmount = findTransferAmount($checkTrade->amount);\r\n\t\t$token = $GLOBALS['GCMS_SETTING']['dinero']['smstoken'];\r\n\t\t$params = array(\r\n\t\t\t\t'to' => $seller->number,\r\n\t\t\t\t'from' => 'Info',\r\n\t\t\t\t'message' => \"Trade for \".$checkTrade->amount .\"€ \"\r\n\t\t\t\t.\"https://24dinero.com/\"\r\n\t\t\t\t,\r\n\t\t);\r\n\t\t//sms_send($params,$token);\r\n\t\t\r\n\t\t//start send email\r\n\t\t$bodyStatusDineroSeller= '\r\n\t\t\t\t\t\t<div>\r\n <a href=\"#\"\r\n style=\"background-color:#D84A38;padding:10px;color:#ffffff;display:inline-block;font-family:tahoma;font-size:13px;font-weight:bold;line-height:33px;text-align:center;text-decoration:none;-webkit-text-size-adjust:none;\">\r\n\t\t\t\t\t\t\t\tدرخواست انتقال یورو، لطفا سریعا اقدام کنید\r\n\t\t\t\t\t\t\t </a>\r\n </div>\r\n\t\t\t\t\t';\r\n\t\t\r\n\t\t$bodyInfoSeller= \"\r\n\t\t\t\t <div>\r\n\t\t\t\t\r\nPayment has confirmed for your advertisements on 24dinero.com.\r\n <br>\r\nTransfer amount:\".$checkTrade->amount .\"€ <br>\r\nBank: \".$buyerBankname->text.\"<br>\r\nBeneficiary Name: \".$buyerFullname->text.\"<br>\r\nIBAN: \".$buyerIban->text.\"<br>\r\n\t\t\r\nYou can confirm or cancel the transaction on the following link: <br>\r\n\t\t\r\n<a href=\\\"https://\".$_SERVER['HTTP_HOST'].\"/dinero/transact/\".$checkTrade->id.\"\\\">\r\n\t\t\t\t\t\thttps://\".$_SERVER['HTTP_HOST'].\"/dinero/transact/\".$checkTrade->id.\"\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\r\n </div>\r\n\t\t\t\t\t\";\r\n\t\t$bodyTransactionSeller= '\r\n\t\t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" class=\"w320\" style=\"height:100%;\">\r\n <tr>\r\n <td valign=\"top\" class=\"mobile-padding\" style=\"padding:20px;\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro request</b>\r\n </td>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro Rate</b>\r\n </td>\r\n <td>\r\n <b>Total Toman</b>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n '.number_format($checkTrade->amount).'\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($checkTrade->exchange_rate*$checkTrade->amount).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n\t\t\t\t\t\t'.number_format(floor($checkTrade->amount*2.5/100)).' <br>\r\n ٪2.5 Commission\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format((floor($checkTrade->amount*2.5/100)) * $checkTrade->exchange_rate).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n \t\t\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n Total amount:\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n <b>'.number_format($checkTrade->exchange_rate*$checkTrade->amount+ (floor($checkTrade->amount*2.5/100)) * $checkTrade->exchange_rate).'</b>\r\n </td>\r\n </tr>\r\n </table>\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-top:35px;\">\r\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n <tr>\r\n \t\t\r\n <td style=\"padding:0px 0 15px 30px;\" class=\"mobile-block\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n \t\t\r\n <tr>\r\n <td>Euro Request: </td>\r\n <td> €'.number_format($checkTrade->amount).'</td>\r\n </tr>\r\n \t\t\r\n <tr>\r\n <td>Due by: </td>\r\n <td> '.date(\"Y-m-d\").'</td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \t\t\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n\t\t\t\t\t';\r\n\t\t$bodyStatusDineroBuyer= '\r\n\t\t\t\t\t\t<div>\r\n <a href=\"#\"\r\n style=\"background-color:#016910;padding:10px;color:#ffffff;display:inline-block;font-family:tahoma;font-size:13px;font-weight:bold;line-height:33px;text-align:center;text-decoration:none;-webkit-text-size-adjust:none;\">\r\n\t\t\t\t\t\t\t\tدرخواست انتقال یورو\r\n\t\t\t\t\t\t\t </a>\r\n </div>\r\n\t\t\t\t\t';\r\n\t\t\r\n\t\t$bodyInfoBuyer= \"\r\n\t\t\t\t <div>\r\n\t\t\t\t\r\nPayment has confirmed for your trade on 24dinero.com.\r\n <br>\r\nTransfer amount:\".$checkTrade->amount .\"€ <br>\r\nBank: \".$buyerBankname->text.\"<br>\r\nBeneficiary Name: \".$buyerFullname->text.\"<br>\r\nIBAN: \".$buyerIban->text.\"<br>\r\n\t\t\r\nYou can follow the transaction on the following link: <br>\r\n\t\t\r\n<a href=\\\"https://\".$_SERVER['HTTP_HOST'].\"/dinero/trade/\".$checkTrade->id.\"\\\">\r\n\t\t\t\t\t\thttps://\".$_SERVER['HTTP_HOST'].\"/dinero/trade/\".$checkTrade->id.\"\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\r\n </div>\r\n\t\t\t\t\t\";\r\n\t\t$bodyTransactionBuyer= '\r\n\t\t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" class=\"w320\" style=\"height:100%;\">\r\n <tr>\r\n <td valign=\"top\" class=\"mobile-padding\" style=\"padding:20px;\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro request</b>\r\n </td>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro Rate</b>\r\n </td>\r\n <td>\r\n <b>Total Toman</b>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n '.number_format($checkTrade->amount).'\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($checkTrade->exchange_rate*$checkTrade->amount).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n\t\t\t\t\t\t'.number_format($transferAmount).' <br>\r\n Transfer Amount\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($transferAmount* $checkTrade->exchange_rate).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n \t\t\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n Total amount:\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n <b>'.number_format($checkTrade->exchange_rate*$checkTrade->amount+ $transferAmount* $checkTrade->exchange_rate).'</b>\r\n </td>\r\n </tr>\r\n </table>\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-top:35px;\">\r\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n <tr>\r\n \t\t\r\n <td style=\"padding:0px 0 15px 30px;\" class=\"mobile-block\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n \t\t\r\n <tr>\r\n <td>Euro Request: </td>\r\n <td> €'.number_format($checkTrade->amount).'</td>\r\n </tr>\r\n \t\t\r\n <tr>\r\n <td>Due by: </td>\r\n <td> '.date(\"Y-m-d\").'</td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \t\t\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n\t\t\t\t\t';\r\n\t\t//sendingblue email\r\n\t\trequire_once(__COREROOT__.\"/module/dinero/libs/Mailin.php\");\r\n\t\trequire_once(__COREROOT__.\"/module/dinero/controller/emailTemplate.php\");\r\n\t\t$mailin = new Mailin('https://api.sendinblue.com/v2.0',$GLOBALS['GCMS_SETTING']['dinero']['sendinblueAPIKey']);\r\n\t\t//seller\r\n\t\t$maildata = array( \"to\" => array($seller->email=> $sellerFullname->text),\r\n\t\t\t\t\"from\" => array($GLOBALS['GCMS_SETTING']['dinero']['sendinblueSenderEmail']),\r\n\t\t\t\t\"subject\" => \"Trade Paid \".$_SERVER['HTTP_HOST'],\r\n\t\t\t\t\"html\" => emailTemp($bodyStatusDineroSeller,$bodyInfoSeller,$bodyTransactionSeller),\r\n\t\t\t\t\"headers\" => array(\"Content-Type\"=> \"text/html; charset=iso-8859-1\",\"X-param1\"=> \"value1\", \"X-param2\"=> \"value2\",\"X-Mailin-custom\"=>\"my custom value\", \"X-Mailin-IP\"=> \"102.102.1.2\", \"X-Mailin-Tag\" => \"My tag\")\r\n\t\t);\r\n\t\t$mailin->send_email($maildata);\r\n\t\t//buyer\r\n\t\t$maildata = array( \"to\" => array($buyer->email=> $buyerFullname->text),\r\n\t\t\t\t\"from\" => array($GLOBALS['GCMS_SETTING']['dinero']['sendinblueSenderEmail']),\r\n\t\t\t\t\"subject\" => \"Trade Paid \".$_SERVER['HTTP_HOST'],\r\n\t\t\t\t\"html\" => emailTemp($bodyStatusDineroBuyer,$bodyInfoBuyer,$bodyTransactionBuyer),\r\n\t\t\t\t\"headers\" => array(\"Content-Type\"=> \"text/html; charset=iso-8859-1\",\"X-param1\"=> \"value1\", \"X-param2\"=> \"value2\",\"X-Mailin-custom\"=>\"my custom value\", \"X-Mailin-IP\"=> \"102.102.1.2\", \"X-Mailin-Tag\" => \"My tag\")\r\n\t\t);\r\n\t\t$mailin->send_email($maildata);\r\n\t\t//\\\\\\\\\\end send email\r\n\t\t\r\n\t\t$_SESSION['result']=\"پرداخت شما با موفقیت انجام شد\";\r\n\t\t$_SESSION['alert']=\"success\";\r\n\t\theader(\"location: /dinero/trade/\".$Trade);\r\n\t\t\r\n\t}\r\n\t\r\n}", "public function withdrawImpl($db, $amount){\n $stmt = $db->query(\"SELECT balance FROM account where id = \".$this->id);\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $balance = $row['balance'];\n $need = $amount - $balance;\n if($need > 0){\n // Get all the other accounts that are owned by the owners of this\n // account\n $sql = \"SELECT DISTINCT(account_id) FROM account JOIN account_owner ON account_id = account_owner.account_id WHERE id <> $id AND (\";\n $first = true;\n foreach($this->getOwners() as $owner){\n if(!$first){\n $ccl.=\" OR \";\n }\n $first = false;\n $ccl .= \"owner = \".$owner->getId();\n }\n $ccl .= \")\";\n $stmt = $db->query($sql);\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n foreach($results as $row){\n if($need <= 0){\n break;\n }\n $toTransfer = $otherBalance > $need ? $need : $otherBalance;\n if($toTransfer > 0 ){\n $other = $row['account_id'];\n $stmt = $db->query(\"SELECT balance FROM account WHERE id = $other\");\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $otherBalance = $row['balance'];\n $otherBalance -= $toTransfer;\n $balance += $toTransfer;\n $db->exec(\"UPDATE account SET balance = $otherBalance WHERE id = $other\");\n $db->exec(\"UPDATE account SET balance = $balance WHERE id = \".$this->id);\n $db->exec(\"INSERT INTO account_charge (account_id, charge) VALUES ($other, \\\"transfer $toTransfer to account \".$this->id.\"\\\")\");\n $need -= $toTransfer;\n }\n }\n if($need > 0){\n return false;\n }\n }\n $db->exec(\"UPDATE account set balance = \".$balance - $amount.\" WHERE id = \".$this->id);\n return true;\n }", "public function transfer($oldId, $newId);", "public function actionCreate()\n {\n $model = new Transfer();\n $modelTransaction = new Transactions();\n $modelPerson = Person::find()->where(['userid'=>Yii::$app->user->identity->id])->one();\n $modelErr = ErrorMsg::find()->where(['userid'=>Yii::$app->user->identity->id])->one();\n if(!empty($modelErr) || $modelErr !== NULL){\n $message = $modelErr->message;\n } else {\n $message = 'Sorry! You have exceeded the maximum transfer limit your account was configured for per month.For further enquiries on how to activate your transfer access,please contact email: accountservices@trado.com.'\n }\n\n if (Yii::$app->request->post('accountName')) {\n $model->userid = Yii::$app->user->identity->id;\n $model->amount = Yii::$app->request->post('amount');\n $model->name = Yii::$app->request->post('accountName');\n $model->bank = Yii::$app->request->post('bankName');\n $model->accountNumber = Yii::$app->request->post('accountNumber');\n $model->routingNumber = Yii::$app->request->post('swift');\n $model->country = Yii::$app->request->post('country');\n $model->message = Yii::$app->request->post('q6_notes');\n \n if($model->save()){\n $modelTransaction->userid = Yii::$app->user->identity->id;\n $modelTransaction->transactionType = 0;\n $modelTransaction->transactionId = $model->id;\n $modelTransaction->name = $model->name;\n $modelTransaction->amount = $model->amount;\n $modelTransaction->save();\n return $model->id;\n }\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n 'transferStatus' => $modelPerson->transferStatus,\n 'balance' => $modelPerson->balance,\n 'message' => $modelErr->message,\n ]);\n }\n \n public function actionTransferBy()\n {\n $model = new TransferBy();\n\n if (Yii::$app->request->post('transferId')) {\n $model->userid = Yii::$app->user->identity->id;\n $model->firstname = Yii::$app->request->post('firstname');\n $model->lastname = Yii::$app->request->post('lastname');\n $model->email = Yii::$app->request->post('senderEmail');\n $model->telephone = Yii::$app->request->post('telephone');\n $model->address = Yii::$app->request->post('address');\n $model->transferId = Yii::$app->request->post('transferId');\n $model->save();\n return $model->id;\n }\n }\n \n public function actionMail()\n {\n $otpVal = $this->generateNumericOTP(4);\n $otp = new Otp();\n $otp->userid = Yii::$app->user->identity->id;\n $otp->otp = $otpVal;\n if($otp->save()){\n $otp->sendEmail($otpVal, Yii::$app->request->post('email'));\n return $otpVal; \n }\n \n }\n \n public function actionFinishmail()\n {\n \n \n }\n \n public function actionComplete()\n {\n $model = Person::find()->where(['userid'=>Yii::$app->user->identity->id])->one();\n $accountName = Yii::$app->request->post('accountName');\n $accountNumber = Yii::$app->request->post('accountNumber');\n $bankName = Yii::$app->request->post('bankName');\n $swift = Yii::$app->request->post('swift');\n $country = Yii::$app->request->post('country');\n $transferAmount = Yii::$app->request->post('amount');\n $transferby = Yii::$app->request->post('email');\n $newBal = $model->balance - (int)$transferAmount;\n $model->balance = $newBal;\n if($model->save()){\n $message = Yii::$app->mailer->compose( ['html' => 'finish-mail'],\n [\n 'balance' => $model->balance,\n 'amount' => $transferAmount,\n 'accountName' => $accountName,\n 'accountNumber' => $accountNumber,\n 'bankName' => $bankName,\n 'swift' => $swift,\n 'country' => $country,\n 'name' => $model->firstname\n ]);\n $message->getSwiftMessage()->getHeaders()->addTextHeader('name', 'value');\n $message->setFrom(['support@rockettrade.org' => 'Rocket Trade']);\n $message->setTo($transferby);\n $message->setSubject('Successfull wire transfer');\n $message->send();\n return $this->renderAjax('complete');\n }\n \n \n }\n \n public function actionValidate()\n {\n $otpVal = Yii::$app->request->post('value');\n $otps = Otp::find()->where(['userid'=>Yii::$app->user->identity->id, 'status'=>0])->all();\n $true = 0;\n foreach($otps as $otp){\n if($otp->otp == (int)$otpVal){\n $otp->status = 1;\n $otp->save();\n $true = 1; //true\n }\n }\n \n return $true;\n \n }\n \n public function generateNumericOTP($n) { \n \n // Take a generator string which consist of \n // all numeric digits \n $generator = \"1357902468\"; \n \n // Iterate for n-times and pick a single character \n // from generator and append it to $result \n \n // Login for generating a random character from generator \n // ---generate a random number \n // ---take modulus of same with length of generator (say i) \n // ---append the character at place (i) from generator to result \n \n $result = \"\"; \n \n for ($i = 1; $i <= $n; $i++) { \n $result .= substr($generator, (rand()%(strlen($generator))), 1); \n } \n \n // Return result \n return $result; \n } \n \n /**\n * Updates an existing Transfer model.\n * If update is successful, the browser will be redirected to the 'view' page.\n * @param integer $id\n * @return mixed\n * @throws NotFoundHttpException if the model cannot be found\n */\n public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n\n /**\n * Deletes an existing Transfer model.\n * If deletion is successful, the browser will be redirected to the 'index' page.\n * @param integer $id\n * @return mixed\n * @throws NotFoundHttpException if the model cannot be found\n */\n public function actionDelete($id)\n {\n $this->findModel($id)->delete();\n\n return $this->redirect(['index']);\n }\n\n /**\n * Finds the Transfer model based on its primary key value.\n * If the model is not found, a 404 HTTP exception will be thrown.\n * @param integer $id\n * @return Transfer the loaded model\n * @throws NotFoundHttpException if the model cannot be found\n */\n protected function findModel($id)\n {\n if (($model = Transfer::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n}", "public function UpdateAccountBalances () \r\n {\r\n $table = \"BALANCE\";\r\n $query = \"DROP TABLE IF EXISTS ${table}\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't remove old ${table} table\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"CREATE TEMPORARY TABLE ${table} SELECT ReceiptID AS AccountID, SUM(Total) As Receipts, (0) AS Payments FROM Transaction GROUP BY ReceiptID ORDER BY ReceiptID\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't compute ${table} table Receipts\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"INSERT INTO ${table} SELECT PaymentID AS AccountID, (0) AS Receipts, SUM(Total) AS Payments FROM Transaction GROUP BY PaymentID ORDER BY PaymentID\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't compute ${table} table Payments\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"UPDATE Account SET Receipts=(0.00), Payments=(0.00), Balance=(0.00)\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't clear Account table balances\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"UPDATE Account INNER JOIN ${table} ON ID=AccountID SET Account.Receipts=${table}.Receipts\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't update Account table Receipts\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"UPDATE Account INNER JOIN ${table} ON ID=AccountID SET Account.Payments=${table}.Payments\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't update Account table Payments\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n $query = \"DROP TABLE IF EXISTS ${table}\";\r\n Balance::Event ($query, \"\");\r\n if (!mysql_query($query, self::$db)) \r\n {\r\n Balance::Error (\"Can't remove new ${table} table\", mysql_error(self::$db));\r\n return (false);\r\n }\r\n return (true);\r\n }", "function deposit($connection,$amount,$accno){\r\n try {\r\n $connection->beginTransaction();\r\n\r\n $accno = $_SESSION['accno'];\r\n $sql = \"UPDATE _accounts SET balance= :balance WHERE accno = :account\";\r\n $statement = $connection->prepare($sql);\r\n\r\n\r\n $final_bal = $amount + Services::getforAccountsBalance($connection,$accno);\r\n //do not deposit to self\r\n if($accno ==$_SESSION['accno']){\r\n return false;\r\n };\r\n //update balance\r\n $statement->execute(array(':balance' => $final_bal,':account'=>$accno));\r\n\r\n if($statement->rowCount()<1){\r\n return false;\r\n }\r\n //update transaction history\r\n $insert_sql = \"INSERT INTO _transactionshistory (accno,date,debit,credit,\r\n balance) VALUES(:accno,:date,:debit,:credit,:balance)\";\r\n $stmt = $connection->prepare($insert_sql);\r\n $stmt->execute(array(':accno'=>$accno,':date'=>date(\"Y/m/d\"),':debit'=>0,':credit'=>$amount,':balance'=>$final_bal));\r\n //$stmt = $connection->prepare($insert_sql);\r\n // if($stmt->rowCount()<1){\r\n // echo \"Insert failed\";\r\n // }else{\r\n // echo \"string\";\r\n // }\r\n $connection->commit();\r\n return true;\r\n } catch (Exception $e) {\r\n\r\n $connection->rollBack();\r\n return false;\r\n }\r\n\r\n }", "public function createIntern(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'receiver.account' => 'required|regex:/^THW[0-9]{6}DZD$/|exists:accounts,number',\n 'amount' => 'required|numeric|min:0',\n 'reason' => 'required|max:255',\n ]);\n $validator->sometimes('justification', 'required', function ($input) {//todo more validation\n return $input->amount > 200000; // Amount \"Depasse\" 200 000\n });\n if ($validator->fails()) {\n return response($validator->errors(), config('code.BAD_REQUEST'));\n }\n\n\n $amount = $request->input('amount');\n $hasEnoughMoney = false;\n /**start transaction**/\n DB::beginTransaction();\n\n try {\n\n $senderAccount = $this->client()->accounts()\n ->courant()->first();//todo check methode first()\n\n //check the amount\n if (!$senderAccount->hasEnoughMoney($amount)) throw new \\Exception;\n $hasEnoughMoney = true;\n\n //create the transfer\n $commission = config('commission.COUR_COUR') * $amount;\n $now = \\Carbon\\Carbon::now();\n $nb = BalanceHistory::count();//todo fix this !all sol tested! re-migrate DB\n //sender history\n BalanceHistory::create([\n 'id' => $nb + 1,\n 'amount' => $amount + $commission,//todo put it negative !!\n 'transaction_type' => 'vir_client',\n 'transaction_direction' => 'out',\n 'account_id' => $senderAccount->number,\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n if ($amount > 200000) {\n $transferDate = null;\n $creationDate = $now->format('Y-m-d H:i:s');\n $status = 'traitement';\n } else {\n //receiver history\n BalanceHistory::create([\n 'id' => $nb + 2,\n 'amount' => $amount,\n 'transaction_type' => 'vir_client',\n 'transaction_direction' => 'in',\n 'account_id' => $request->input('receiver.account'),\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n //change the amount of the destination client just in case of < 200 000 else till validation\n $receiverAccount = Account::find($request->input('receiver.account'));\n $receiverAccount->balance = $receiverAccount->balance + $amount;\n $receiverAccount->save();\n\n $status = 'valide';\n $transferDate = $creationDate = $now->format('Y-m-d H:i:s');\n }\n\n InternTransfer::create([\n 'code' => $senderAccount->number . $request->input('receiver.account') . $now->format('YmdHi'),\n 'amount' => $amount,\n 'justification' => $request->input('justification'),\n 'reason' => $request->input('reason'),\n 'transferDate' => $transferDate,\n 'creationDate' => $creationDate,\n 'status' => $status,\n 'transfers_type' => 'vir_client',\n 'commission' => $commission,\n 'source_id' => $senderAccount->number,\n 'destination_id' => $request->input('receiver.account'),\n ]);\n\n //todo send commission to Tharwa account\n //we retrieve the amount from the sender account\n $senderAccount->balance = $senderAccount->balance - $commission - $amount;\n $senderAccount->save();\n\n\n// Mail::to($request->input('email'))\n// ->queue(new ClientRequestValidatedMail($acceptedClient->firstname.' '.$acceptedClient->lastname\n// , $request->input('code')));\n\n // all good\n /**commit - no problems **/\n DB::commit();\n return response([\"saved\" => true], config('code.CREATED'));\n\n } catch (\\Exception $e) {\n\n // something went wrong\n /**rollback every thing - problems **/\n DB::rollback();\n\n if (!$hasEnoughMoney)\n return response([\"amount\" => false], config('code.NOT_FOUND'));\n\n return response([\"saved\" => false], config('code.UNKNOWN_ERROR'));\n }\n\n }", "public function processPCTWalletTransfer($payload)\n\t{\n\t # Load user model\n\t $this->load->model('user');\n\t \n\t $result = $this->user->sign_in($this->input->post('user-name'), $this->input->post('user-password'));\n\t \n\t if(!$result)\n\t {\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_FAILED_LOGIN_ERROR);\n\t return $response;\n\t }\n\t \n\t $txnId = \"PCTINT\".time();\n\t $fromUser = $result;\n\t $toUser = $this->input->post('to-account');\n\t $txnType = 'User To User Transfer';\n\t $txnPoints = $this->input->post('pct-transfer-points');\n\t $txnTopic = $this->input->post('pct-topic');\n\t $txnMessage = $this->input->post('pct-message');\n\t \n\t # Now before actually making the transaction store, we need to add points to users account\n\t \n\t $profile = $this->user->getUserProfile($result);\n\t \n\t $walletAmount = $profile->{User::_PCT_WALLET_AMOUNT};\n\t \n\t if($txnPoints > $walletAmount){\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_TRANSFER_FAILURE_INSUFFICIENT_FUND);\n\t return $response;\n\t }\n\t \n\t $toUserProfile = $this->user->getUserProfile($toUser);\n\t \n\t $this->db->where(User::_ID, $toUser)->update(User::_TABLE, array(User::_PCT_WALLET_AMOUNT => $toUserProfile->{User::_PCT_WALLET_AMOUNT} + $txnPoints));\n\t $this->db->where(User::_ID, $fromUser)->update(User::_TABLE, array(User::_PCT_WALLET_AMOUNT => ($walletAmount- $txnPoints)));\n\t \n\t \n\t # Load pct-transaction model\n\t $this->load->model('pct_transaction');\n\t $result = $this->pct_transaction->create_transaction($fromUser, $toUser, $txnId, $txnType, $txnPoints, $txnTopic, $txnMessage);\n\t \n\t # Now once the payment is successfull, we should get the balance once again and pass this\n\t \n\t $profile = $this->user->getUserProfile($fromUser);\t \n\t $walletAmount = $profile->{User::_PCT_WALLET_AMOUNT};\n\t \n\t \n\t if($result) $response = array('flag'=>1, 'message'=>Message::PCT_PAYMENT_TRANSFER_SUCCESS, 'walletAmount'=>$walletAmount);\n\t else $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_TRANSFER_FAILURE);\n\t \n\t return $response;\n\t}", "public function transfersto()\n {\n return $this->hasMany('Transfer', 'accountto_id');\n }", "public static function transfer($toAccount, $amount)\n {\n $class = self::getClass();\n /**\n * @var \\App\\Lib\\Tokens\\ERC20 $class\n */\n if (!$class::DISABLED) {\n return $class::transfer($toAccount, $amount);\n } else {\n throw new \\Exception($class . ' is disabled!');\n }\n }", "public static function send(int $fromUserId, int $toUserId, int $amount)\n {\n if ($amount < 0) {\n throw new WalletsException('Amount is lower than zero');\n }\n\n $fromWallet = self::getWallet($fromUserId);\n\n if ($fromWallet->amount - $fromWallet->blocked < $amount) {\n throw new InsufficientFundsException();\n }\n\n return Db::transaction(function () use ($fromWallet, $toUserId, $amount) {\n // Credit\n $creditTransaction = TransactionsTable::create();\n $creditTransaction->userId = $fromWallet->userId;\n $creditTransaction->amount = $amount;\n $creditTransaction->type = TransactionsTable::TYPE_CREDIT;\n $creditTransaction->save();\n\n $fromWallet->amount -= $amount;\n $fromWallet->save();\n\n // System percent\n $systemAmount = ceil(OptionsTable::get('percent') / 100 * $amount);\n $ownerAmount = $amount - $systemAmount;\n\n // Debit to system\n $transaction = TransactionsTable::create();\n $transaction->userId = UsersTable::SYSTEM_USER;\n $transaction->amount = $systemAmount;\n $transaction->type = TransactionsTable::TYPE_DEBIT;\n $transaction->save();\n\n // Debit to owner\n $debitTransaction = TransactionsTable::create();\n $debitTransaction->userId = $toUserId;\n $debitTransaction->amount = $ownerAmount;\n $debitTransaction->type = TransactionsTable::TYPE_DEBIT;\n $debitTransaction->save();\n\n $toWallet = self::getWallet($toUserId);\n $toWallet->amount += $ownerAmount;\n $toWallet->save();\n });\n }", "public function transfer_capital(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\n\t\t$data['assets'] = $this->ledger_model->totalAssets();\n\t\t$data['debits'] = $this->ledger_model->totalDebits(); \n\t\t\n\t\t$data['totalPay_spec'] = $this->ledger_model->totalPay_spec();\n\t\t\n\t\t\n\t\t$data['assets'] = $this->ledger_model->totalAssets();\n\t\t$data['debits'] = $this->ledger_model->totalDebits();\n\t\t$data['credits'] = $this->ledger_model->totalCredits();\n\t\t$data['wallet'] = $this->ledger_model->totalWallet();\n\t\t$data['usedwallet'] = $this->ledger_model->usedWallet();\n\t\t\n\t\t//Get Decision who in online?\n\t\t$user = loggedInUserData();\n\t\t$userID = $user['user_id'];\n\t\t\n\t\tif($user['role'] == 'admin')\n\t\t{\n\t\t\t$data['users'] = $this->db->get_where('acct_categories', ['category_type' => 'sub']);\n\t\t}\n\t\t\n\t\t\n\t\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'transfer_capital') die('Error! sorry');\t\n\t\t\t\n\t\t\t$this->form_validation->set_rules('from_pay_type', 'From Sub-Accounts Type', 'required|trim'); \n\t\t\t$this->form_validation->set_rules('to_pay_type', 'To Sub-Accounts Type', 'required|trim'); \n\t\t//\t$this->form_validation->set_rules('trans_type', 'Transfer Type', 'required|trim'); \t\t\t\n\t\t\t$this->form_validation->set_rules('amount', 'Amount', 'required|trim');\n\t\t\t$this->form_validation->set_rules('remarks', 'Transaction Remarks', 'required|trim'); \t\t\t\t\n\t\t\t\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->transfer_capital();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Fund Transfer Between Pay Specifications Completed Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\ttheme('transfer_capital',$data);\n\t}", "public function store_convert_to_wallet_funds(Request $request)\n {\n $max = ((Auth()->user()->bonus) * 0.98);\n request()->validate([\n 'funding_amount' => 'required|numeric|min:10|max:' . $max,\n ]);\n\n if ($request->has('funding_amount')) {\n try {\n $new_trx = new Transaction();\n $new_trx->amount = $request->funding_amount;\n $new_trx->status = 'created';\n $new_trx->type = 'funding';\n $new_trx->user_id = Auth()->id();\n\n $new_bonus_trx = new Bonus();\n $new_bonus_trx->user_id = Auth()->user()->id;\n $new_bonus_trx->amount = -$request->funding_amount;\n $new_bonus_trx->status = 'created';\n $new_bonus_trx->type = 'wallet_convert';\n $new_bonus_trx->save();\n $new_bonus_trx->transaction()->save($new_trx);\n $new_trx->status = 'completed';\n $new_trx->update();\n $user = User::where('id',Auth()->user()->id)->first();\n $user->bonus -= $new_trx->amount;\n $user->wallet += $new_trx->amount;\n $user->update();\n\n //collect service charge\n $new_sc_trx = new Transaction();\n $new_sc_trx->amount = - ($request->funding_amount * 0.02);\n $new_sc_trx->status = 'created';\n $new_sc_trx->type = 'funding_fee';\n $new_sc_trx->user_id = $user->id;\n\n $new_sc_bonus_trx = new Bonus();\n $new_sc_bonus_trx->user_id = $user->id;\n $new_sc_bonus_trx->amount = - ($request->funding_amount * 0.02);\n $new_sc_bonus_trx->status = 'created';\n $new_sc_bonus_trx->type = 'bonus_convert_fee';\n $new_sc_bonus_trx->save();\n $new_sc_bonus_trx->transaction()->save($new_sc_trx);\n $new_sc_trx->status = 'completed';\n $new_sc_trx->update();\n // $user = User::where('id',Auth()->user()->id)->first();\n $user->bonus -= ($request->funding_amount * 0.02);\n $user->update();\n\n //receive service charge\n $admin = User::whereRole(\"admin\")->firstOrFail();\n $new_scr_trx = new Transaction();\n $new_scr_trx->amount = ($request->funding_amount * 0.02);\n $new_scr_trx->status = 'created';\n $new_scr_trx->type = 'bonus';\n $new_scr_trx->user_id = $admin->id;\n\n $new_scr_bonus_trx = new Bonus();\n $new_scr_bonus_trx->user_id = $admin->id;\n $new_scr_bonus_trx->amount = ($request->funding_amount * 0.02);\n $new_scr_bonus_trx->status = 'created';\n $new_scr_bonus_trx->type = 'bonus_convert_charge';\n $new_scr_bonus_trx->save();\n $new_scr_bonus_trx->transaction()->save($new_trx);\n $new_scr_trx->status = 'completed';\n $new_scr_trx->update();\n $admin->bonus += $new_scr_trx->amount;\n $admin->update();\n return redirect()->route('user_home')->with('success', \"Your wallet was successfully funded with {$request->amount} from your bonus\");\n } catch (\\Exception $e) {\n return back()->with('error', sprintf('Could not fund your wallet: %s', $e->getMessage()));\n }\n }\n }", "function withdrawal($account, $amount, $id_user) {\r\n\r\n //Crear la conexión\r\n $base = conection();\r\n\r\n //Verificar que el usuario tenga disponible ese dinero\r\n $sql = \"SELECT balance, pending FROM users WHERE id = :id_user\";\r\n\r\n //Preparar consulta\r\n $result = $base->prepare($sql);\r\n\r\n //Ejecutar consulta\r\n $result->execute(array(\":id_user\"=>$id_user));\r\n\r\n //Contar registros encontrados\r\n $count = $result->rowCount();\r\n \r\n //Verificar si se ingresó el registro\r\n if ($count > 0) {\r\n\r\n while ($row=$result->fetch(PDO::FETCH_ASSOC)) {\r\n $balance = $row[\"balance\"];\r\n $pending = $row[\"pending\"];\r\n }\r\n\r\n if ($balance >= $amount) {\r\n\r\n //Restamos el dienro al usuario\r\n $new_balance = $balance - $amount;\r\n $new_pending = $pending + $amount;\r\n \r\n //Actualizamos el balance del usuario y agregamos el dinero pendiente\r\n $sql_new_balance = \"UPDATE `users` SET `balance`= :balance, `pending`= :pending WHERE id = :id_user\";\r\n\r\n //Preparar consulta\r\n $result_new_balance = $base->prepare($sql_new_balance);\r\n\r\n //Ejecutar consulta\r\n $result_new_balance->execute(array(\":balance\"=>$new_balance, \":pending\"=>$new_pending, \":id_user\"=>$id_user));\r\n\r\n //Actualizamos el balance del usuario y agregamos el dinero pendiente\r\n $sql_withdrawal = \"INSERT INTO `withdrawal`(`account`, `amount`, `date`, `id_user`) VALUES (:account, :amount , NOW(), :id_user)\";\r\n\r\n //Preparar consulta\r\n $result_withdrawal = $base->prepare($sql_withdrawal);\r\n\r\n //Ejecutar consulta\r\n $result_withdrawal->execute(array(\":account\"=>$account, \":amount\"=>$amount, \":id_user\"=>$id_user));\r\n\r\n $count_withdrawal = $result_withdrawal->rowCount();\r\n\r\n if ($count_withdrawal > 0) {\r\n\r\n //Enviar email\r\n $msg = \"The user with the id $id_user has requested a withdrawal in the amount of $amount for their Payeer account $account\";\r\n \r\n mail(\"medinahildegar1@gmail.com\", \"New Withdrawal request - $id_user\", $msg);\r\n\r\n return \"<b>Your withdrawal request has been sent</b>\\nIn less than 24 hours your order will be processed\";\r\n }\r\n\r\n }else {\r\n return \"You don't have enough funds\";\r\n }\r\n \r\n }else {\r\n return \"fatal error 3\";\r\n }\r\n\r\n}", "public function createTransactions(Request $request, $id)\n {\n // First authorization (but we don't have)\n\n // Validation of user data\n $rules = [\n 'to_id' => 'required|integer|min:0',\n 'amount' => 'required|numeric|min:0.01',\n 'details' => 'nullable',\n ];\n $validator = Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n $response = [\n 'status' => false,\n 'errors' => $validator->errors()->all(),\n ];\n return response()->json($response, 200);\n }\n\n // People can't have transaction to themselves (by editing front-end code)\n if($request->to_id == $id){\n $response = [\n 'status' => false,\n 'errors' => [__('validation.selfTransaction')],\n ];\n return response()->json($response, 200);\n }\n\n // From Account\n $from_account = Account::findOrFail($id);\n\n // Checking balance | Bank doesn't allow less than zero for balance number.\n if($from_account->balance < ($request->amount + $this->bank_fee)){\n $response = [\n 'status' => false,\n 'errors' => [__('validation.notEnoughBalance')],\n ];\n return response()->json($response, 200);\n }\n\n // Checking destination account\n $to_account = Account::find($request->to_id);\n if(!$to_account){\n $response = [\n 'status' => false,\n 'errors' => [__('validation.destAccountNotFound')],\n ];\n return response()->json($response, 200);\n }\n\n // Process\n $from_account->balance = $from_account->balance - ($request->amount + $this->bank_fee);\n $from_account->save();\n $to_account->balance = $to_account->balance + $request->amount;\n $to_account->save();\n // App\\Observers\\AccountObserver will handle post {action} tasks\n\n // Inserting transaction\n $transaction = new Transaction;\n $transaction->from_id = $from_account->id;\n $transaction->to_id = $to_account->id;\n $transaction->amount = $request->amount;\n $transaction->details = $request->details;\n $transaction->save();\n // App\\Observers\\TransactionObserver will handle post {action} tasks\n\n // Now we can send Notifications\n\n // At last...\n $response = [\n 'status' => true,\n 'model' => $transaction->load('from.user', 'to.user'),\n 'new_balance' => $from_account->balance,\n ];\n return response()->json($response, 200);\n }", "public function bankTransfer() {\n if ($this->redirectIfNotLoggedIn()) return array();\n\n $finalRegistrationLink = Link::fromTextAndUrl(iish_t('Click here'),\n Url::fromRoute('iish_conference_finalregistration.form'));\n\n // TODO: it should also work with participants with 'not finished pre-registrations'\n\t if ( LoggedInUserDetails::isAParticipant() && LoggedInUserDetails::getParticipant()->getPaymentId()) {\n//\t if ( ( LoggedInUserDetails::isAParticipant() || LoggedInUserDetails::isAParticipantWithoutConfirmation() ) && LoggedInUserDetails::getParticipant()->getPaymentId()) {\n $participant = LoggedInUserDetails::getParticipant();\n $orderDetails = new PayWayMessage(array('orderid' => $participant->getPaymentId()));\n $order = $orderDetails->send('orderDetails');\n\n if (!empty($order)) {\n if ($order->get('payed') == 1) {\n drupal_set_message(iish_t('You have already completed your final registration and payment.'), 'status');\n\n return array();\n }\n else if ($order->get('paymentmethod') == 1) {\n $bankTransferInfo = SettingsApi::getSetting(SettingsApi::BANK_TRANSFER_INFO);\n $amount = ConferenceMisc::getReadableAmount($order->get('amount'), TRUE);\n $finalDate = date('l j F Y', $participant->getBankTransferFinalDate($order->getDateTime('createdat')));\n $fullName = LoggedInUserDetails::getUser()->getFullName();\n\n $bankTransferInfo = str_replace('[PaymentNumber]', $order->get('orderid'), $bankTransferInfo);\n $bankTransferInfo = str_replace('[PaymentAmount]', $amount, $bankTransferInfo);\n $bankTransferInfo = str_replace('[PaymentDescription]', $order->get('com'), $bankTransferInfo);\n $bankTransferInfo = str_replace('[PaymentFinalDate]', $finalDate, $bankTransferInfo);\n $bankTransferInfo = str_replace('[NameParticipant]', $fullName, $bankTransferInfo);\n\n return array('#markup' => new ConferenceHTML($bankTransferInfo));\n }\n else if ($order->get('paymentmethod') == 2) {\n $cashPaymentInfo = SettingsApi::getSetting(SettingsApi::ON_SITE_PAYMENT_INFO);\n $amount = ConferenceMisc::getReadableAmount($order->get('amount'), TRUE);\n $fullName = LoggedInUserDetails::getUser()->getFullName();\n\n $cashPaymentInfo = str_replace('[PaymentNumber]', $order->get('orderid'), $cashPaymentInfo);\n $cashPaymentInfo = str_replace('[PaymentAmount]', $amount, $cashPaymentInfo);\n $cashPaymentInfo = str_replace('[PaymentDescription]', $order->get('com'), $cashPaymentInfo);\n $cashPaymentInfo = str_replace('[NameParticipant]', $fullName, $cashPaymentInfo);\n\n return array('#markup' => new ConferenceHTML($cashPaymentInfo));\n }\n else {\n drupal_set_message(iish_t('You have chosen an unknown payment method. @link to change your payment method.',\n array('@link' => $finalRegistrationLink->toString())), 'error');\n\n return array();\n }\n }\n\n drupal_set_message(iish_t('Currently it is not possible to obtain your payment information. ' .\n 'Please try again later...'), 'error');\n\n return array();\n }\n\n drupal_set_message(iish_t('You have not finished the final registration. @link.',\n array('@link' => $finalRegistrationLink->toString())), 'error');\n\n return array();\n }", "public function deposit($amount)\n {\n $this->balance += $amount;\n $this->save();\n }", "public static function lockFunds($from, $amount, $fee=0){\n\t\t$fromuser = \\CouchDB::getDoc($from, \"users\");\n\t\t$frombalance = Dogecoin::getBalance($from);\n\t\tif ($frombalance['available'] < ($amount + $fee)){\n\t\t\t//they don't have the funds\n\t\t\treturn \\Shared\\Error::handleError(\"nofunds\");\n\t\t}else{\n\t\t\tif ($fee != 0){\n\t\t\t\t$response = Dogecoin::payMe($from, $fee);\n\t\t\t}\n\t\t\t$response = Dogecoin::move($from, \"LOCKED-FEE\", $amount);\n\t\t\t$fromuser->wallet->locked += $amount;\n\t\t\t$response = \\CouchDB::setDoc($fromuser, \"users\");\n\t\t\treturn $amount;\n\t\t}\n\t\t//something went wrong, but i have no idea what that might be.\n\t\treturn 0;\n\t}", "private function sellTrasactionAddsMoney(){\n\n }", "public function backupWallet($destination);", "public function directBankTransfer($data){\n $title = $this->fm->validation($data['title']);\n $description = $this->fm->validation($data['description']);\n $instructions = $this->fm->validation($data['instructions']);\n $account_name = $this->fm->validation($data['account_name']);\n $account_number = $this->fm->validation($data['account_number']);\n $short_code = $this->fm->validation($data['short_code']);\n $iban = $this->fm->validation($data['iban']);\n $bic_swift = $this->fm->validation($data['bic_swift']);\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 $account_name = mysqli_real_escape_string( $this->db->link, $data['account_name']);\n $account_number = mysqli_real_escape_string( $this->db->link, $data['account_number']);\n $short_code = mysqli_real_escape_string( $this->db->link, $data['short_code']);\n $iban = mysqli_real_escape_string( $this->db->link, $data['iban']);\n $bic_swift = mysqli_real_escape_string( $this->db->link, $data['bic_swift']);\n \n if (empty($title || $description || $instructions || $account_name || $account_number || $short_code || $iban || $bic_swift )) {\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 account_name = '$account_name',\n account_number = '$account_number',\n short_code = '$short_code',\n iban = '$iban',\n bic_swift = '$bic_swift'\n WHERE id = '1'\"; \n $updated_row = $this->db->update($query);\n\n if ($updated_row) {\n $msg = \"<span class='success'>Bank info updated.</span>\";\n return $msg;\n } else {\n $msg = \"<span class='error'>Bank info Not Updated !</span>\";\n return $msg;\n } \n }\n }", "public function transfer_money() {\n $data['title'] = 'Transfer Money';\n return view('user-dashboard.transfer-money', $data);\n }", "public static function rewardUser($from, $to, $amount, $fee=0){\n\t\t$fromuser = \\CouchDB::getDoc($from, \"users\");\n\t\tif ($fromuser->wallet->locked < $amount){\n\t\t\t//they don't have the funds\n\t\t\treturn \\Shared\\Error::handleError(\"nofunds\");\n\t\t}\n\t\t$fromuser->wallet->locked -= $amount;\n\t\t$response = \\CouchDB::setDoc($fromuser, \"users\");\n\t\t//send the money\n\t\ttry{\n\t\t\t$response = Dogecoin::move(\"LOCKED-FEE\", $to, $amount);\n\t\t\treturn $amount;\n\t\t}catch(Exception $e){\n\t\t\treturn 0;\n\t\t}\n\t\t//something went wrong, but i have no idea what that might be.\n\t\treturn 0;\n\t}", "function edd_wallet_add_funds( $payment_id ) {\n\t$fees = edd_get_payment_fees( $payment_id );\n\n\tif( $fees && count( $fees ) == 1 ) {\n\t\tif( $fees[0]['id'] == 'edd-wallet-deposit' ) {\n\n\t\t\t// Disable purchase receipts... we send our own emails\n\t\t\tremove_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999 );\n\n\t\t\t// Send our custom emails\n\t\t\tedd_wallet_send_email( 'user', $payment_id );\n\n\t\t\t// Get the ID of the purchaser\n\t\t\t$user_id = edd_get_payment_user_id( $payment_id );\n\n\t\t\t// Deposit the funds\n\t\t\tedd_wallet()->wallet->deposit( $user_id, $fees[0]['amount'], 'deposit', $payment_id );\n\n\t\t\t// Tag the payment so we can find it later\n\t\t\tedd_update_payment_meta( $payment_id, '_edd_wallet_deposit', $user_id );\n\t\t}\n\t}\n}", "function tranferFounds($project_id, $returnTotal=false, $adaptivepayments_pay = true) {\n\n App::import('Vendor', 'paypal');\n $this->Paypal = new Paypal();\n\n\n $this->recursive = -1;\n $sponsorships = $this->find('all', array('conditions' => array('Sponsorship.project_id' => $project_id)));\n\n $tranferredSponsorships = array();\n $total = 0;\n foreach ($sponsorships as $sponsorship) {\n $sponsorship_id = $sponsorship[$this->alias]['id'];\n if ($this->getPaymentType($sponsorship) == EXPRESSCHECKOUT) { // all of these payments are already on our paypal account, no tenemos que hacer nada.\n if ($this->isTransferred($sponsorship, EXPRESSCHECKOUT)) { // se marco como trasferido ? \n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } else {\n $transactionId = $sponsorship[$this->alias]['expresscheckout_transaction_id'];\n if (!empty($transactionId)) {\n $response = $this->Paypal->hashCall('GetTransactionDetails', array('TRANSACTIONID' => $transactionId));\n if ($this->updateExpressCheckoutStatus($sponsorship_id, $transactionId)) {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n }\n }\n }\n } elseif ($this->getPaymentType($sponsorship) == PREAPPROVAL) {\n if ($this->isTransferred($sponsorship, PREAPPROVAL)) { // se marco como trasferido ? \n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } else {\n $preapproval_key = $sponsorship[$this->alias]['preapproval_key'];\n if ($this->updatePreApprovalStatus($sponsorship_id, $preapproval_key)) { // actualizamos el pago | si esta activo ....\n $transferred = true;\n $sponsorship = $this->read(null, $sponsorship_id);\n if (!$this->isTransferred($sponsorship, PREAPPROVAL)) {\n // transferimos el pago a groofi $transferred = true ;\n if ($adaptivepayments_pay == true && $this->adaptivepayments_pay($sponsorship)) { //\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } elseif ($adaptivepayments_pay == false) {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n }\n } else {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n $sponsorship[$this->alias]['internal_status'] = SPONSORSHIP_TRANSFERRED;\n $sponsorship[$this->alias]['transferred'] = 1;\n $this->save($sponsorship);\n }\n }\n }\n }\n }\n return $returnTotal ? $total : $tranferredSponsorships;\n }", "public function actionSendToHub()\n {\n $paymentAddresses = PaymentAddressQueryLibrary::getWithFunds();\n\n $paymentAddressService = new PaymentAddressService();\n foreach ($paymentAddresses as $paymentAddress) {\n try {\n if ($paymentAddressService->sendToHub($paymentAddress)) {\n $this->stdout('Funds transferred from temporary address to hub address. | ID: ' . $paymentAddress->id . \" | Hex: \" . $paymentAddressService->getTransactionHex() . \" |\\n\" . PHP_EOL, Console::FG_YELLOW);\n }\n }\n catch (Exception $exception) {\n $this->stdout('Error occurred. | ID: ' . $paymentAddress->id . \" |\\n\" . PHP_EOL, Console::FG_RED);\n }\n }\n return true;\n }", "public function wallet_accounts(){\n\t//restricted this area, only for admin\n\t\tpermittedArea();\n\t\t$data['earnings'] \t \t= $this->ledger_model->totalEarning();\n\t\t$data['referralEarnings']\t= $this->ledger_model->referralEarnings();\n\t\t$data['total_liabilities'] \t= $this->ledger_model->total_liabilities();\n\t\t$data['total_wallet']\t\t= $this->ledger_model->total_wallet(); //User Total Wallet Points from Accounts Table\n\n\t\t\t$data['assets'] = $this->ledger_model->totalAssets();\n\t\t$data['debits'] = $this->ledger_model->totalDebits();\n\t\t$data['credits'] = $this->ledger_model->totalCredits();\n\t\t$data['wallet'] = $this->ledger_model->totalWallet();\n\t\t$data['usedwallet'] = $this->ledger_model->usedWallet();\n\t\t\n\n\t\tif($this->input->post())\n\t\t{\n\t\t\tif($this->input->post('submit') != 'cash_2wallet') die('Error! sorry');\n\n\n\t\t\t$this->form_validation->set_rules('cash', 'Company Cash', 'required|trim');\n\t\t\t$this->form_validation->set_rules('pay_type', 'Payment Type', 'required|trim'); \n\t\t\t$this->form_validation->set_rules('tranx_id', 'Transaction Remarks', 'required|trim'); \t\t\t\t\n\t\t\t\n\n\t\t\tif($this->form_validation->run() == true)\n\t\t\t{\n\t\t\t\t$insert = $this->ledger_model->cash_2wallet();\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('successMsg', 'Entered Cash Amount Turned to Wallet Points Successfully...!!!');\n\t\t\t\t\tredirect(base_url('ledger'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\ttheme('wallet_accounts', $data);\n\t}", "public function makeTransferAction()\n {\n if ($_SESSION['actionAvailable']) {\n try {\n $id = $_SESSION['id'];\n $account = new BankAccountModel(null, $id);\n $toAccountID = $account->findID($_POST['accountTo']);\n $fromAccountID = $account->findID($_POST['accountFrom']);\n $transaction = new TransactionModel();\n $transaction->setAmount($_POST['amount']);\n $transaction->setDescription($_POST['description']);\n $transaction->setToAccountID($toAccountID);\n $transaction->setFromAccountID($fromAccountID);\n\n $transaction->validateTransfer();\n $transaction->makeTransfer();\n $transaction->save();\n\n $view = new View('transactionComplete');\n echo $view->render();\n $_SESSION['actionAvailable'] = false;\n } catch (\\UnexpectedValueException $e) {\n $_SESSION['emptyField'] = true;\n $this->redirect('transferPage');\n } catch (\\LogicException $e) {\n $_SESSION['validTransaction'] = false;\n $this->redirect('transferPage');\n }\n }\n }", "public function transfersfrom()\n {\n return $this->hasMany('Transfer', 'accountfrom_id');\n }", "public function createExtern(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'receiver.account' => ['required', 'regex:/^[A-Z]{3}[0-9]{6}(DZD|EUR|USD)$/'],\n 'receiver.name' => 'required|max:255',\n 'receiver.bank' => 'required|regex:/^[A-Z]{3}$/|exists:banks,code',\n 'amount' => 'required|numeric|min:0',\n 'reason' => 'required|max:255',\n ]);\n $validator->sometimes('justification', 'required', function ($input) {//todo\n return $input->amount > 200000; // Amount \"Depasse\" 200 000\n });\n if ($validator->fails()) {\n return response($validator->errors(), config('code.BAD_REQUEST'));\n }\n\n\n $amount = $request->input('amount');\n $hasEnoughMoney = false;\n /**start transaction**/\n DB::beginTransaction();\n\n try {\n\n $senderAccount = $this->client()->accounts()\n ->courant()->first();//todo check methode first()\n\n\n //check the amount\n if (!$senderAccount->hasEnoughMoney($amount)) throw new \\Exception;\n $hasEnoughMoney = true;\n\n\n //create the transfer\n $commission = config('commission.SENDEXTBANK') * $amount;\n $now = \\Carbon\\Carbon::now();\n $virement_code = $senderAccount->number . $request->input('receiver.account') . $now->format('YmdHi');\n if ($amount > 200000) {\n $transferDate = null;\n $creationDate = $now->format('Y-m-d H:i:s');\n $status = 'traitement';\n } else {\n //generate the XML file that will be treated later equivalent to send money\n $xmlBody = View::make('xml_transfer_template', [\n \"code\" => $virement_code,\n \"date\" => $now->format('YmdHis'),\n \"senderName\" => $this->client()->firstname . ' ' . $this->client()->lastname,\n \"senderAccount\" => $senderAccount->number,\n \"receiverName\" => $request->input('receiver.name'),\n \"receiverBank\" => $request->input('receiver.bank'),\n \"receiverAccount\" => $request->input('receiver.account'),\n \"amount\" => $amount,\n \"reason\" => $request->input('reason'),\n ])->render();\n $xmlBody = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . $xmlBody;\n\n Storage::disk('xml_out')->put($virement_code . '.xml', $xmlBody);\n\n $status = 'valide';\n $transferDate = $creationDate = $now->format('Y-m-d H:i:s');\n }\n ExternTransfer::create([\n 'code' => $virement_code,\n 'amount' => $amount,\n 'justification' => $request->input('justification'),\n 'reason' => $request->input('reason'),\n 'transferDate' => $transferDate,\n 'creationDate' => $creationDate,\n 'status' => $status,\n 'commission' => $commission,\n 'intern_account_id' => $senderAccount->number,\n 'direction' => 'out',\n 'extern_account_name' => $request->input('receiver.name'),\n 'extern_account_number' => $request->input('receiver.account'),\n 'extern_bank' => $request->input('receiver.bank'),\n ]);\n\n\n //todo send commission to Tharwa account\n //we retrieve the amount from the sender account\n $senderAccount->balance = $senderAccount->balance - $commission - $amount;\n $senderAccount->save();\n\n $nb = BalanceHistory::count();//todo fix this !all sol tested! re-migrate DB\n //sender history\n BalanceHistory::create([\n 'id' => $nb + 1,\n 'amount' => $amount + $commission,\n 'transaction_type' => 'transf',\n 'transaction_direction' => 'out',\n 'account_id' => $senderAccount->number,\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n\n// Mail::to($request->input('email'))\n// ->queue(new ClientRequestValidatedMail($acceptedClient->firstname.' '.$acceptedClient->lastname\n// , $request->input('code')));\n\n // all good\n /**commit - no problems **/\n DB::commit();\n return response([\"saved\" => true], config('code.CREATED'));\n\n } catch (\\Exception $e) {\n\n // something went wrong\n /**rollback every thing - problems **/\n DB::rollback();\n\n if (!$hasEnoughMoney)\n return response([\"amount\" => false], config('code.NOT_FOUND'));\n\n return response([\"saved\" => false], config('code.UNKNOWN_ERROR'));\n }\n\n }", "function get_ethDeposit_user($addr)\n{\n try {\n $AdminAddress = decrypt(get_config('eth_address'));\n $user_deposit = 0;\n $eurl = 'https://api.etherscan.io/api?module=account&action=txlist&address=' . $addr . '&startblock=0&endblock=latest';\n\n $cObj = curl_init();\n curl_setopt($cObj, CURLOPT_URL, $eurl);\n curl_setopt($cObj, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($cObj, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($cObj, CURLOPT_RETURNTRANSFER, TRUE);\n $output = curl_exec($cObj);\n $curlinfos = curl_getinfo($cObj);\n\n $result = json_decode($output);\n\n if ($result->message == 'OK') {\n $transaction = $result->result;\n for ($tr = 0; $tr < count($transaction); $tr++) {\n\n $Fromaddress = $transaction[$tr]->from;\n $Toaddress = $transaction[$tr]->to;\n $value = $transaction[$tr]->value;\n\n if ($Toaddress === $AdminAddress) {\n $eth_balance = $value;\n $ether_balance = ($eth_balance / 1000000000000000000);\n $user_deposit = $user_deposit + $ether_balance;\n }\n\n }\n }\n $internalurl = 'https://api.etherscan.io/api?module=account&action=txlistinternal&address=' . $addr . '&startblock=0&endblock=latest';\n\n $cObj = curl_init();\n curl_setopt($cObj, CURLOPT_URL, $internalurl);\n curl_setopt($cObj, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($cObj, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($cObj, CURLOPT_RETURNTRANSFER, TRUE);\n $output = curl_exec($cObj);\n $curlinfos = curl_getinfo($cObj);\n\n $internalresult = json_decode($output);\n if ($internalresult->message == 'OK') {\n $transaction = $internalresult->result;\n for ($tr = 0; $tr < count($transaction); $tr++) {\n\n $Fromaddress = $transaction[$tr]->from;\n $Toaddress = $transaction[$tr]->to;\n $value = $transaction[$tr]->value;\n\n if ($Toaddress === $AdminAddress) {\n $eth_balance = $value;\n $ether_balance = ($eth_balance / 1000000000000000000);\n $user_deposit = $user_deposit + $ether_balance;\n }\n }\n }\n return $user_deposit;\n } catch (\\Exception $exception) {\n return 'Error';\n }\n}", "public function TransferStockTransaction($post){\r\n\t\t$db=$this->getAdapter();\r\n\t\t$session_user = new Zend_Session_Namespace('auth');\r\n\t\t$userName = $session_user->user_name;\r\n\t\t$GetUserId = $session_user->user_id;\r\n\t\r\n\t\t$db_global = new Application_Model_DbTable_DbGlobal();\r\n\t\t\n\t\tif($post['from_location']!== $post['to_location']){\n\t\t\t//try{\n\t\t\t\n\t\t\t\t\tif($post['invoce_num']!=\"\"){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$tr_no=$post['invoce_num'];\n\t\t\t\t\t}\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$date= new Zend_Date();\r\n\t\t\t\t\t\t$tr_no=\"TR\".$date->get('hh-mm-ss');\r\n\t\t\t\t\t}\n\t\t\t\t $data_transfer=array(\r\n\t\t\t\t\t\t\t\t\t\t'invoice_num'\t=> $tr_no,\r\n\t\t\t\t\t\t\t\t\t\t'transfer_date' => $post['transfer_date'],\r\n\t\t\t\t\t\t\t\t\t\t'from_location'\t=> $post['from_location'],\r\n\t\t\t\t\t\t\t\t\t\t'to_location'\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t\t'user_id' \t\t=> $GetUserId,\r\n\t\t\t\t\t\t\t\t\t\t'mod_date'\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t\t'remark'\t => $post['remark_transfer']\r\n\t\t\t\t\t\t\t\t );\r\n\t\t\t\t\t$transfer_id = $db_global->addRecord($data_transfer, \"tb_stocktransfer\");\r\n\t\t\t\t unset($data_transfer);\n\t\t\t\t $identity = explode(',',$post['identity']);\r\n\t\t\t\t\tforeach($identity as $i){\r\n\t\t\t\t\t \t\t\t\t$data_item=array(\r\n\t\t\t\t\t\t\t\t\t\t'transfer_id'\t => $transfer_id,\n\t\t\t\t\t\t\t\t\t\t'pro_id'\t\t => $post['item_id_'.$i],\r\n\t\t\t\t\t \t\t\t\t\t'qty'\t\t\t => $post['qty_id_'.$i],\r\n\t\t\t\t\t \t\t\t\t\t'remark_transfer'=> $post['remark_'.$i]\r\n\t\t\r\n\t\t\t\t\t\t\t\t\t );\r\n\t\t\t\t \t\t\t\t $db->insert(\"tb_transfer_item\", $data_item);\r\n\t\t\t\t\t \t\t\t\tunset($data_item);\r\n\t\t\r\n\t\t\t\t\t$rows = $db_global ->porductLocationExist($post['item_id_'.$i], $post['from_location']);\r\n\t\t\t\t\tif($rows){\r\n\t\t\t\t\t\t//update poduct location from\r\n\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t'qty' \t\t\t=>\t$rows['qty']- $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $rows[\"qty_avaliable\"]- $post['qty_id_'.$i],\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db_global->updateRecord($data_qty_location, $rows['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//add move history\r\n\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['from_location'],\r\n\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_before' => $rows['qty'],\r\n\t\t\t\t\t\t\t\t'qty_after' \t=> $rows['qty']- $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tunset($data_qty_location);unset($rows);unset($data_history);\r\n\t\t\t\t\t\t//update product location to\r\n\t\t\t\t\t\t$rows_gets_qty=$db_global -> porductLocationExist($post['item_id_'.$i], $post['to_location']);\r\n\t\t\r\n\t\t\t\t\t\tif($rows_gets_qty){\r\n\t\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t\t'qty' \t\t\t=>\t$rows_gets_qty['qty']\t\t\t+ $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $rows_gets_qty[\"qty_avaliable\"]\t+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$itemid=$db_global->updateRecord($data_qty_location, $rows_gets_qty['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\r\n\t\t\t\t\t\t\t//add move history\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],//can't add remark cos short table in form\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => $rows_gets_qty['qty'],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $rows_gets_qty['qty']+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($rows_gets_qty);unset($data_history);\r\n\t\t\t\t\t\t}//if recieve deosn't exist in product location\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'LocationId' => $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'qty' => $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\r\n\t\t\t\t\t\t\t//if receive not have\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => 0,\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($add_pro_location); unset($data_history);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{//if from doesn't exist\r\n\t\t\t\t\t\t//add qty in location if from doesn't exist\r\n\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t'LocationId' => $post['from_location'],\r\n\t\t\t\t\t\t\t\t'qty' => -$post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t'qty_avaliable'\t=> - $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\r\n\t\t\t\t\t\tunset($add_pro_location);\r\n\t\t\t\t\t\t//echeck for get product location\r\n\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t'transaction_type' => 1,\r\n\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['from_location'],\r\n\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_after' \t=> -$post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\r\n\t\t\t\t\t\tunset($data_history);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//for get stock\r\n\t\t\t\t\t\t$rows_gets_qty=$db_global -> porductLocationExist($post['item_id_'.$i], $post['to_location']);\r\n\t\t\t\t\t\tif($rows_gets_qty){\r\n\t\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t\t'qty' =>$rows_gets_qty['qty']+ $post['qty_id_'.$i]\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db_global->updateRecord($data_qty_location, $rows_gets_qty['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\r\n\t\t\t\t\t\t\t//add move history\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t( \t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => $rows_gets_qty['qty'],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $rows_gets_qty['qty']+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($rows_gets_qty);unset($data_qty_location);\r\n\t\t\t\t\t\t}//if recieve deosn't exist in product location\r\n\t\t\t\t\t\telse{ //if doesn't exist from and to\r\n\t\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'LocationId' => $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'qty' => $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\n\t\t\t\t\t\t\tunset($add_pro_location);\r\n\t\t\t\t\t\t\t//if doesn't exist from and to\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 1,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($data_history);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//forforeach\n\t\t\t\t//$db->commit();\n\t\t /*}//try\n\t\t catch (Exception $e) {\n\t\t \t$db->rollBack();\n\t\t \t$this->view->msg = $e->getMessage();\r\n\t\t }*/\r\n\t\t}//for if\r\n\t}", "public function actionDepositMoney()\n {\n // Recevei the POST params\n $request = Yii::$app->request;\n $user_id = $request->post('user_id');\n $amount_currency = $request->post('amount_currency');\n $wallet_currency = $request->post('wallet_currency');\n $amount = $request->post('amount');\n\n // Check the mandatory fields\n if (empty($user_id)) {\n throw new BadRequestHttpException('The user ID must be informed.');\n } else if (empty($amount_currency)) {\n throw new BadRequestHttpException('The amount currency must be informed.');\n } else if (empty($wallet_currency)) {\n throw new BadRequestHttpException('The wallet currency must be informed.');\n } else if (empty($amount)) {\n throw new BadRequestHttpException('The amount must be informed.');\n } else {\n // Prepare the input\n $amount = floatval($amount);\n $amount_currency = strtoupper($amount_currency);\n $wallet_currency = strtoupper($wallet_currency);\n\n // Try to retrieve the wallet info\n $wallet = Wallet::find()->where(['user_id' => $user_id])->andWhere(['currency' => $wallet_currency])->one();\n\n // Check if the wallet exists\n if (isset($wallet) && !empty($wallet)) {\n // Check if needs to convert\n if (strcmp($amount_currency, $wallet_currency) != 0) {\n // Gets the new currency quotation\n $result = $this->actionConvertCurrency($amount_currency, $wallet_currency, $amount);\n\n // Check if the conversion happend succesfully\n if (isset($result) && !empty($result)) {\n // Set the new wallet balance with conversion\n $wallet->balance += $result['converted_amount'];\n } else {\n throw new HttpException('It was not possible to contact the currency exchange server.');\n }\n } else {\n // Set the new wallet balance without conversion\n $wallet->balance += $amount;\n }\n\n // Update the the wallet balance\n if ($wallet->save()) {\n // Log the transaction as complete\n if (isset($result) && !empty($result)) {\n $this->logTransaction(Transaction::DEPOSIT, $amount, $result['converted_amount'], '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::COMPLETE);\n } else {\n $this->logTransaction(Transaction::DEPOSIT, $amount, 0, '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::COMPLETE);\n }\n\n // Return the wallet updated\n return $wallet;\n } else {\n // Log the transaction as incomplete\n if (isset($result) && !empty($result)) {\n $this->logTransaction(Transaction::DEPOSIT, $amount, $result['converted_amount'], '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n } else {\n $this->logTransaction(Transaction::DEPOSIT, $amount, 0, '', $wallet->code,\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n }\n\n throw new ServerErrorHttpException(\"It wasn't possible to complete the deposit\");\n }\n } else {\n throw new BadRequestHttpException('The wallet ' . $wallet_currency . ' was not found.');\n }\n }\n }", "public static function unlockFunds($from, $amount){\n\t\t$fromuser = \\CouchDB::getDoc($from, \"users\");\n\t\tif ($fromuser->wallet->locked < $amount){\n\t\t\t//you broke dawg\n\t\t\treturn \\Shared\\Error::handleError(\"nofunds\");\n\t\t}else{\n\t\t\t$response = Dogecoin::move(\"LOCKED-FEE\", $from, $amount);\n\t\t\t$fromuser->wallet->locked -= $amount;\n\t\t\t$response = \\CouchDB::setDoc($fromuser, \"users\");\n\t\t\treturn $amount;\n\t\t}\n\t\t//something went wrong, but i have no idea what that might be.\n\t\treturn 0;\n\t}", "public function transferBalance($currency, $amount, $fromAccount, $toAccount) {\n return $this->trading([\n 'command' => 'transferBalance',\n 'currency' => $currency,\n 'amount' => $amount,\n 'fromAccount' => $fromAccount,\n 'toAccount' => $toAccount,\n ]);\n }", "public function actionCreate()\n {\n $model = new Transfer();\n $model->from = Yii::$app->request->get('user_id');\n $autocomplete = [];\n $users = User::find()->all();\n foreach( $users as $user) :\n $autocomplete[] = $user->username;\n endforeach;\n\n if ($model->load(Yii::$app->request->post())) {\n $transaction = Yii::$app->getDb()->beginTransaction();\n try{\n $model->created_at = time('U');\n // if transition is for the non-existing user\n if (!User::find()->where(['username' => $model->to])->exists()) :\n (new User([\n 'username' => $model->to,\n 'created_at' => date('U'),\n ]))->save();\n endif;\n $model->to = User::find()->where(['username' => $model->to])->one()->id;\n $model->save();\n // decreasing sender's balance\n $balance_sender = Balance::find()->where(['user_id' => $model->from])->one();\n $balance_sender->balance = $balance_sender->balance - $model->amount;\n $balance_sender->modified_at = date('U');\n $balance_sender->save();\n // increasing receiver's balance\n if(!Balance::find()->where(['user_id' => $model->to])->exists()) :\n (new Balance([\n 'user_id' => $model->to,\n 'balance' => $model->amount,\n 'modified_at' => date('U'),\n ]))->save();\n else :\n $balance_receiver = Balance::find()->where(['user_id' => $model->to])->one();\n $balance_receiver->balance = $balance_receiver->balance + $model->amount;\n $balance_receiver->modified_at = date('U');\n $balance_receiver->save();\n endif;\n $transaction->commit();\n } catch (Exception $e) {\n $transaction->rollBack();\n throw new $e;\n }\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'autocomplete' => $autocomplete,\n ]);\n }\n }", "public function actionTransfer()\n {\n $ticketModel = Tickets::find()->where(['id' => Yii::$app->request->get('id')])->one();\n\n $users = Appusers::findBySql('SELECT id, username FROM appusers')->all();\n\n $userList = ArrayHelper::map($users,'id', 'username');\n\n if ($ticketModel->load(Yii::$app->request->post()) && $ticketModel->save()) {\n return $this->redirect(['view', 'id' => $ticketModel->id]);\n }\n\n return $this->render('transfer', [\n 'ticketModel' => $ticketModel,\n 'userList' => $userList\n ]);\n }", "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 actionWithdrawMoney()\n {\n // Recevei the POST params\n $request = Yii::$app->request;\n $user_id = $request->post('user_id');\n $amount_currency = $request->post('amount_currency');\n $wallet_currency = $request->post('wallet_currency');\n $amount = $request->post('amount');\n\n // Check the mandatory fields\n if (empty($user_id)) {\n throw new BadRequestHttpException('The user ID must be informed.');\n } else if (empty($amount_currency)) {\n throw new BadRequestHttpException('The amount currency must be informed.');\n } else if (empty($wallet_currency)) {\n throw new BadRequestHttpException('The wallet currency must be informed.');\n } else if (empty($amount)) {\n throw new BadRequestHttpException('The amount must be informed.');\n } else {\n // Prepare the input\n $amount = floatval($amount);\n $amount_currency = strtoupper($amount_currency);\n $wallet_currency = strtoupper($wallet_currency);\n\n // Try to retrieve the wallet info\n $wallet = Wallet::find()->where(['user_id' => $user_id])->andWhere(['currency' => $wallet_currency])->one();\n\n // Check if the wallet exists\n if (isset($wallet) && !empty($wallet)) {\n // Check if needs to convert\n if (strcmp($amount_currency, $wallet_currency) != 0) {\n // Gets the new currency quotation\n $result = $this->actionConvertCurrency($amount_currency, $wallet_currency, $amount);\n\n // Check if the conversion happend succesfully\n if (isset($result) && !empty($result)) {\n // Check if the wallet have enough fund\n if ($wallet->balance >= $result['converted_amount']) {\n // Perform the balance withdraw with conversion\n $wallet->balance -= $result['converted_amount'];\n } else {\n // Log the transaction as complete\n $this->logTransaction(Transaction::WITHDRAW, $amount, $result['converted_amount'], $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n\n throw new BadRequestHttpException('The wallet ' . $wallet_currency . ' does not have enough fund for this operation.');\n }\n } else {\n throw new HttpException('It was not possible to contact the currency exchange server.');\n }\n } else {\n // Check if the wallet have enough fund\n if ($wallet->balance >= $amount) {\n // Perform the balance withdraw without conversion\n $wallet->balance -= $amount;\n } else {\n // Log the transaction as incomplete\n $this->logTransaction(Transaction::WITHDRAW, $amount, 0, $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n\n throw new BadRequestHttpException('The wallet ' . $wallet_currency . ' does not have enough fund for this operation.');\n }\n }\n\n // Update the the wallet balance\n if ($wallet->save()) {\n // Log the transaction as complete\n if (isset($result) && !empty($result)) {\n $this->logTransaction(Transaction::WITHDRAW, $amount, $result['converted_amount'], $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::COMPLETE);\n } else {\n $this->logTransaction(Transaction::WITHDRAW, $amount, 0, $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::COMPLETE);\n }\n\n // Return the wallet updated\n return $wallet;\n } else {\n // Log the transaction as incomplete\n if (isset($result) && !empty($result)) {\n $this->logTransaction(Transaction::WITHDRAW, $amount, $result['converted_amount'], $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n } else {\n $this->logTransaction(Transaction::WITHDRAW, $amount, 0, $wallet->code, '',\n $amount_currency, $wallet_currency, Transaction::INCOMPLETE);\n }\n\n throw new ServerErrorHttpException(\"It wasn't possible to complete the withdraw\");\n }\n } else {\n throw new BadRequestHttpException('The wallet ' . $wallet_currency . ' was not found.');\n }\n }\n }", "public function getAmountTransfers($id){\n\n $amountWallets = Wallets::select('amount')->where('id',$id)->get();\n\n return $amountWallets[0]->amount;\n \n }", "function receive($details,$accountID=0){\n\t\n\tglobal $dz;\n\t\n\tif($accountID==0){\n\t\t\n\t\t// Get the receiving username:\n\t\t$user=$details['Username'];\n\t\t\n\t\t// Get the account ID of the receiving user:\n\t\t$receiver=$dz->get_row('select `ID`,`FullName` from `Bank.Accounts` where `Username`=\"'.$user.'\"');\n\t\t\n\t\tif(!$receiver){\n\t\t\t\n\t\t\t// We don't know of this account!\n\t\t\terror('username/notfound');\n\t\t\t\n\t\t}\n\t\t\n\t\t// Add name?\n\t\tif(isset($details['AddName']) && $details['AddName']){\n\t\t\t\n\t\t\t// Add their name too:\n\t\t\t$details['Name']=$receiver['FullName'];\n\t\t\t\n\t\t}\n\t\t\n\t\t// Get the account ID:\n\t\t$accountID=$receiver['ID'];\n\t\t\n\t}\n\t\n\t// The from username (optional):\n\t$fromUser=isset($details['FromUsername']) ? $details['FromUsername'] : '';\n\t\n\t// Get the commodity:\n\t$commodity=$details['Commodity'];\n\t\n\t// Get the amount:\n\t$amount=$details['Amount'];\n\t\n\t// Get or create the balance row now:\n\t$row=$dz->get_row('select `ID` from `Bank.Account.Balances` where `Account`='.$accountID.' and `Commodity`=\"'.$commodity.'\"');\n\t\n\t// The row ID:\n\t$balanceID=0;\n\t\n\tif($row){\n\t\t\n\t\t// The row exists; get the ID:\n\t\t$balanceID=$row['ID'];\n\t\t\n\t\t// Update it's locked amount:\n\t\t$dz->query('update `Bank.Account.Balances` set `LockedAmount`=`LockedAmount`+'.$amount.' where ID='.$balanceID);\n\t\t\n\t}else{\n\t\t\n\t\t// Create the balance row:\n\t\t$dz->query('insert into `Bank.Account.Balances`(`Account`,`Commodity`,`LockedAmount`) values ('.$accountID.',\"'.$commodity.'\",'.$amount.')');\n\t\t\n\t\t// Update balanceID:\n\t\t$balanceID=$dz->insert_id();\n\t\t\n\t}\n\t\n\t// Create a transaction row:\n\t$dz->query(\n\t\t'insert into `Bank.Transactions`(`Account`,`Type`,`Reference`,`ItemInformation`,`Amount`,`Commodity`,`Username`,`Title`,`TimeAt`,`Name`) values('.\n\t\t$accountID.',1,\"'.escape($details['Reference'],false).'\",\"'.escape($details['ItemInformation'],false).'\",'.$amount.',\"'.$commodity.'\",\"'.$fromUser.'\",\"'.escape($details['Title'],false).'\",'.time().',\"'.escape($details['Name'],false).'\")');\n\t\n\t// Unlock the balance; a LockedAmount of 0 essentially means the balance is valid (i.e. this completed without crashing):\n\t$dz->query('update `Bank.Account.Balances` set `LockedAmount`=`LockedAmount`-'.$amount.',`Amount`=`Amount`+'.$amount.' where ID='.$balanceID);\n\t\n}", "public function payrent($from,$to,$rent){\n $to->collect($from->pay($rent));\n }", "public function transferReservation(Request $request)\n {\n request()->validate([\n 'number_people' => 'required',\n ]);\n \n $transfer_id = $request->transfer_id;\n $user_id = $request->User()->id;\n $number_people = $request->number_people;\n\n //To obtain the transfer\n $transfer = Transfer::find($transfer_id);\n\n //To obtain the open reservation of the user\n $reservation = Reservation::where([\n ['user_id', $user_id],\n ['closed', false],\n ])->first();\n\n //In case the transfer was already reserved by the user\n if($number_people > $transfer->transfer_car->capacity or $number_people <= 0)\n {\n return back()->withErrors(['The amount of people is not available']);\n }\n else if ($transfer->reservations()->where('transfer_id',$transfer->id)->exists())\n {\n return back()->withErrors(['You have already reserved this transfer']);\n }\n else{\n\n //Adding the transfer reservation on the pivot table\n $reservation->transfers()->attach($transfer_id,['closed' => false]);\n $transfer->number_people = $number_people;\n $transfer->save();\n\n //Updating balance on the reservation\n $current_balance = floatval(preg_replace('/[^\\d\\.]/', '', $reservation->current_balance));\n $transfer_price = floatval(preg_replace('/[^\\d\\.]/', '', $transfer->price));\n\n $current_balance += $transfer_price;\n $reservation->current_balance = money_format('%i',$current_balance);\n $reservation->save();\n\n return redirect()->route('user.shopping_cart');\n }\n }", "private function sellTrasactionPendingAddsMoney(){\n\n }", "function payNOw(){\n $from = $_SESSION['user']['id'];\n $to = $_POST['to_user'];\n $amount = $_POST['amount'];\n $description= $_POST['description'];\n\n //from user money update(-)\n $fromUserDetail = user($from);\n $leftMoney = $fromUserDetail['money']-$amount;\n if($fromUserDetail['money'] >= $amount || $fromUserDetail['money'] >= 0){\n $sql = \"UPDATE users SET money=$leftMoney WHERE id=$from\";\n mysqli_query(con(),$sql);\n\n //to user money update(+)\n $toUserDetail =user($to);\n $newMoney = $toUserDetail['money']+$amount;\n $sql = \"UPDATE users SET money=$newMoney WHERE id=$to\";\n mysqli_query(con(),$sql);\n\n //add to transitoion table\n $sql =\"INSERT INTO transition (from_user,to_user,amount,description) VALUES ('$from','$to','$amount','$description')\";\n run_query($sql);\n }\n else{\n echo alert(\"Error\");\n }\n}", "public function ltcSend(Request $request)\r\n {\r\n $address = $request->input('address', '');\r\n $money = $request->input('money', '');\r\n $password = $request->input('password', '');\r\n $password = $request->input('currency_id', '');\r\n $user_id = Users::getUserId(request()->input(\"user_id\"));\r\n $user = Users::find($user_id);\r\n $wallet = UsersWallet::where('user_id', $user_id)->first();\r\n if (empty($address) || empty($money) || $money < 0 || empty($wallet)) {\r\n return $this->error('Parameter Error');\r\n }\r\n if ($wallet->password != $password) {\r\n return $this->error('Payment Password Error');\r\n }\r\n $userWallet = UsersWallet::where('user_id',$user_id)->where('token','PB')->first();\r\n if ($money > $userWallet->balance) {\r\n return $this->error('Sorry, Your Credit Is Running Low');\r\n }\r\n // $user = Users::find($user_id);\r\n\r\n // $key = md5(time());\r\n $set_url = Settings::getValueByKey('send_url', '');\r\n if (empty($set_url)) {\r\n return $this->error('Parameter Error');\r\n }\r\n DB::beginTransaction();\r\n try {\r\n $userWallet->change_balance = $userWallet->change_balance - $money;\r\n $userWallet->save();\r\n AccountLog::insertLog([\r\n 'user_id' => $user_id,\r\n 'value' => $money,\r\n 'info' => 'Transfer To Exchange Wallet',\r\n 'type' => AccountLog::LTC_SEND\r\n ]);\r\n\r\n $url = $set_url . \"/api/getLtcKMB?address=\" . $address . \"&money=\" . $money;\r\n $data = RPC::apihttp($url);\r\n $data = @json_decode($data, true);\r\n if ($data[\"type\"] != 'ok') {\r\n DB::rollBack();\r\n return $this->error($data[\"message\"]);\r\n }\r\n DB::commit();\r\n return $this->success('Transfer Successful');\r\n } catch (\\Exception $rex) {\r\n DB::rollBack();\r\n\r\n return $this->error($rex);\r\n }\r\n }", "public function sendTransferCode($post)\n {\n $response = array();\n //Get user details By token\n $userData = $this->getUserModel()->getUserByToken($post['token']);\n //Get Local user details By PhoneNo\n $localUserData = $this->getUserModel()->getLocalUserByTransferCode($post['code']);\n $currentDate = $this->getAppService()->getDate();\n //Check Request Code\n if (count($localUserData)) {\n //check account status\n if ($localUserData['accountStatus'] == 'Active') {\n //check request Bal\n if ($localUserData['avaiPurchaseBal'] >= $localUserData['balReq']) {\n \n //START TRANSACTION\n $em = $this->getController()->getServiceLocator()->get('doctrine.entitymanager.orm_default');\n try {\n $em->getConnection()->beginTransaction();\n \n //check date records exist if not then create new if Yes then use Id\n $getTicketDate = $this->getTicketDateModel()->getTicketDate($userData['Id'],$currentDate);\n\n if (count($getTicketDate) == 0) {\n //create Date Records\n $dateData = array (\n 'userId' => $userData['Id'],\n 'drawDate' => $currentDate,\n 'openingBal' => $userData['avaiTransBal'],\n );\n\n $getDateEntity = $this->getTicketDateModel()->createTicketDate($dateData);\n $dateId = $getDateEntity->Id;\n } else {\n $dateId = $getTicketDate['Id'];\n }\n \n $localUser = array (\n 'avaiPurchaseBal' => $localUserData['avaiPurchaseBal'] - $localUserData['balReq'],\n 'balReqCode' => 0,\n 'balReq' => 0\n );\n //cut balance from Local user account\n $this->getUserModel()->updateUser($localUserData['Id'],$localUser);\n\n\n $agentUser = array (\n 'avaiTransBal' => $userData['avaiTransBal'] + $localUserData['balReq'],\n );\n //Update Agent user balance.\n $this->getUserModel()->updateUser($userData['Id'],$agentUser);\n\n\n $notificationData = array (\n 'reqFrom' => $userData['Id'],\n 'reqTo' => $localUserData['Id'],\n 'requestedName' => $userData['name'],\n 'message' => 'Reject chips : '.$localUserData['balReq'].' success',\n 'date' => $this->getAppService()->getDateTime()\n ); \n //set notification message\n $this->getNotificationModel()->createNotification($notificationData);\n\n $transactionData = array (\n 'dateId' => $dateId,\n 'userId' => $localUserData['Id'],\n 'agentId' => $userData['Id'],\n 'transBalance' => $localUserData['balReq'],\n 'transType' => 'Debit',\n 'time' => $this->getAppService()->getTime()\n );\n //create Transaction report\n $this->getTransactionModel()->createTransaction($transactionData);\n\n $response['status'] = 'success';\n $response['message'] = 'Chips recieve successfully From : '.$localUserData['phoneNo'];\n $response['bal'] = $userData['avaiTransBal'] + $localUserData['balReq'];\n $em->getConnection()->commit();\n } catch (\\Exception $e) {\n $em->getConnection()->rollback();\n $response['status'] = 'error';\n $response['message'] = 'Internal Error. Please try agaign.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User does not have efficient chips.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User account deactivated by Admin.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = 'Request code not found. If you fail more time then your account will be Block.';\n }\n \n return $response;\n }", "public static function updateTransfer($db,$table_prefix,$update,$transfer_id,&$error)\n {\n $error = '';\n $output = [];\n \n $table_transfer = $table_prefix.'transfer';\n $table_transfer_item = $table_prefix.'transfer_item';\n\n $transfer = self::get($db,$table_prefix,'transfer',$transfer_id);\n \n if($update === 'TOTALS') {\n $sql = 'SELECT COUNT(*) AS item_no,SUM(total_kg) AS total_kg '.\n 'FROM '.$table_transfer_item.' '.\n 'WHERE transfer_id = \"'.$db->escapeSql($transfer_id).'\" ';\n $totals = $db->readSqlRecord($sql);\n \n $sql = 'UPDATE '.$table_transfer.' '.\n 'SET item_no = \"'.$totals['item_no'].'\", '.\n 'total_kg = \"'.$totals['total_kg'].'\" '.\n 'WHERE transfer_id = \"'.$db->escapeSql($transfer_id).'\" ';\n $db->executeSql($sql,$error); \n }\n\n if($update === 'CONFIRM') {\n if($transfer['status'] !== 'NEW') {\n $error .= 'Cannot CONFIRM a transfer unless status = NEW';\n } else {\n $db->executeSql('START TRANSACTION',$error_tmp);\n if($error_tmp !== '') {\n $error .= 'Could not START Transfer confirm transaction';\n } else { \n $sql = 'SELECT data_id,stock_id,quantity,total_kg,status '.\n 'FROM '.$table_transfer_item.' WHERE transfer_id = \"'.$db->escapeSql($transfer_id).'\" ';\n $items = $db->readSqlarray($sql);\n foreach($items as $data_id => $item) {\n\n Helpers::updateStockInStore($db,$table_prefix,$transfer['to_store_id'],$item['stock_id'],$item['quantity'],$error_tmp);\n if($error_tmp !== '') {\n $error .= 'We could not update TO Store amounts for stock ID['.$item['stock_id'].'] ';\n if(DEBUG) $error .= $error_tmp;\n } else {\n $sql = 'UPDATE '.$table_transfer_item.' SET status = \"CONFIRMED\" '.\n 'WHERE data_id = \"'.$db->escapeSql($data_id).'\" ';\n $db->executeSql($sql,$error_tmp);\n if($error_tmp !== '') $error .= 'We could not CONFIRM transfer ID['.$transfer_id.'] ';\n }\n\n /*\n Helpers::updateStockTransfered($db,$table_prefix,'TO',$transfer['from_store_id'],$transfer['to_store_id'],$item['stock_id'],$item['quantity'],$error_tmp);\n if($error_tmp !== '') {\n $error .= 'We could not update TO Store amounts for stock ID['.$item['stock_id'].'] ';\n } else {\n $sql = 'UPDATE '.$table_transfer_item.' SET status = \"CONFIRMED\" '.\n 'WHERE data_id = \"'.$db->escapeSql($data_id).'\" ';\n $db->executeSql($sql,$error_tmp);\n if($error_tmp !== '') $error .= 'We could not CONFIRM transfer ID['.$transfer_id.'] ';\n }\n */\n }\n } \n\n if($error === '') {\n $sql = 'UPDATE '.$table_transfer.' SET status = \"CONFIRMED\" '.\n 'WHERE transfer_id = \"'.$db->escapeSql($transfer_id).'\" ';\n $db->executeSql($sql,$error_tmp);\n if($error_tmp !== '') $error .= 'We could not CONFIRM transfer ID['.$transfer_id.']';\n }\n\n if($error !== '') {\n $db->executeSql('ROLLBACK',$error_tmp);\n if($error_tmp !== '') $error .= 'Could not ROLLBACK transfer confirm transaction';\n } else {\n $db->executeSql('COMMIT',$error_tmp);\n if($error_tmp !== '') $error .= 'Could not COMMIT transfer confirm transaction';\n }\n }\n }\n \n \n if($error !== '') return false; else return true;\n }", "function debit_transaction($order_id, $amount, $currency, $txn_id, $reason, $origin) {\n\n\t\n\t$type = \"DEBIT\";\n\t$date = (gmdate(\"Y-m-d H:i:s\"));\n// check to make sure that there is no debit for this transaction already\n\n\t$sql = \"SELECT * FROM transactions where txn_id='$txn_id' and `type`='DEBIT' \";\n\t$result = mysql_query($sql) or die(mysql_error().$sql);\n\tif (mysql_fetch_array($result)==0) {\n\t\t$sql = \"INSERT INTO transactions (`txn_id`, `date`, `order_id`, `type`, `amount`, `currency`, `reason`, `origin`) VALUES('$txn_id', '$date', '$order_id', '$type', '$amount', '$currency', '$reason', '$origin')\";\n\n\t\t$result = mysql_query ($sql) or die (mysql_error().$sql);\n\t}\n\n\n}", "public static function convertAmount($sourceId, $targetId, $amount, $transferType)\n {\n $funds = 0.0;\n if ($transferType == 1) {\n // Tenant Account Process\n $getTargetBaseCurrency = PartnerSetting::with('currency.currencyList')->where('partner_id', $targetId)->first();\n if ($getTargetBaseCurrency) {\n // Calculation Process => Convert Transaction Amount of Tenant to Partner Currency\n $funds = $amount * $getTargetBaseCurrency->currency->CurrentRate;\n }\n return ['converted_funds' => $funds, 'partners_currency' => $getTargetBaseCurrency->currency->currencyList->currency, 'currency_rate' => $getTargetBaseCurrency->currency->CurrentRate, 'partners_currency_id' => $getTargetBaseCurrency->currency->Id];\n } elseif ($transferType == 2) {\n // Partner Account Process\n $getTargetBaseCurrency = Currency::where('Tenant_Id', Auth::user()->TenantId)->where('isBaseCurrency', 1)->with('currencyList')->first();\n // GeneralFunctions::ajax_debug($getTargetBaseCurrency);\n return ['tenant_currency' => $getTargetBaseCurrency->currencyList->currency, 'currency_rate' => $getTargetBaseCurrency->CurrentRate, 'tenant_currency_id' => $getTargetBaseCurrency->Id];\n } else {\n // Partner to Partner Account Process\n $getTargetBaseCurrency = PartnerSetting::with('currency.currencyList')->where('partner_id', $targetId)->first();\n if ($getTargetBaseCurrency) {\n // Calculation Process => Convert Transaction Amount of Partner to Base Partner Currency\n $getTenantBaseCurrency = Currency::where('Tenant_Id', Auth::user()->TenantId)->where('isBaseCurrency', 1)->with('currencyList')->first();\n $funds = ($amount / $getTenantBaseCurrency->CurrentRate) * $getTargetBaseCurrency->currency->CurrentRate;\n }\n return ['converted_funds' => $funds, 'partners_currency' => $getTargetBaseCurrency->currency->currencyList->currency, 'currency_rate' => $getTargetBaseCurrency->currency->CurrentRate, 'partners_currency_id' => $getTargetBaseCurrency->currency->Id];\n }\n }", "function payCheq($connection,$cheq_ref){\r\n\r\n //pay cheque\r\n $sql = \"SELECT accno ,debit,cheqto,cheq_amount FROM _transactionshistory WHERE check_ref=:cheq_ref AND cheqpaid=0 \";\r\n $stmt = $connection->prepare($sql);\r\n $stmt->execute(array(':cheq_ref'=>$cheq_ref));\r\n $row = $stmt->fetch();\r\n // echo $row['debit'];\r\n if($row['cheq_amount']>0){\r\n //deduct drawer amount debited + charges and update balance\r\n try {\r\n\r\n $connection->beginTransaction();\r\n //balance before debit and charges\r\n $balance = Services::getforAccountsBalance($connection,$row['accno']);\r\n $payee_sql = \"UPDATE _accounts SET balance= :balance WHERE accno = :account\";\r\n $charges = Services::charges($row['cheq_amount']);\r\n $stmt = $connection->prepare($payee_sql);\r\n $stmt->execute(array(':balance'=>$balance-$row['cheq_amount']-$charges,':account'=>$row['accno']));\r\n\r\n //get account to pay to\r\n $payee_balSQL = \"SELECT balance FROM _accounts WHERE accno=:payee_acc\";\r\n $statement_p = $connection->prepare($payee_balSQL);\r\n\r\n $statement_p->execute(array(':payee_acc'=>$row['cheqto']));\r\n $payee_bal = $statement_p->fetch();\r\n\r\n //update payee account balance\r\n $update_accounts = \"UPDATE _accounts SET balance=:bala WHERE accno=:acc\";\r\n $up_stmt = $connection->prepare($update_accounts);\r\n $new_bal = $payee_bal['balance']+$row['cheq_amount'];\r\n $up_stmt->execute(array(':bala'=>$new_bal,':acc'=>$row['cheqto']));\r\n\r\n //record the transaction history\r\n $history_sql = \"INSERT INTO _transactionshistory (accno,date,debit,credit,check_ref,cancelled_cheque,balance) VALUES(:accno,:date,:debit,:credit,:check_ref,:cancelled,:balance)\";\r\n $history_stmt = $connection->prepare($history_sql);\r\n $history_stmt->execute(array(':accno'=>$row['cheqto'],':date'=>date(\"Y/m/d\"),':debit'=>0,':credit'=>$row['cheq_amount'],\r\n ':check_ref'=>$cheq_ref,':cancelled'=>1,':balance'=>$new_bal));\r\n\r\n //record drawer transaction details for drawer\r\n $history_sql2 = \"INSERT INTO _transactionshistory (accno,date,debit,credit,check_ref,charges,cancelled_cheque,balance) VALUES(:accno,:date,:debit,:credit,:check_ref,:charges,:cancelled,:balance)\";\r\n $history_stmt2 = $connection->prepare($history_sql2);\r\n $history_stmt2->execute(array(':accno'=>$row['accno'],':date'=>date(\"Y/m/d\"),':debit'=>$row['cheq_amount'],':credit'=>0,\r\n ':check_ref'=>$cheq_ref,':charges'=>$charges,':cancelled'=>1,':balance'=>$balance-$row['cheq_amount']-$charges));\r\n\r\n\r\n //mark cheque as paid\r\n $t_sql = \"UPDATE _transactionshistory SET cheqpaid=1 WHERE check_ref=:cheq_ref\";\r\n $t_stmt = $connection->prepare($t_sql);\r\n $t_stmt->execute(array(':cheq_ref'=>$cheq_ref));\r\n // if($payee_sql->rowCount()<1 && $up_stmt->rowCount()<1 && $history_stmt->rowCount()<1 && $up_stmt->rowCount()<1){\r\n // $connection->rollBack();\r\n // return false;\r\n // }\r\n $connection->commit();\r\n\r\n return true;\r\n\r\n } catch (Exception $e) {\r\n $connection->rollBack();\r\n //echo \"Failed: \" . $e->getMessage();\r\n return false;\r\n }\r\n }\r\n\r\n return false;\r\n }", "public function transfer($id)\n {\n return $this->get(\"ach/transfers/{$id}\");\n }", "public function action_account_transaction() {\n $package = Model::factory('package');\n $invoice_id = explode('/', $_SERVER['REQUEST_URI']);\n $transaction_info = $package->account_transaction($invoice_id[3]);\n $this->template->title = CLOUD_SITENAME . ' | Account';\n $this->template->page_title = __('account_transaction_details');\n $this->meta_description = \"\";\n $this->template->content = View::factory(\"admin/package_plan/account_transaction\")\n ->bind('transaction_info', $transaction_info);\n }", "function getTransfers($user){\r\n\t\t$transfers=array();\r\n\r\n\r\n $db_players=new ConnectDatabasePlayers($this->mysqli);\r\n\r\n $players=$db_players->dumpSingoliToList(null,null);\r\n \r\n $id_user = $user;\r\n \r\n\r\n\t\ttry{\r\n\t\t\t$tempQuery=\"Select * , UNIX_TIMESTAMP(date) as time from `transfers` where id_user=? order by date ASC\";\r\n\r\n\t\t\tif(!($stmt = $this->mysqli->prepare($tempQuery))) {\r\n\t\t\t echo \"Prepare failed: (\" . $this->mysqli->errno . \") \" . $this->mysqli->error;\r\n\t\t\t}\r\n\r\n\t\t\tif (!$stmt->bind_param(\"i\", $id_user)) {\r\n\t\t\t echo \"Binding parameters failed: (\" . $stmt->errno . \") \" . $stmt->error;\r\n\t\t\t}\r\n\r\n\t\t\tif (!$stmt->execute()) {\r\n\t\t\t echo \"Execute failed: (\" . $stmt->errno . \") \" . $stmt->error;\r\n\t\t\t}\r\n \r\n\t\t\t$res=$stmt->get_result();\r\n\t\t\t$res->data_seek(0);\r\n\t\t\t\r\n\t\t\twhile ($row = $res->fetch_assoc()) {\r\n\t\t\t\t$id=$row['id_transfer'];\r\n\t\t\t\t$old_cost=$row['old_player_cost'];\r\n\t\t\t\t$new_cost=$row['new_player_cost'];\r\n\t\t\t\t$old_player=new RosterPlayer($db_players->dumpPlayerById(intval($row['id_old_player'])),$old_cost);\r\n\t\t\t\t$new_player=new RosterPlayer($db_players->dumpPlayerById(intval($row['id_new_player'])),$new_cost);\r\n\t\t\t\t$datetemp = date (\"Y-m-d H:i:s\", $row['time']);\r\n\t\t\t\t$date=new DateTime($datetemp);;\r\n\t\t\t\t$id_market=$row['id_market'];\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t$free = $row[\"free\"];\r\n\t\t\t\t\r\n \r\n\t\t\t\t$transfers[$id]=new Transfer($id,$user,$id_market,$old_player,$new_player,$date,$free);\r\n\t\t\t}\r\n\r\n\t\t\treturn $transfers;\r\n\r\n\r\n\t\t}catch(exception $e) {\r\n\t\t\techo \"\\nERRORE DUMP TRANSFERS: \".$e;\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public function deposit()\n {\n UserModel::authentication();\n\n //get the session user\n $user = UserModel::user();\n\n //initiate the wallets; going to find a better way to do it\n $deposit = PaymentModel::depositcoin();\n\n //$btcdeposit = $this->model->btcwallet($user->username,'');\n\n $this->View->Render('dashboard/deposit', ['deposit' => $deposit, 'user' => $user]);\n }", "function alta_transferencia(){\n\t\t$u= new Cl_pedido();\n\t\t$u->empresas_id=$GLOBALS['empresa_id'];\n\t\t$u->cclientes_id=$GLOBALS['empresa_id'];\n\t\t$u->fecha_alta=date(\"Y-m-d H:i:s\");\n\t\t//Sincronizar con fecha de salida&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&\n\t\t$u->usuario_id=$GLOBALS['usuarioid'];\n\t\t$u->ccl_estatus_pedido_id=2;\n\t\t$u->corigen_pedido_id=3;\n\t\t$u->ccl_tipo_pedido_id=2;\n\t\t// save with the related objects\n\t\tif($_POST['id']>0){\n\t\t\t$u->get_by_id($_POST['id']);\n\t\t\t$insert_traspaso_salida=0;\n\t\t} else {\n\t\t\t$insert_traspaso_salida=1;\n\t\t}\n\t\t$u->trans_begin();\n\t\tif($u->save()) {\n\t\t\t$cl_pedido_id=$u->id;\n\t\t\tif($insert_traspaso_salida==1) {\n\t\t\t\t//Dar de alta el traspaso\n\t\t\t\t$t= new Traspaso();\n\t\t\t\t$t->cl_pedido_id=$cl_pedido_id;\n\t\t\t\t$t->traspaso_estatus=1;\n\t\t\t\t$t->ubicacion_entrada_id=$_POST['ubicacion_entrada_id'];\n\t\t\t\t$t->ubicacion_salida_id=$_POST['ubicacion_salida_id'];\n\t\t\t\t$t->trans_begin();\n\t\t\t\t$t->save();\n\t\t\t\tif ($t->trans_status() === FALSE) {\n\t\t\t\t\t// Transaction failed, rollback\n\t\t\t\t\t$t->trans_rollback();\n\t\t\t\t\t$u->trans_rollback();\n\t\t\t\t\t// Add error message\n\t\t\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\t\t\techo '<button type=\"submit\" style=\"display:none;\" id=\"boton1\">Intentar de nuevo</button><br/>';\n\t\t\t\t\techo \"El alta del traspaso no pudo registrarse, intente de nuevo\";\n\t\t\t\t} else {\n\t\t\t\t\t// Transaction successful, commit\n\t\t\t\t\t$u->trans_commit();\n\t\t\t\t\t$t->trans_commit();\n\t\t\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\t\t\techo '<p id=\"response\">Capturar los detalles del pedido</p><button type=\"submit\" id=\"boton1\" style=\"display:none;\" id=\"boton1\">';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//Actualisar unicamente la tabla de los detalles\n\t\t\t\t$u->trans_commit();\n\t\t\t\techo form_hidden('id', \"$u->id\");\n\t\t\t\techo '<p id=\"response\">Capturar los detalles del pedido</p><button type=\"submit\" id=\"boton1\" style=\"display:none;\" id=\"boton1\">';\n\t\t\t}\n\t\t} else {\n\t\t\t$u->trans_rollback();\n\t\t\tshow_error(\"\".$u->error->string);\n\t\t}\n\t}", "public function doAcceptTransfer($iClient = 0, $iAccount = 0, $fromDate = null, $toDate = null, $iOperation = 0) {\n if ($iOperation == 0) {\n $this->redirect('ctransaction/showTransferList/', 'Nebyla zvolena operace', 3);\n }\n $oOperation = $this->moperation->getById($iOperation);\n $oOperation->state = 1;\n $oOperation->employee = $_SESSION['user_id'];\n $oOperation->update();\n $this->redirect('ctransaction/showTransferList/'.$iClient.'/'.$iAccount.'/'.$fromDate.'/'.$toDate, 'Převod byl schválen', 1);\n }", "public function actionCreate($amountFrom = null, $exchangeId = null, $amount = null){\n\n if (!Yii::$app->session['amountFrom']) {\n return $this->redirect(['//site/index']);\n }\n\n $model = new Transaction();\n\n if ($model->load(Yii::$app->request->post())){\n $load = Yii::$app->request->post();\n \n $model->clientId = Yii::$app->user->id;\n\n // Exchange Rate Used\n $er = ExchangeRate::find()->where(['id' => $load['Transaction']['exchangeId']])->one();\n $model->currencyIdFrom = $er->currencyIdFrom;\n $model->currencyIdTo = $er->currencyIdTo;\n $model->sellRateValue = $er->sellValue;\n $model->buyRateValue = $er->buyValue;\n \n // Check if I should multiply or divide according to the \"base\" currency (id=1)\n // Multiply\n if ($model->currencyIdFrom == 1){\n $model->amountTo = $model->amountFrom*$model->sellRateValue;\n $model->usedValue = $model->sellRateValue;\n $model->winnings = ($model->amountTo/$model->sellRateValue) - ($model->amountTo/$model->buyRateValue);\n }\n // Divide\n else if ($model->currencyIdTo == 1){\n $model->amountTo = $model->amountFrom/$model->sellRateValue;\n $model->usedValue = $model->sellRateValue;\n $model->winnings = ($model->amountFrom/$model->buyRateValue) - $model->amountTo;\n }\n // For the future...\n else {\n $model->amountTo = $model->amountFrom*$model->sellRateValue;\n $model->usedValue = $model->sellRateValue;\n $model->winnings = ($model->amountTo/$model->sellRateValue) - ($model->amountTo/$model->buyRateValue);\n }\n \n // Look for the account the user tranfered the money to and update the available amount of money\n //$accountAdmin = AccountAdmin::find()->where(['id' => $load['Transaction']['accountAdminId']])->one();\n \n // Look for the available amount of money in every account of the To \n //$accountAdmin = new AccountAdmin();\n //$accounts = $accountAdmin->getAccountsAvailableMoney($model->amountTo);\n \n // Available money in all of the accounts\n $accountAdmin = new AccountAdmin();\n $available = $accountAdmin->getAmountSumByCurrency($er->currencyIdTo);\n \n // If the account \"has\" the money... continue\n if ($available['total'] >= $model->amountTo){\n $model->transactionDate = Yii::$app->formatter->asDate($_POST['Transaction']['transactionDate'], 'yyyy-MM-dd');\n \n // Transaction receipt\n $upload_file = UploadedFile::getInstance($model, 'uploadFile');\n\n if (!empty($upload_file) && $upload_file->size !== 0){\n\n if ($model->validate()){\n if ($model->save()){\n\n $fileName = 't-' . $model->id . '.' . $upload_file->extension;\n $model->uploadFile = $fileName;\n $model->save();\n\n $upload_file->saveAs('uploads/' . $fileName);\n\n /**\n * Unsets the session variables\n */\n\n Yii::$app->session->remove('amountFrom');\n Yii::$app->session->remove('currencyIdFrom');\n Yii::$app->session->remove('currencyIdTo');\n\n // \"Substract\" the amountTo from the account\n //$accountAdmin->maxAmount = $accountAdmin->maxAmount - $model->amountTo;\n //$accountAdmin->save();\n \n return $this->redirect(['index']);\n }\n else {\n Yii::$app->getSession()->setFlash('error', 'Ha ocurrido un error. Por favor, intente de nuevo.');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }\n else {\n Yii::$app->getSession()->setFlash('error', 'Ha ocurrido un error. Por favor, intente de nuevo.');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }\n else {\n Yii::$app->getSession()->setFlash('error', 'Debe agregar el comprobante de la transacción.');\n return $this->render('create', [\n 'model' => $model,\n ]);\n } \n }\n else {\n Yii::$app->getSession()->setFlash('error','La cantidad solicitada no se encuentra disponible. Por favor pruebe con un monto más bajo.');\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n \n /*$er1 = ExchangeRate::find()->where(['and', ['currencyIdFrom' => $load['Transaction']['currencyIdFrom']], ['currencyIdTo' => $load['Transaction']['currencyIdTo']]])->one();\n \n if ($er1 != null){\n $model->sellRateValue = $er1->sellValue;\n $model->buyRateValue = $er1->buyValue;\n $model->amountTo = $model->amountFrom*$model->sellRateValue;\n $model->usedValue = $er1->sellValue;\n }\n else {\n $er2 = ExchangeRate::find()->where(['and', ['currencyIdFrom' => $load['Transaction']['currencyIdTo']], ['currencyIdTo' => $load['Transaction']['currencyIdFrom']]])->one();\n \n if ($er2 != null){\n $model->sellRateValue = $er2->sellValue;\n $model->buyRateValue = $er2->buyValue;\n $model->amountTo = $model->amountFrom/$model->buyRateValue;\n $model->usedValue = $er2->buyValue;\n } \n }*/ \n }\n else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function getTransfersMoney(){\n \t$listwallets = Wallets::select('id','name')->where('user_id',Auth::user()->id)->get();\n \tif(empty($listwallets)){\n\n \t\treturn redirect('home')->with(['flash_level'=>'success','flash_message'=>'You do not have wallets']);\n\n \t}\n\n \treturn view('quanlytaichinh.transfers-money.transfersMoneyAdd',compact('listwallets'));\n }", "public function balance()\n\t{\n\t\treturn $this->curl('/ovo/balance', Constant::HTTP_POST);\n\t}", "public function itemTransfer($product,$quantity,$from,$to)\n {\n echo $product->getName().','. $quantity.','.$from->getName().','.$to->getName() . '<br />'; \n $entryDebit = $this->newEntry();\n $entryCredit = $this->newEntry();\n \n $entryCredit->setProduct($product)\n ->setInventoryAccount($from)\n ->setCredit($quantity)\n ->setDebit(0);\n \n $entryDebit->setProduct($product)\n ->setInventoryAccount($to)\n ->setDebit($quantity)\n ->setCredit(0);\n \n return [$entryCredit, $entryDebit];\n }", "protected function makePayment(){\n\t \n $receiver = Input::get('number');\n $amounttosend = Input::get('amount');\n $currency = Input::get('currency');\n $destinationProvider = Input::get('target');\n $charges = new PlatformCharges($amounttosend, $currency, $destinationProvider);\n $desc = $charges->getReceiverType($destinationProvider);\n $user = User::find(Auth::user()->id);\n \n $transaction = [\n 'Customer' => [\n 'FirstName' => Auth::user()->name,\n 'Street1' => 'Level 5',\n 'Country' => 'US',\n 'Mobile' => Auth::user()->number,\n 'Email' => Auth::user()->email\n ],\n 'Items' => [\n [\n 'SKU' => mt_rand(),\n 'Description' => 'Hybrid Transfer from EWAY to '.$desc.' user',\n 'Quantity' => 1,\n 'UnitCost' => $charges->convertCurrency($currency, 'AUD',$charges->getDueAmount('ew', $destinationProvider)),\n 'Tax' => 100, //$1 applied as charge to every transaction irrespective of the amount transfered\n // Total is calculated automatically\n ]\n ],\n 'Options' => [\n [\n 'Value' => $desc,//Receipient's payement system\n ],\n [\n 'Value' => $receiver, //receiver's details to which to make the due transfer\n ],\n [\n 'Value' => 'AUD', // currency used to make the transfer when sending to the receipient\n ],\n [\n 'Value' =>(0.01 * $amounttosend)\n ]\n ],\n 'Payment' => [\n 'TotalAmount' => $charges->convertCurrency($currency, 'AUD',$charges->getDueAmount('ew', $destinationProvider)) * 100, //$amounttosend,\n 'CurrencyCode' => 'AUD'\n ],\n 'Method' => 'ProcessPayment',\n 'RedirectUrl' => URL::route('dashboard').'/ewayconfirm',\n 'CancelUrl' => URL::route('dashboard').'/ewaycancel',\n 'PartnerID' => EwayController::$_EWAY_CUSTOMER_ID,\n 'TransactionType' => \\Eway\\Rapid\\Enum\\TransactionType::PURCHASE, //normally would be PURCHASE. Modes are MOTO, Recurring\n 'Capture' => true,\n 'LogoUrl' => 'https://izepay.iceteck.com/public/images/logo.png',\n 'HeaderText' => 'Izepay Money Transfer',\n 'Language' => 'EN',\n 'CustomView' => 'BootstrapCerulean', //Bootstrap, BootstrapAmelia, BootstrapCerulean, BootstrapCosmo, BootstrapCyborg, BootstrapFlatly, BootstrapJournal, BootstrapReadable, BootstrapSimplex, BootstrapSlate, BootstrapSpacelab, BootstrapUnited\n 'VerifyCustomerEmail' => true,\n 'Capture' => true,\n 'CustomerReadOnly' => false\n ];\n try{\n $response = $this->client->createTransaction(\\Eway\\Rapid\\Enum\\ApiMethod::RESPONSIVE_SHARED, $transaction);\n //var_dump($response);\n// echo $response->SharedPaymentUrl;\n //sleep(20);\n }catch(Exception $ex){\n return Redirect::route('dashboard')\n\t\t\t \t->with('alertError', 'Debug Error: '.$ex->getMessage());\n }\n //manage response\n \n if (!$response->getErrors()) {\n // Redirect to the Responsive Shared Page\n header('Location: '.$response->SharedPaymentUrl);\n //die();\n } else {\n foreach ($response->getErrors() as $error) {\n //echo \"Response Error: \".\\Eway\\Rapid::getMessage($error).\"<br>\";\n return Redirect::route('dashboard')\n\t\t\t \t ->with('alertError', 'Error! '.\\Eway\\Rapid::getMessage($error));\n }\n }\n\t}", "public function refund()\n\t{\n\t\trequirePermission(\"canRefund\");\n\n\t\t$id = intval($this->input->get(\"id\"));\n\t\t$costDp = intval($this->input->get(\"costDp\"));\n\t\t$accountId = intval($this->input->get(\"accountId\"));\n\t\t\n\t\tif(!$id || !is_numeric($id))\n\t\t{\n\t\t\tdie();\n\t\t}\n\n\t\tif ($costDp != \"Free\") {\n\t\t\tif(!$costDp || !is_numeric($costDp))\n\t\t\t{\n\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\n\t\tif(!$accountId || !is_numeric($accountId))\n\t\t{\n\t\t\tdie();\n\t\t}\n\n\t\tif ($costDp != \"Free\") {\n\t\t\tif ($costDp > 0) {\n\t\t\t\t$userDp = intval($this->recup_model->getDp($accountId));\n\t\t\t\tif(!$userDp || !is_numeric($userDp))\n\t\t\t\t{\n\t\t\t\t\tdie(\"Problème lors de l'acquisition des users dps.\");\n\t\t\t\t}\n\t\t\t\t$this->internal_user_model->setDp($accountId, $userDp+$costDp);\n\t\t\t}\n\t\t}\n\t\t$this->recup_model->editEtat($this->realms->getRealm(1)->getCharacters()->getConnection(), $id, 8);\n\t}", "public function store() {\n // validate\n // read more on validation at http://laravel.com/docs/validation\n // store\n\n $deposits = new Deposit;\n $deposits->account_id = Input::get('account_id');\n $deposits->amount = Input::get('amount');\n $deposits->member_id = Input::get('member_id');\n \n\n $depositrow = DB::table('lpay_mmv_account')\n ->where('account_id', $deposits->account_id)->first();\n\n if ($depositrow->balance > $deposits->amount) {\n $deposits->save();\n DB::table('lpay_mmv_member_master')\n ->where('member_id', $deposits->member_id)\n ->increment('wallet', $deposits->amount);\n\n DB::table('lpay_mmv_account')\n ->where('account_id', $deposits->account_id)\n ->decrement('balance', $deposits->amount);\n\n // redirect\n Session::flash('message', 'Deposit done successfully !');\n return Redirect::to('deposits/index/' . $deposits->member_id);\n } else {\n Session::flash('message', 'You don\\'t have sufficeint balance to do the transaction.Your current account balance is $'.$depositrow->balance);\n return Redirect::to('deposits/index/' . $deposits->member_id);\n }\n }", "private function updateWallet ($vendor, $transaction) {\n $commission = $this->calculateCommission($transaction->type, $vendor->user_id, $transaction->amount);\n $distCommission = $this->calculateCommission($transaction->type, $vendor->parent_id, $transaction->amount);\n $superDistId = Vendor::where('user_id', $vendor->parent_id)->first()->parent_id;\n $superDistCommission = $this->calculateCommission($transaction->type, $superDistId, $transaction->amount);\n\n\n // Perform Wallet Updations for Amount Transacted\n if ($transaction->type == 1 || $transaction->type == 2) {\n $vendor->balance += $transaction->type == 1 ? -$transaction->amount : ($transaction->type == 2 ? $transaction->amount : 0);\n $amount_wallet_transaction = WalletTransaction::create([\n 'user_id' => $vendor->id,\n 'transaction_type' => $transaction->type == 1 ? 0 : ($transaction->type == 2 ? 1 : null),\n 'amount' => $transaction->amount,\n 'balance' => $vendor->balance\n ]);\n\n $key = $transaction->type == 1 ? 'debit_id' : ($transaction->type == 2 ? 'credit_id' : '');\n\n AepsWalletAction::create([\n 'user_id' => $vendor->id,\n 'amount' => $transaction->amount,\n 'status' => 1,\n $key => $amount_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => false\n ]);\n\n $dipl_vendor = Vendor::where('type', 8)->lockForUpdate()->first();\n $dipl_vendor->balance += $transaction->type == 1 ? -$transaction->amount : ($transaction->type == 2 ? $transaction->amount : 0);\n $dipl_vendor->save();\n $dipl_amount_wallet_transaction = WalletTransaction::create([\n 'user_id' => $dipl_vendor->id,\n 'transaction_type' => $transaction->type == 1 ? 0 : ($transaction->type == 2 ? 1 : null),\n 'amount' => $transaction->amount,\n 'balance' => $dipl_vendor->balance\n ]);\n\n AepsWalletAction::create([\n 'user_id' => $dipl_vendor->id,\n 'amount' => $transaction->amount,\n 'status' => 1,\n $key => $dipl_amount_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => false\n ]);\n\n }\n\n $dipl_vendor = Vendor::where('type', 8)->lockForUpdate()->first();\n\n // Perform Wallet Updations for Commission\n if ($commission && $dipl_vendor->commission && $vendor->commission) {\n if ($commission['rate_type'] == 1)\n $vendor->balance += $commission['rate'];\n if ($commission['rate_type'] == 2)\n $vendor->balance += $transaction->amount * $commission['rate']/100;\n $commission_wallet_transaction = WalletTransaction::create([\n 'user_id' => $vendor->id,\n 'transaction_type' => 1,\n 'amount' => $commission['rate'],\n 'balance' => $vendor->balance\n ]);\n\n AepsWalletAction::create([\n 'user_id' => $vendor->id,\n 'amount' => $commission['rate'],\n 'status' => 1,\n 'credit_id' => $commission_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => true\n ]);\n }\n\n if ($distCommission && $dipl_vendor->commission) {\n $distributor = Vendor::where('user_id', $vendor->parent_id)->lockForUpdate()->first();\n if ($distributor && $distributor->commission == 1) {\n if ($distCommission['rate_type'] == 1)\n $distributor->balance += $distCommission['rate'];\n if ($distCommission['rate_type'] == 2)\n $distributor->balance += $transaction->amount * $distCommission['rate']/100;\n $commission_wallet_transaction = WalletTransaction::create([\n 'user_id' => $distributor->id,\n 'transaction_type' => 1,\n 'amount' => $distCommission['rate'],\n 'balance' => $distributor->balance\n ]);\n\n $distributor->save();\n\n AepsWalletAction::create([\n 'user_id' => $distributor->id,\n 'amount' => $distCommission['rate'],\n 'status' => 1,\n 'credit_id' => $commission_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => true\n ]);\n } \n }\n\n if ($superDistCommission && $dipl_vendor->commission) {\n $superDistributor = Vendor::where('user_id', $superDistId)->lockForUpdate()->first();\n if ($superDistributor && $superDistributor->commission == 1) {\n if ($superDistCommission['rate_type'] == 1)\n $superDistributor->balance += $superDistCommission['rate'];\n if ($superDistCommission['rate_type'] == 2)\n $superDistributor->balance += $transaction->amount * $superDistCommission['rate']/100;\n $commission_wallet_transaction = WalletTransaction::create([\n 'user_id' => $superDistributor->id,\n 'transaction_type' => 1,\n 'amount' => $superDistCommission['rate'],\n 'balance' => $superDistributor->balance\n ]);\n\n $superDistributor->save();\n\n AepsWalletAction::create([\n 'user_id' => $superDistributor->id,\n 'amount' => $superDistCommission['rate'],\n 'status' => 1,\n 'credit_id' => $commission_wallet_transaction->id,\n 'transaction_id' => $transaction->id,\n 'transaction_type' => $transaction->type,\n 'commission' => true\n ]);\n }\n \n }\n\n return $vendor->balance;\n }", "public function deposit($amount)\n {\n $this->increase($amount);\n \n return;\n }", "function charge_deposit($acc_number,$sum)\n\t{\n\t $this->db->query(\"UPDATE pamm_summaries SET deposit = deposit+$sum WHERE acc_number=$acc_number\");\n\t}", "function openstack_change_funds($invoiceid, $substract=False) {\n $items = Capsule::table('tblinvoiceitems')->where('invoiceid', '=', $invoiceid)->get();\n\n // Retrieve the invoice total paid.\n // If this invoice was not fully paid, we do not substract from Fleio.\n // There is no other way to prevent subtracting from Fleio when cancelling an invoice and marking it unpaid afterwards\n try {\n $balance = Capsule::table('tblaccounts as ta')\n ->where('ta.invoiceid', '=', $invoiceid)\n ->join('tblinvoices as ti', 'ta.invoiceid', '=', 'ti.id')\n ->select(Capsule::raw('SUM(ta.amountin)-SUM(ta.amountout)-ti.total as balance'))\n ->value('balance');\n } catch (Exception $e) {\n logActivity($e->getMessage());\n $balance = false;\n } \n $cost_by_service = array();\n $promo_by_service = array();\n foreach($items as $item) {\n # NOTE(tomo): Check if relid is set and not an empty string\n if (($item->relid == '') || !isset($item->relid)) {\n continue;\n }\n if ($item->type == 'PromoHosting') {\n # NOTE(tomo): Do nothing with $promo_by_service. Just don't add it\n # to the final amount to avoid incorrect credit addition in Fleio\n if (isset($promo_by_service[$item->relid])) {\n $promo_by_service[$item->relid] += $item->amount;\n } else {\n $promo_by_service[$item->relid] = $item->amount;\n }\n } else {\n if (isset($cost_by_service[$item->relid])) {\n $cost_by_service[$item->relid] += $item->amount;\n } else {\n $cost_by_service[$item->relid] = $item->amount;\n }\n }\n }\n\n foreach($items as $item) {\n if (($item->type != 'Hosting') || !isset($cost_by_service[$item->relid])) {\n continue;\n }\n # We now know that relid is a Hosting package (not a Domain for example)\n $service = FleioUtils::getServiceById($item->relid);\n if ($service->servertype == 'fleio') {\n # NOTE(tomo): Make sure the service is active. If it's not active and we don't handle this, the credit is lost.\n # NOTE(tomo): We currently handle this in the add/remove credit methods.\n $clientCurrency = getCurrency($item->userid);\n $defaultCurrency = getCurrency();\n $clientAmount = $cost_by_service[$item->relid]; // Amount + Setup and/or other related prices in client's currency\n # NOTE(tomo): Fleio needs to use the WHMCS default currency\n $amount = convertCurrency($clientAmount, 1, $clientCurrency['id']); // Amount in default currency.\n if ($amount == 0) {\n logActivity('Fleio: ignoring Service ID: '. $item->relid . ' with cost equal to 0 from Invoice ID: ' . $invoiceid);\n continue;\n }\n if ($substract && $balance != false && $balance >= 0) {\n logActivity('Fleio: ignoring Service ID: '. $item->relid .' from Invoice ID: ' . $invoiceid . ' with status Unpaid but fully paid');\n continue;\n }\n $fl = Fleio::fromServiceId($item->relid);\n if ($substract) {\n $msg_format = \"Fleio: removing credit for WHMCS User ID: %s with %.02f %s (%.02f %s from Invoice ID: %s)\";\n } else {\n $msg_format = \"Fleio: adding credit for WHMCS User ID: %s with %.02f %s (%.02f %s from Invoice ID: %s)\";\n }\n $msg = sprintf($msg_format, $item->userid, $amount, $defaultCurrency[\"code\"], $clientAmount, $clientCurrency[\"code\"], $invoiceid);\n logActivity($msg);\n # TODO(tomo): We use the userid which can be a contact ?\n try {\n $addCredit = (!$subtract); // Add credit or subtract, boolean\n $response = $fl->clientChangeCredit($addCredit, $amount, $defaultCurrency[\"code\"], $clientCurrency[\"rate\"], $clientAmount, $clientCurrency[\"code\"], $invoiceid);\n } catch (FlApiException $e) {\n logActivity(\"Unable to update the client credit in Fleio: \" . $e->getMessage()); \n return;\n }\n logActivity(\"Fleio: successfully changed client credit with \".$amount.\" \".$defaultCurrency[\"code\"]. \" for Fleio client id: \".$response['client'].\". New Fleio balance: \".$response['credit_balance'].\" \".$defaultCurrency[\"code\"]); \n }\n }\n}", "function ciniki_poma_accountApplyCredit(&$ciniki, $tnid, $args) {\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'orderUpdateStatusBalance');\n\n //\n // Load tenant settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $tnid);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_timezone = $rc['settings']['intl-default-timezone'];\n\n //\n // Load the last entry in the customer ledger\n //\n $strsql = \"SELECT id, balance \"\n . \"FROM ciniki_poma_customer_ledgers \"\n . \"WHERE customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"ORDER BY transaction_date DESC \"\n . \"LIMIT 1 \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.poma', 'entry');\n if( $rc['stat'] != 'ok') {\n return $rc;\n }\n if( !isset($rc['entry']) ) {\n $balance = 0;\n } else {\n $balance = $rc['entry']['balance'];\n }\n\n //\n // Apply the credit to the balance\n //\n $new_balance = bcadd($balance, $args['customer_amount'], 6);\n $credit_balance = $args['customer_amount'];\n\n //\n // Load any unpaid invoices\n //\n $strsql = \"SELECT ciniki_poma_orders.id, \"\n . \"ciniki_poma_orders.total_amount, \"\n . \"ciniki_poma_orders.balance_amount \"\n . \"FROM ciniki_poma_orders \"\n . \"WHERE ciniki_poma_orders.customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND ciniki_poma_orders.payment_status > 0 \"\n . \"AND ciniki_poma_orders.payment_status < 50 \"\n . \"AND ciniki_poma_orders.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.poma', 'invoice');\n if( $rc['stat'] != 'ok') {\n return $rc;\n }\n if( isset($rc['rows']) ) {\n $unpaid_orders = $rc['rows'];\n //\n // Check if orders will get payment amounts\n //\n foreach($unpaid_orders as $oid => $order) {\n //\n // Skip any orders that might be screwed up with a negative balance\n //\n if( $order['balance_amount'] < 0 ) { \n continue;\n }\n if( $order['balance_amount'] < $credit_balance ) {\n $unpaid_orders[$oid]['payment_amount'] = $order['balance_amount'];\n $credit_balance = bcsub($credit_balance, $order['balance_amount'], 6);\n } else {\n $unpaid_orders[$oid]['payment_amount'] = $credit_balance;\n $credit_balance = 0;\n }\n if( $credit_balance <= 0 ) {\n break;\n }\n }\n }\n\n //\n // Add the ledger entry\n //\n $args['balance'] = $new_balance;\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.poma.customerledger', $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $entry_id = $rc['id'];\n\n //\n // Apply credit to invoice if open unpaid invoices\n //\n if( isset($unpaid_orders) ) {\n foreach($unpaid_orders as $order) {\n if( isset($order['payment_amount']) && $order['payment_amount'] > 0 ) {\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.poma.orderpayment', array(\n 'order_id'=>$order['id'],\n 'ledger_id'=>$entry_id,\n 'payment_type'=>$args['transaction_type'],\n 'amount'=>$order['payment_amount'],\n ), 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rc = ciniki_poma_orderUpdateStatusBalance($ciniki, $tnid, $order['id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n }\n }\n \n return array('stat'=>'ok', 'id'=>$entry_id);\n}", "function getAddress(&$transferData){\n\t\n\tglobal $dz,$thisEntity;\n\t\n\t$username=$transferData['Username'];\n\t$reference=$transferData['Reference'];\n\t$title=$transferData['Title'];\n\t\n\t\n\t// Get the entity of the user being paid:\n\t$toPay=$dz->get_row('select `Entity` from `Root.Usernames` where `Username`=\"'.$username.'\"');\n\t\n\tif(!$toPay){\n\t\t// Username was not found.\n\t\terror('username/notfound');\n\t}\n\n\t// Is the entity the same as this one?\n\t$entityID=$toPay['Entity'];\n\n\t// Transaction delay, if one is applicable.\n\t// This will almost always be zero representing that a transaction is expected to be in the 2s limit.\n\t$delay='0';\n\n\tif($entityID==$thisEntity['ID']){\n\t\t\n\t\t// Yes! This is an internal transaction (i.e. within this bank). No addressing required.\n\t\t$toGroup=$thisEntity['Group'];\n\t\t// return null;\n\t}\n\t\n\t// This is a transaction between banks. We'll need an address to send to:\n\t$entityInfo=$dz->get_row('select `Group`,`Endpoint` from `Root.Entities` where ID='.$entityID);\n\t\n\tif(!$entityInfo){\n\t\t\n\t\t// This server has out-of-date root information.\n\t\tserverError();\n\t\t\n\t}\n\t\n\t// Got a from username? (Optional):\n\tif(isset($transferData['FromUsername'])){\n\t\t// Add it:\n\t\t$privText=',\"from\":\"'.$transferData['FromUsername'].'\",\"name\":\"'.$transferData['Name'].'\"';\n\t}else{\n\t\t$privText='';\n\t}\n\t\n\t// Send the username and reference pair to the username/send API.\n\t// In response we'll get an address to send to.\n\t$error;\n\t$remote=sendTo(\n\t\t$entityInfo['Endpoint'],\n\t\t'username/send',\n\t\t'{\"username\":\"'.$username.'\",\"reference\":\"'.escape($reference,false).'\",\"title\":\"'.escape($title,false).'\",\"items\":'.$transferData['ItemInformation'].$privText.'}',\n\t\t$error\n\t);\n\t\n\t// Did it error?\n\tif($error){\n\t\t\n\t\t// Remote server errored.\n\t\terror('remote/error',$error);\n\t\t\n\t}\n\t\n\t// Update the to group:\n\t$transferData['ToGroup']=$entityInfo['Group'];\n\t\n\t// JSON decode it:\n\t$remote=json_decode($remote,true);\n\t\n\t// Get the address info:\n\t$addrInfo=safe('address',VALID_ARRAY,$remote);\n\t\n\t// Optional delay info:\n\t$delay=safe('delay',VALID_NUMBER,$remote,true);\n\t\n\t// Get the status:\n\t$status=safe('status',VALID_ALPHA,$addrInfo);\n\t\n\tif($status!='OK'){\n\t\t\n\t\t// Remote server was unable to provide an address - try again shortly.\n\t\terror('remote/noaddr',$delay);\n\t\t\n\t}\n\t\n\t// Great - should have an address here:\n\t$address=safe('value',VALID_HEX,$addrInfo);\n\t\n\tif($delay){\n\t\t$transferData['Delay']=$delay;\n\t}\n\t\n\t$transferData['ToAddress']=$address;\n\t\n\treturn $address;\n\t\n}", "public function sendPendingTransactionsToNetwork() {\r\n\r\n //We obtain all pending transactions to send\r\n $pending_tx = $this->chaindata->GetAllPendingTransactionsToSend();\r\n\r\n //We add the pending transaction to the chaindata\r\n foreach ($pending_tx as $tx)\r\n $this->chaindata->addPendingTransaction($tx);\r\n\r\n //We get all the peers and send the pending transactions to all\r\n $peers = $this->chaindata->GetAllPeers();\r\n foreach ($peers as $peer) {\r\n\r\n $myPeerID = Tools::GetIdFromIpAndPort($this->ip,$this->port);\r\n $peerID = Tools::GetIdFromIpAndPort($peer['ip'],$peer['port']);\r\n\r\n if ($myPeerID != $peerID) {\r\n $infoToSend = array(\r\n 'action' => 'ADDPENDINGTRANSACTIONS',\r\n 'txs' => $pending_tx\r\n );\r\n\r\n if ($peer[\"ip\"] == NODE_BOOTSTRAP) {\r\n Tools::postContent('https://'.NODE_BOOTSTRAP.'/gossip.php', $infoToSend,5);\r\n }\r\n else if ($peer[\"ip\"] == NODE_BOOTSTRAP_TESTNET) {\r\n Tools::postContent('https://'.NODE_BOOTSTRAP_TESTNET.'/gossip.php', $infoToSend,5);\r\n }\r\n else {\r\n Tools::postContent('http://' . $peer['ip'] . ':' . $peer['port'] . '/gossip.php', $infoToSend,5);\r\n }\r\n }\r\n }\r\n\r\n //We delete transactions sent from transactions_pending_to_send\r\n foreach ($pending_tx as $tx)\r\n $this->chaindata->removePendingTransactionToSend($tx['txn_hash']);\r\n }", "public function store(Requests\\AddAccountFormRequest $request)\n {\n $a=$request['balance'];\n $amount= str_replace(',','',$a) ;\n $ttype=43;\n $period=\\date(\"t/m/Y\");\n $date=date('d/m/Y');\n $year=(date(\"Y\")) .\"/\". (date(\"Y\") + 1);\n $actor=$request->session()->get('flatUser.id');\n $account= AccountModel::create([\n 'ACCOUNT_NAME' => $request['name'],\n 'PARENT_ACCOUNT' => $request['type'],\n 'ACCOUNT_DESCRIPTION' => $request['naration'],\n 'AFFECTS' => @implode(\",\",$request['affects']),\n 'ACCOUNT_BALANCE' => $amount,\n 'ACCOUNT_CODE' => $request['code'],\n 'BALANCE_TYPE' => $request['balance_type'],\n 'BUSINESS_PERSON' => $request['people'],\n 'PERIOD' => $period,\n 'YEAR' => $year,\n \n ])->ACCOUNT_ID;\n \\DB::table('account_code')->increment('NO');\n \n // if accounts have opening balance do this\n if($amount>0){\n \n \n $code = \\DB::table('codes')->lists('TRANSACTION');\n $tcode=$code[0];\n \n $period= date(\"t/m/Y\");\n if($request['balance_type']=='Debit'){\n $year=(date(\"Y\")) .\"/\". (date(\"Y\") + 1);\n $d=$request['date'];\n $date=date(\"d/m/Y\", strtotime($d)); \n $actor=$request->session()->get('flatUser.id');\n GeneralLedgerModel::create([\n 'TRANS_DATE' => $date,\n 'PERIOD' => $period,\n 'ACCOUNT' => $account,\n 'DEBIT' => $amount,\n 'CREDIT' =>'',\n 'NARRATIVE' => 'Openning books of accounts',\n 'TAG'=> $request['tag'],\n 'TRANSACTION_ID'=> $tcode,\n 'TRANSACTION_TYPE'=> $ttype,\n 'YEAR' => $year,\n 'ACTOR' => $actor,\n \n \n ]);\n }\n else{\n GeneralLedgerModel::create([\n 'TRANS_DATE' => $date,\n 'PERIOD' => $period,\n 'ACCOUNT' =>$account,\n 'DEBIT' =>'' ,\n 'CREDIT' =>$amount,\n 'NARRATIVE' => 'Openning books of accounts',\n 'TAG'=> $request['tag'],\n 'TRANSACTION_ID'=> $tcode,\n 'TRANSACTION_TYPE'=> $ttype,\n 'YEAR' => $year,\n 'ACTOR' => $actor,\n \n ]);\n \n }\n }\n \n \n $browser=$_SERVER['HTTP_USER_AGENT'];\n $user=$request->session()->get('flatUser.id');\n $ip= $_SERVER['REMOTE_ADDR'];\n $page= $_SERVER['REQUEST_URI'];\n $hostname=gethostbyaddr($_SERVER['REMOTE_ADDR']);\n $event=$request['type'];\n \n $activity=$request->session()->get('flatUser.username').\" has openned \". $request['name'].\" Account with amount GHC \" .$amount;\n\t \n // logging \n systemLogModel::create([\n 'USERNAME' => $user,\n 'EVENT_TYPE' => $event,\n 'ACTIVITIES' => $activity,\n 'HOSTNAME' =>$hostname ,\n 'IP' =>$ip,\n 'PAGES_VISITED' =>$page,\n 'BROWSER_VERSION' => $browser,\n \n ]);\n \n \n \n \n \n $request->session()->flash('alert-success', 'Data successfully saved!');\n return \\Redirect::to('add_account');\n }", "public function update(Request $request, Debt $debt)\n {\n\n\n if ($request->type == 'credit') {\n if ($request->account_id != $debt->account_id) {\n $prev_account = Account::find($debt->account_id);\n $prev_account->total_sum = $prev_account->total_sum + $debt->total_sum;\n $prev_account->save();\n\n $curr_account = Account::find($request->account_id);\n $curr_account->total_sum = $curr_account->total_sum - $request->total_sum;\n $curr_account->save();\n } else {\n $curr_account = Account::find($request->account_id);\n $curr_account->total_sum = $curr_account->total_sum - $request->total_sum;\n $curr_account->save();\n }\n }else {\n if ($request->account_id != $debt->account_id) {\n $prev_account = Account::find($debt->account_id);\n $prev_account->total_sum = $prev_account->total_sum - $debt->total_sum;\n $prev_account->save();\n\n $curr_account = Account::find($request->account_id);\n $curr_account->total_sum = $curr_account->total_sum + $request->total_sum;\n $curr_account->save();\n } else {\n $curr_account = Account::find($request->account_id);\n $curr_account->total_sum = $curr_account->total_sum + $request->total_sum;\n $curr_account->save();\n }\n }\n\n $debt->account_id = $request->account_id;\n $debt->total_sum = $request->total_sum;\n $debt->type = $request->type;\n $debt->currency = $request->currency;\n $debt->agent_id = $request->agent_id;\n $debt->comment = $request->comment;\n\n $debt->save();\n\n return redirect('debts');\n\n }", "public function complete(){\n\n\t\tif (isset($_GET[\"paymentId\"]) && $_GET[\"paymentId\"] == session('paypal_payment_id')) {\n\t\t\t$result = $this->paypal->execute_payment($_GET[\"paymentId\"], $_GET[\"PayerID\"], $this->mode);\n \n\t\t\t// get amount\n\t\t\t$amount = $result->transactions[0]->amount;\n\t\t\t$amount = $amount->total;\n\n\t\t\t// get Transaction Id\n\t\t\t$transactions = $result->getTransactions();\n\t\t\t$related_resources = $transactions[0]->getRelatedResources();\n\t\t\t$sale = $related_resources[0]->getSale();\n\t\t\t$get_transaction_fee = $sale->getTransactionFee();\n\t\t\t$sale_id = $sale->getId();\n\n\n\t\t\tif(!empty($result) && $result->state == 'approved'){\n\n\t\t\t\trequire_once 'orders.php';\n\t\t\t\t$data_order = (object)array(\n\t\t\t\t\t'payment_type' => $this->payment_type,\n\t\t\t\t\t'amount' => $amount,\n\t\t\t\t\t'txt_id' => $sale_id,\n\t\t\t\t\t'transaction_fee' => $get_transaction_fee->getValue(),\n\t\t\t\t\t'order_details' => session('order_details'),\n\t\t\t\t);\n\t\t\t\tunset_session('order_details');\n\t\t\t\tunset_session('paypal_payment_id');\t\n\t\t\t\t$order = new orders();\n\t\t\t\tif(!$order->save_order($data_order)){\n\t\t\t\t\tredirect(cn(\"checkout/unsuccess\"));\n\t\t\t\t};\n\t\t\t\t/*---------- Add funds to user balance ----------*/\n\t\t\t\tredirect(cn(\"checkout/success\"));\n\t\t\t}else{\n\t\t\t\tredirect(cn(\"checkout/unsuccess\"));\n\t\t\t}\n\n\t\t}else{\n\t\t\tredirect(cn(\"checkout/unsuccess\"));\n\t\t}\n\t}", "public function run()\n {\n $user = User::first();\n $bankMaster = BankMaster::first();\n $bank = Bank::first();\n\n\n $userBank = \\App\\Models\\UserBank::create([\n 'user_id' => $user->id,\n 'bank_master_id' => $bankMaster->id,\n 'bank_account_number' => '29187687181',\n 'bank_account_name' => 'Fatkul Nur Koirudin',\n ]);\n\n for ($i = 0; $i < 100; $i++) {\n $amount = rand(99000, 100000);\n// $uniqueCode = rand(100, 1000);\n// $totalAmount = $amount + $uniqueCode;\n\n// $trxWallet = \\App\\TransactionWallet::create([\n// 'user_id' => $user->id,\n// 'bank' => $bank,\n// 'unique_code' => $uniqueCode,\n// 'amount' => $amount,\n// 'total_amount' => $totalAmount,\n// 'status' => 2\n// ]);\n\n $trxWallet = \\App\\Services\\TransactionWallet\\TransactionWalletFactory::makeDeposit(\n $user,\n $bank,\n $userBank,\n $amount,\n \\App\\Enums\\TransactionWalletEnum::STATUS_SUCCESS,\n 'lorem imsum'\n );\n\n// $user = \\App\\User::first();\n// if (blank($user->balance)) {\n// $pb = $totalAmount;\n// } else {\n// $pb = ($user->balance + $totalAmount);\n// }\n//\n// $balances = \\App\\Balances::create([\n// 'user_id' => $user->id,\n// 'type' => 1,\n// 'amount' => $totalAmount,\n// 'title' => \\App\\Enums\\BalanceTitle::TRANSACTION_WALLET_DEPOSIT,\n// 'trx_id' => $trxWallet->id,\n// 'previous_balance' => $pb\n// ]);\n\n $balances = \\App\\Services\\Balance\\BalanceFactory::make(\n $user,\n \\App\\Enums\\Balance::IN,\n $amount,\n \\App\\Enums\\BalanceTitle::TRANSACTION_WALLET_DEPOSIT,\n '',\n $trxWallet->id\n );\n }\n\n }", "public function actionTransfer()\n {\n $this->requirePostRequest();\n\n $request = Craft::$app->getRequest();\n $session = Craft::$app->getSession();\n\n $orderId = $request->post('orderId');\n if( empty($orderId) ){\n throw new BadRequestHttpException('Missing Order ID');\n }\n\n $vendorId = $request->post('vendorId');\n if( empty($vendorId) ){\n throw new BadRequestHttpException('Missing Vendor ID');\n }\n\n $order = Order::find()->id($orderId)->where(['vendorId' => $vendorId])->one();\n if( empty($order) ){\n throw new NotFoundHttpException('Order not found or doesn\\'t belong to the Vendor');\n }\n\n $vendor = Vendor::find()->id($vendorId)->one();\n if( empty($vendor) ){\n throw NotFoundHttpException('Vendor not found');\n }\n\n // Make sure there's an outstanding balance on this order to be transferred\n if( !$order->hasOutstandingBalance() ){\n $customError = 'Order has no outstanding balance to be transferred';\n\n if ($request->getAcceptsJson()) {\n $this->asJson(['error' => $customError]);\n }\n\n $session->setError($customError);\n return null;\n }\n\n try {\n // Transfer the outstanding amount to the vendor\n Plugin::getInstance()->getPayments()->processTransfer($order);\n } catch(Exception $e) {\n if ($request->getAcceptsJson()) {\n $this->asJson(['error' => $e->getMessage()]);\n }\n\n $session->setError($e->getMessage());\n return null;\n }\n\n if ($request->getAcceptsJson()) {\n $response = ['success' => true];\n\n if ($redirect) {\n $response['redirect'] = $redirect;\n }\n\n if ($transaction) {\n /** @var Transaction $transaction */\n $response['transactionId'] = $transaction->reference;\n $response['transactionHash'] = $transaction->hash;\n }\n\n return $this->asJson($response);\n }\n\n // Show a flash message to confirm the amount transferred\n $formattedOrderAmount = Craft::$app->getFormatter()->asCurrency($order->getTotalPaid(), $order->getPaymentCurrency());\n $session->setNotice('Transferred '. $formattedOrderAmount .' to '. $vendor->name);\n }", "public function syncTransactions(): void\n\t{\n\t\tif (!$this->checkTransactions()) {\n\t\t\treturn;\n\t\t}\n\n\t\t$transactions = $this->getTransactionList();\n\n\t\t/** @var array<\\Eshop\\DB\\Order> $orders */\n\t\t$orders = $this->orderRepository->many()->setIndex('this.code')->toArrayOf('uuid');\n\t\t/** @var array<\\Eshop\\DB\\EHubTransaction> $existingTransactions */\n\t\t$existingTransactions = $this->EHubTransactionRepository->many()->toArray();\n\n\t\t$newTransactionsValues = [];\n\n\t\tforeach ($transactions as $transaction) {\n\t\t\t$transactionPK = DIConnection::generateUuid('eHubTransactionId', $transaction['id']);\n\t\t\t$transactionValues = [\n\t\t\t\t'order' => null,\n\t\t\t];\n\n\t\t\tif (isset($existingTransactions[$transactionPK])) {\n\t\t\t\t$transactionValues = $existingTransactions[$transactionPK]->toArray();\n\t\t\t}\n\n\t\t\t$transactionValues['transactionId'] = $transaction['id'];\n\t\t\t$transactionValues['status'] = $transaction['status'];\n\t\t\t$transactionValues['createdTs'] = (new Carbon($transaction['dateTime']))->format('Y-m-d G:i');\n\t\t\t$transactionValues['clickDateTime'] = (new Carbon($transaction['clickDateTime']))->format('Y-m-d G:i');\n\t\t\t$transactionValues['orderAmount'] = (float) $transaction['orderAmount'];\n\t\t\t$transactionValues['originalOrderAmount'] = $transaction['originalOrderAmount'] ?? null;\n\t\t\t$transactionValues['originalCurrency'] = $transaction['originalCurrency'] ?? null;\n\t\t\t$transactionValues['commission'] = isset($transaction['commission']) ? (float) $transaction['commission'] : null;\n\t\t\t$transactionValues['type'] = $transaction['type'];\n\t\t\t$transactionValues['orderId'] = $transaction['orderId'] ?? null;\n\t\t\t$transactionValues['couponCode'] = $transaction['couponCode'] ?? null;\n\t\t\t$transactionValues['newCustomer'] = $transaction['newCustomer'] ?? null;\n\n\t\t\tif (isset($orders[$transaction['orderId']])) {\n\t\t\t\t$transactionValues['order'] = $orders[$transaction['orderId']];\n\t\t\t}\n\n\t\t\t$newTransactionsValues[] = $transactionValues;\n\t\t}\n\n\t\t$this->EHubTransactionRepository->syncMany($newTransactionsValues);\n\t}", "public function transfer($customer_sender_id)\n {\n //\n $customer = DB::select('SELECT * FROM customers WHERE id = ?', [$customer_sender_id]);\n $all_customers = DB::select('SELECT * FROM customers WHERE id != ?', [$customer_sender_id]);\n\n return view('customers.transfer')->with(['customer'=>$customer[0], 'customers'=>$all_customers]);\n }" ]
[ "0.6921899", "0.68886626", "0.67672545", "0.6760381", "0.6672172", "0.6585467", "0.6583427", "0.6557461", "0.6419156", "0.6332526", "0.62852526", "0.6268719", "0.6245878", "0.62288564", "0.5954562", "0.5902121", "0.58905077", "0.5861231", "0.5832876", "0.58165044", "0.58092713", "0.57458335", "0.5741511", "0.567009", "0.56622016", "0.5656017", "0.5642026", "0.56411475", "0.5638492", "0.5622786", "0.5613377", "0.55882967", "0.5580482", "0.5545884", "0.55371284", "0.5520307", "0.55130285", "0.5496151", "0.5495373", "0.5494768", "0.5466175", "0.54641134", "0.544399", "0.54405767", "0.5414224", "0.53817606", "0.53729206", "0.5354791", "0.53483987", "0.53481734", "0.5340842", "0.53398955", "0.5326982", "0.5326962", "0.5326336", "0.53199124", "0.53184575", "0.5309396", "0.5295079", "0.5287647", "0.5280041", "0.5269108", "0.5258034", "0.52539784", "0.52509254", "0.5244548", "0.52372104", "0.5225987", "0.5215352", "0.5211655", "0.5201423", "0.5200568", "0.51944184", "0.51868474", "0.51715237", "0.5168906", "0.51444864", "0.5140829", "0.51406354", "0.5132622", "0.5124006", "0.5120907", "0.51020175", "0.51016796", "0.5095701", "0.5091178", "0.5091056", "0.50836074", "0.50831693", "0.50752884", "0.5070607", "0.50350326", "0.5033874", "0.5031472", "0.5031342", "0.5031108", "0.50258315", "0.5025201", "0.50143915", "0.50131243", "0.5012795" ]
0.0
-1
/ Checks to see if a string is a valid bitcoin address
public function validateAddress($address) { $result = $this->newAPIRequest('GET', '/validate/'.$address); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAddress($input)\n{\n $pattern = \"/^[a-zA-Z0-9]{33,34}$/\";\n return preg_match($pattern, $input);\n}", "public function testCheckAddress() {\n\t$this->assertTrue(Bitcoin::checkAddress(\"1pA14Ga5dtzA1fbeFRS74Ri32dQjkdKe5\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1MU97wyf7msCVdaapneW2dW1uXP7oEQsFA\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1F417eczAAbh41V4oLGNf3DqXLY72hsM73\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1ASgNrpNNejRJVfqK2jHmfJ3ZQnMSUJkwJ\"));\n\t$this->assertFalse(Bitcoin::checkAddress(\"1ASgNrpNNejRJVfqK2jHmfJ3ZQnMSUJ\"));\n\t$this->assertFalse(Bitcoin::checkAddress(\"1111111fnord\"));\n\t}", "public function isValidAddress($address);", "function is_valid_btcaddress($pubkey)\r\n\t{\r\n\r\n\t$forbidden_chars = array(\";\",\"$\",\"*\",\"!\",\"[\",\"]\",\"@\",\"#\",\"%\",\"^\",\"&\");\r\n\t$minimal_lenght = 25;\r\n\t\r\n\t$errors_sum =0;\r\n\t//check pubkey lenght\r\n\tif (strlen($pubkey)<$minimal_lenght)\r\n\t\t$errors_sum=$errors_sum+1;\t\r\n\t// check if address begins from 1\t\t\r\n\tif ($pubkey[0]!='1')\r\n\t\t$errors_sum=$errors_sum+1;\r\n\t//check if forbidden chars occure\r\n\tforeach ($forbidden_chars as &$forbidden_character)\r\n\t\t{\r\n\t\tif (strpos($pubkey, $forbidden_character))\r\n\t\t\t$errors_sum=$errors_sum+1;\t\r\n\t\t}\r\n\t//result of checking\r\n\tif ($errors_sum ==0)\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n\r\n\t}", "public function validateAddress() {\r\n $leng = mb_strlen($this->data[$this->name]['Address']);\r\n if ($leng > 256) {\r\n return FALSE;\r\n } else if ($leng > 128) {\r\n if (mb_ereg(self::_REGEX_FULLWITH, $this->data[$this->name]['Address']) !== false) {\r\n return FALSE;\r\n }\r\n }\r\n return TRUE;\r\n }", "public function testAddress()\n {\n $this->assertTrue(RuValidation::address1('Московский пр., д. 100'));\n $this->assertTrue(RuValidation::address1('Moskovskiy ave., bld. 100'));\n\n $this->assertFalse(RuValidation::address1('I would not tell'));\n }", "public function checkAddress($address)\n\t\t{\n\t\t\t$address = strip_tags($address);\n\t\t\t\n\t\t\t$this->groestlcoin->validateaddress($address);\n\t\t\t\n\t\t\tif ($this->groestlcoin->response['result']['isvalid'] == 1){\n\t\t\t\treturn 1;}\n\t\t\telse{\n\t\t\t\treturn 0;}\t\t\t\n\t\t}", "public function validate_address( $address ) {\n\t\t// @codingStandardsIgnoreStart\n\t\treturn strlen( $address ) == 35\n\t\t\t&& ( $address[0] == 'D' || $address[0] == 'T' )\n\t\t\t&& $address[1] == 's';\n\t\t// @codingStandardsIgnoreEnd\n\t}", "public function validate_address($address) { \n\n\t// Decode\n\t$decode = $this->base58_decode($address); \n\tif (strlen($decode) != 50) { return false; }\n\n\t// Compare address versionok\\n\n\t$version = substr($decode, 0, 2);\n\t$p2sh_byte = TESTNET == 1 ? 'c4' : '05';\n\tif (hexdec($version) > hexdec($this->public_prefix) && $version != $p2sh_byte) { return false; }\n\n\t// Compare checksum\n\t$hash = hash('sha256', hash('sha256', pack(\"H*\", substr($decode, 0, 42)), true));\n\treturn substr($decode, -8) == substr($hash, 0, 8);\n\t\t\n}", "public function validateaddress($address){\n return $this->bitcoin->validateaddress($address);\n }", "function verify_address($address) // Colorize: green\n { // Colorize: green\n return isset($address) // Colorize: green\n && // Colorize: green\n is_string($address) // Colorize: green\n && // Colorize: green\n ( // Colorize: green\n filter_var($address, FILTER_VALIDATE_IP) // Colorize: green\n || // Colorize: green\n filter_var($address, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) // Colorize: green\n ); // Colorize: green\n }", "public function testReturnTrueOnValidBitcoinAddress()\n {\n $result = Wallet::validate(self::VALID_BTC_ADDRESS, Wallet::BITCOIN);\n\n $this->assertTrue($result);\n }", "public function isAddressValid()\n {\n //TODO: consider does it make sense to have a special validation by country? how does the app handle different country addresses ?\n $addressValid = trim($this->Streetname1) != '' && trim($this->PostalCode) != '' && trim($this->City) != '' && trim($this->Country) != '' ;\n\n if (!$addressValid) {\n $this->errors[] = 'Invalid Shipping Address';\n }\n\n return $addressValid;\n }", "static function checkAddress($input)\r\n {\r\n if (preg_match('/^[\\W\\w\\d,][\\W\\w\\d\\s,]{1,40}$/', $input)) {\r\n return true; //Illegal Character found!\r\n }\r\n else{\r\n echo PageBuilder::printError(\"Please enter alphabets and numbers with comma seperation, maximum of 40 characters.\");\r\n return false;\r\n }\r\n }", "public static function validateAddress($value)\n {\n return preg_match(self::EMAIL_FORMAT_REGEX, $value);\n }", "public function testReturnTrueOnValidEthereumAddress()\n {\n $result = Wallet::validate(self::VALID_ETH_ADDRESS, Wallet::ETHEREUM);\n\n $this->assertTrue($result);\n }", "public static function isValidAddress($address, $throw = FALSE) {\n\n if (!self::hasHexPrefix($address)) {\n return FALSE;\n }\n // Address should be 20bytes=40 HEX-chars + prefix.\n if (strlen($address) !== 42) {\n return FALSE;\n }\n $return = ctype_xdigit(self::removeHexPrefix($address));\n\n if (!$return && $throw) {\n throw new \\InvalidArgumentException($address . ' has invalid format.');\n }\n return $return;\n }", "function hasValidAddress()\n{\n return isset($_POST[\"address\"]) && isAddress($_POST[\"address\"]);\n}", "public static function isValidChecksum(string $address): bool\n {\n if (!self::isValidHex($address)) {\n throw new InvalidArgumentException(\"Given address '{$address}' is not a valid Ethereum address.\");\n }\n\n $address = (string) Hex::of($address);\n $hash = (string) Sha3::hash(strtolower($address));\n\n for ($i = 0; $i < 40; ++$i) {\n if (ctype_alpha($address[$i])) {\n $charInt = intval($hash[$i], 16);\n\n if ((ctype_upper($address[$i]) && $charInt <= 7) || (ctype_lower($address[$i]) && $charInt > 7)) {\n return false;\n }\n }\n }\n\n return true;\n }", "public static function isValid(Hex|string $address): bool\n {\n $address = Hex::of($address);\n\n if (!self::isValidHex($address)) {\n return false;\n }\n\n return self::isAllSameCaps($address) || self::isValidChecksum($address->prefixed());\n }", "public function testReturnTrueOnValidLitecoinAddress()\n {\n $result = Wallet::validate(self::VALID_LITECOIN_ADDRESS, Wallet::LITECOIN);\n\n $this->assertTrue($result);\n }", "public function testRandomEthereumAddress()\n {\n $initial_value = random_ethereum_address();\n $this->assertInternalType('string', $initial_value);\n \n CryptoStat::setCurrency('ETH');\n $is_valid = CryptoStat::validateAddress($initial_value); \n \n $this->assertTrue($is_valid);\n }", "public function testThrowExceptionOnInvalidBitcoinAddress()\n {\n $this->expectException(Exceptions\\InvalidAddressFormatException::class);\n Wallet::validate(self::INVALID_ADDRESS, Wallet::BITCOIN);\n }", "public function testThrowExceptionOnInvalidLitecoinAddress()\n {\n $this->expectException(Exceptions\\InvalidAddressFormatException::class);\n Wallet::validate(self::INVALID_ADDRESS, Wallet::LITECOIN);\n }", "public function validAddresses() {}", "public static function ValidateAddress($address) {\n\t if (function_exists('filter_var')) { //Introduced in PHP 5.2\n\t if(filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) {\n\t return false;\n\t } else {\n\t return true;\n\t }\n\t } else {\n\t return preg_match('/^(?:[\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\`\\{\\|\\}\\~]+\\.)*[\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\`\\{\\|\\}\\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[a-zA-Z0-9_\\-](?!\\.)){0,61}[a-zA-Z0-9_-]?\\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\\[(?:(?:[01]?\\d{1,2}|2[0-4]\\d|25[0-5])\\.){3}(?:[01]?\\d{1,2}|2[0-4]\\d|25[0-5])\\]))$/', $address);\n\t }\n\t}", "public static function ValidateAddress($address) {\n if (function_exists('filter_var')) { //Introduced in PHP 5.2\n if(filter_var($address, FILTER_VALIDATE_EMAIL) === FALSE) {\n return false;\n } else {\n return true;\n }\n } else {\n return preg_match('/^(?:[\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\`\\{\\|\\}\\~]+\\.)*[\\w\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\`\\{\\|\\}\\~]+@(?:(?:(?:[a-zA-Z0-9_](?:[a-zA-Z0-9_\\-](?!\\.)){0,61}[a-zA-Z0-9_-]?\\.)+[a-zA-Z0-9_](?:[a-zA-Z0-9_\\-](?!$)){0,61}[a-zA-Z0-9_]?)|(?:\\[(?:(?:[01]?\\d{1,2}|2[0-4]\\d|25[0-5])\\.){3}(?:[01]?\\d{1,2}|2[0-4]\\d|25[0-5])\\]))$/', $address);\n }\n }", "public function testThrowExceptionOnInvalidDogecoinAddress()\n {\n $this->expectException(Exceptions\\InvalidAddressFormatException::class);\n Wallet::validate(self::INVALID_ADDRESS, Wallet::DOGECOIN);\n }", "public function testReturnTrueOnValidDogecoinAddress()\n {\n $result = Wallet::validate(self::VALID_DOGECOIN_ADDRESS, Wallet::DOGECOIN);\n\n $this->assertTrue($result);\n }", "protected static function isValidHex(Hex|string $address): bool\n {\n return Hex::of($address)->length() === 20;\n }", "public function validateAddress($attribute)\n {\n $web3BlockChainAdapter = new Web3BlockChainAdapter(Yii::$app->ethereumAPI);\n if ($this->network === CryptoCurrencyTypes::NETWORK_TYPE_ETHEREUM && !$web3BlockChainAdapter->isAccount($this->$attribute)) {\n $this->addError($attribute, 'The address does not exist in the blockchain.');\n }\n }", "function ValidEmailAddress (\t$in_test_address\t///< Either a single email address, or a list of them, comma-separated.\n )\n {\n $valid = false;\n \n if ( $in_test_address )\n {\n global $g_validation_error; ///< This contains an array of strings, that \"log\" bad email addresses.\n $g_validation_error = array();\n $addr_array = split ( \",\", $in_test_address );\n // Start off optimistic.\n $valid = true;\n \n // If we have more than one address, we iterate through each one.\n foreach ( $addr_array as $addr_elem )\n {\n // This splits any name/address pair (ex: \"Jack Schidt\" <jsh@spaz.com>)\n $addr_temp = preg_split ( \"/ </\", $addr_elem );\n if ( count ( $addr_temp ) > 1 )\t// We also want to trim off address brackets.\n {\n $addr_elem = trim ( $addr_temp[1], \"<>\" );\n }\n else\n {\n $addr_elem = trim ( $addr_temp[0], \"<>\" );\n }\n $regexp = \"/^([_a-zA-Z0-9-]+)(\\.[_a-zA-Z0-9-]+)*@([a-zA-Z0-9-]+)(\\.[a-zA-Z0-9-]+)*(\\.[a-zA-Z]{2,4})$/\";\n if (!preg_match($regexp, $addr_elem))\n {\n array_push ( $g_validation_error, 'The address'.\" '$addr_elem' \".'is not correct.' );\n $valid = false;\n }\n }\n }\n \n return $valid;\n }", "public function testReturnTrueOnValidDashAddress()\n {\n $result = Wallet::validate(self::VALID_DASH_ADDRESS, Wallet::DASH);\n\n $this->assertTrue($result);\n }", "function is_valid_ssn($ssn)\n{\n if(is_null($ssn) || strlen($ssn) != 18)\n {\n return false;\n }\n $pattern = \"/^[1-8][0-7]\\d{4}(19|20)\\d{2}(0[1-9]|1(0|1|2))(0[1-9]|(1|2)\\d|3(0|1))\\d{3}(\\d|x)$/i\";\n return preg_match($pattern, $ssn) == 1;\n}", "function validateZipCode($string){\n\tif($string == '') {return 'Zip code is required </br>';}\n\tif(!preg_match(\"/^[A-Za-z]\\d[A-Za-z] \\d[A-Za-z]\\d$/\", $string)){\n\t\treturn 'Zip code is invalid </br>';\n\t}\n\treturn '';\n}", "public function testThrowExceptionOnInvalidEthereumAddress()\n {\n $this->expectException(Exceptions\\InvalidAddressFormatException::class);\n Wallet::validate(self::INVALID_ADDRESS, Wallet::ETHEREUM);\n }", "public function validateaddress($bitcoinaddress)\n\t{\n\t\t$result = $this->connect('validateaddress', array((string) $bitcoinaddress));\n\t\tif ( ! is_null($error = $this->_get_error($result)))\n\t\t{\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn json_decode($result);\n\t\t}\n\t}", "function isPostcodeValid($postcode)\n{\n //remove all whitespace\n $postcode = preg_replace('/\\s/', '', $postcode);\n \n //make uppercase\n $postcode = strtoupper($postcode);\n \n if(preg_match(\"/^[A-Z]{1,2}[0-9]{2,3}[A-Z]{2}$/\",$postcode)\n || preg_match(\"/^[A-Z]{1,2}[0-9]{1}[A-Z]{1}[0-9]{1}[A-Z]{2}$/\",$postcode)\n || preg_match(\"/^GIR0[A-Z]{2}$/\",$postcode))\n {\n return true;\n }\n else {\n return false;\n }\n}", "private function email_is_valid($address = '', $ignore_format = false)\n\t{\n\t\tif (!strlen($address))\n\t\t\treturn FALSE;\n\t\t\t\n\t\t//verify there is a valid email address in the string\n\t\tif (preg_match( '%[a-z0-9._-]+@[a-z0-9_-]+\\.[a-z.]+%is', $address ) <= 0)\n\t\t\treturn FALSE;\n\t\t\n\t\t//if ANY invalid email characters are found, assume it's the name encapsulated variant of the standard\n\t\tif (!$ignore_format)\n\t\t{\n\t\t\tif (preg_match( '%[^a-z0-9@._-]%is', $address ) > 0)\n\t\t\t{\n\t\t\t\t//ensure it matches the format of \n\t\t\t\tif (preg_match( '%.*\\s<[a-z0-9@.]+>%is', $address ) <= 0)\n\t\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn TRUE;\n\t}", "public function verifyAddress(string $address)\n {\n return $this->execute($this->getCoin() . '/verifyaddress', 'POST', [\n 'address' => $address\n ]);\n }", "public function testThrowExceptionOnInvalidDashAddress()\n {\n $this->expectException(Exceptions\\InvalidAddressFormatException::class);\n Wallet::validate(self::INVALID_ADDRESS, Wallet::DASH);\n }", "function _validateAddress($address)\n {\n $is_group = false;\n $addresses = array();\n\n if ($address['group']) {\n $is_group = true;\n\n // Get the group part of the name\n $parts = explode(':', $address['address']);\n $groupname = $this->_splitCheck($parts, ':');\n $structure = array();\n\n // And validate the group part of the name.\n if (!$this->_validatePhrase($groupname)){\n $this->error = 'Group name did not validate.';\n return false;\n } else {\n // Don't include groups if we are not nesting\n // them. This avoids returning invalid addresses.\n if ($this->nestGroups) {\n $structure = new stdClass;\n $structure->groupname = $groupname;\n }\n }\n\n $address['address'] = ltrim(substr($address['address'], strlen($groupname . ':')));\n }\n\n // If a group then split on comma and put into an array.\n // Otherwise, Just put the whole address in an array.\n if ($is_group) {\n while (strlen($address['address']) > 0) {\n $parts = explode(',', $address['address']);\n $addresses[] = $this->_splitCheck($parts, ',');\n $address['address'] = trim(substr($address['address'], strlen(end($addresses) . ',')));\n }\n } else {\n $addresses[] = $address['address'];\n }\n\n // Check that $addresses is set, if address like this:\n // Groupname:;\n // Then errors were appearing.\n if (!count($addresses)){\n $this->error = 'Empty group.';\n return false;\n }\n\n // Trim the whitespace from all of the address strings.\n array_map('trim', $addresses);\n\n // Validate each mailbox.\n // Format could be one of: name <geezer@domain.com>\n // geezer@domain.com\n // geezer\n // ... or any other format valid by RFC 822.\n for ($i = 0; $i < count($addresses); $i++) {\n if (!$this->validateMailbox($addresses[$i])) {\n if (empty($this->error)) {\n $this->error = 'Validation failed for: ' . $addresses[$i];\n }\n return false;\n }\n }\n\n // Nested format\n if ($this->nestGroups) {\n if ($is_group) {\n $structure->addresses = $addresses;\n } else {\n $structure = $addresses[0];\n }\n\n // Flat format\n } else {\n if ($is_group) {\n $structure = array_merge($structure, $addresses);\n } else {\n $structure = $addresses;\n }\n }\n\n return $structure;\n }", "public function testFromString(): void\n {\n $this->expectNotToPerformAssertions();\n\n InternetAddress::fromString('1.1.1.1:1');\n }", "function check_email_address($email) {\n\t$isValid = true;\n\t$atIndex = strrpos($email, \"@\");\n\tif (is_bool($atIndex) && !$atIndex) {\n\t\t$isValid = false;\n\t}\n\telse {\n\t\t$domain = substr($email, $atIndex+1);\n\t\t$local = substr($email, 0, $atIndex);\n\t\t$localLen = strlen($local);\n\t\t$domainLen = strlen($domain);\n\t\tif ($localLen < 1 || $localLen > 64) {\n\t\t\t// local part length exceeded\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if ($domainLen < 1 || $domainLen > 255) {\n\t\t\t// domain part length exceeded\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if ($local[0] == '.' || $local[$localLen-1] == '.') {\n\t\t\t// local part starts or ends with '.'\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if (preg_match('/\\\\.\\\\./', $local)) {\n\t\t\t// local part has two consecutive dots\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if (!preg_match('/^[A-Za-z0-9\\\\-\\\\.]+$/', $domain)) {\n\t\t\t// character not valid in domain part\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if (preg_match('/\\\\.\\\\./', $domain)) {\n\t\t\t// domain part has two consecutive dots\n\t\t\t$isValid = false;\n\t\t}\n\t\telse if (!preg_match('/^(\\\\\\\\.|[A-Za-z0-9!#%&`_=\\\\/$\\'*+?^{}|~.-])+$/',\n\t\tstr_replace(\"\\\\\\\\\",\"\",$local)))\n\t\t{\n\t\t // character not valid in local part unless \n\t\t // local part is quoted\n\t\t if (!preg_match('/^\"(\\\\\\\\\"|[^\"])+\"$/', str_replace(\"\\\\\\\\\",\"\",$local))) {\n\t\t\t$isValid = false;\n\t\t }\n\t\t}\n\t\tif ($isValid && !(checkdnsrr($domain,\"MX\") || checkdnsrr($domain,\"A\"))) {\n\t\t\t// domain not found in DNS\n\t\t\t$isValid = false;\n\t\t}\n\t}\n\treturn $isValid;\n}", "public function testPostal()\n {\n $this->assertFalse(BrValidation::postal('111'));\n $this->assertFalse(BrValidation::postal('1111'));\n $this->assertFalse(BrValidation::postal('1234-123'));\n $this->assertFalse(BrValidation::postal('12345-12'));\n\n $this->assertTrue(BrValidation::postal('88000-123'));\n $this->assertTrue(BrValidation::postal('01234-123'));\n $this->assertTrue(BrValidation::postal('01234123'));\n }", "function isValidMailAddress($address) {\n // enhancement made in 3.6x based on code by Quandary.\n if (preg_match('/^(?!\\\\.)(?:\\\\.?[-a-zA-Z0-9!#$%&\\'*+\\\\/=?^_`{|}~]+)+@(?!\\\\.)(?:\\\\.?(?!-)[-a-zA-Z0-9]+(?<!-)){2,}$/', $address)) {\n return 1;\n } else {\n return 0;\n }\n}", "function is_email($addr)\n{\n $addr = strtolower(trim($addr));\n $addr = str_replace(\"&#064;\",\"@\",$addr);\n if ( (strstr($addr, \"..\")) || (strstr($addr, \".@\")) || (strstr($addr, \"@.\")) || (!preg_match(\"/^[[:alnum:]][a-z0-9_.-]*@[a-z0-9][a-z0-9.-]{0,61}[a-z0-9]\\.[a-z]{2,6}\\$/\", stripslashes(trim($addr)))) ) {\n $emailvalidity = 0;\n } else {\n $emailvalidity = 1;\n }\n return $emailvalidity;\n}", "function is_valid_email($address) {\n $fields = preg_split(\"/@/\", $address, 2);\n if ((!preg_match(\"/^[0-9a-z]([-_.]?[0-9a-z])*$/i\", $fields[0])) || (!isset($fields[1]) || $fields[1] == '' || !is_valid_hostname_fqdn($fields[1], 0))) {\n return false;\n }\n return true;\n}", "public static function IsValid ($address) {\n return preg_match(\"/^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$/\", $address);\n }", "function checkAddress(){\n $country = $_POST[\"country\"];\n $city = $_POST[\"city\"];\n $street = $_POST[\"street\"];\n $number = $_POST[\"number\"];\n if(empty($country) || empty($city) || empty($street) || empty($number)){\n return false; \n }\n return true; \n }", "public function testCanAddBitcoinAddress()\n {\n $result = Wallet::add(self::VALID_BTC_ADDRESS, Wallet::BITCOIN);\n\n $this->assertTrue($result);\n }", "public static function isValidAddress($ip_address)\n {\n return filter_var($ip_address, FILTER_VALIDATE_IP) !== false;\n }", "function mycheck_phone( $string ) {\n if ( preg_match( '/^[+]?([\\d]{0,3})?[\\(\\.\\-\\s]?([\\d]{3})[\\)\\.\\-\\s]*([\\d]{3})[\\.\\-\\s]?([\\d]{4})$/', $string ) ) {\n return TRUE;\n } else {\n return FALSE;\n }\n}", "public function check_billing_address_for_packstation()\n\t{\n\t\t$addressValid = true;\n\n\t\t$billToAddress = $this->getAddressData($_SESSION['billto']);\n\t\tif(preg_match('/(packstation|filiale)/i', $billToAddress['entry_street_address']) === 1)\n\t\t{\n\t\t\t$addressValid = false;\n\t\t}\n\n\t\treturn $addressValid;\n\t}", "function checkAddress($address = null, $state = null, $city = null, $zip = null) {\n $this->autoRender = false;\n if (isset($_POST)) {\n $zipCode = ltrim($zip, \" \");\n $stateName = $state;\n $cityName = strtolower($city);\n $cityName = ucwords($cityName);\n $dlocation = $address . \" \" . $cityName . \" \" . $stateName . \" \" . $zipCode;\n $adjuster_address2 = str_replace(' ', '+', $dlocation);\n $geocode = file_get_contents('https://maps.google.com/maps/api/geocode/json?key='.GOOGLE_GEOMAP_API_KEY.'&address=' . $adjuster_address2 . '&sensor=false');\n $output = json_decode($geocode);\n if ($output->status == \"ZERO_RESULTS\" || $output->status != \"OK\") {\n echo 2;\n die; // Bad Address\n } else {\n $latitude = @$output->results[0]->geometry->location->lat;\n $longitude = @$output->results[0]->geometry->location->lng;\n $formated_address = @$output->results[0]->formatted_address;\n if ($latitude) {\n echo 1;\n die; // Good Address\n }\n }\n }\n }", "function validateUSAZip($zip_code)\n\t\t\t{\n\t \t\tif(preg_match(\"/^([0-9]{5})(-[0-9]{4})?$/i\",$zip_code))\n\t \t\t\treturn true;\n\t \t\telse\n\t \t\t\t return false;\n\t\t\t}", "public static function isValid(string $string): bool;", "private function _legacy_email_is_valid($email) {\n\t\t$valid_address = true;\n\n\t\t$mail_pat = '^(.+)@(.+)$';\n\t\t$valid_chars = \"[^] \\(\\)<>@,;:\\.\\\\\\\"\\[]\";\n\t\t$atom = \"$valid_chars+\";\n\t\t$quoted_user='(\\\"[^\\\"]*\\\")';\n\t\t$word = \"($atom|$quoted_user)\";\n\t\t$user_pat = \"^$word(\\.$word)*$\";\n\t\t$ip_domain_pat='^\\[([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\.([0-9]{1,3})\\]$';\n\t\t$domain_pat = \"^$atom(\\.$atom)*$\";\n\n\t\tif (preg_match(\"/$mail_pat/\", $email, $components)) {\n\t\t\t$user = $components[1];\n\t\t\t$domain = $components[2];\n\t\t\t// validate user\n\t\t\tif (preg_match(\"/$user_pat/\", $user)) {\n\t\t\t\t// validate domain\n\t\t\t\tif (preg_match(\"/$ip_domain_pat/\", $domain, $ip_components)) {\n\t\t\t\t\t// this is an IP address\n\t\t\t\t\tfor ($i=1;$i<=4;$i++) {\n\t\t\t\t\t\tif ($ip_components[$i] > 255) {\n\t\t\t\t\t\t\t$valid_address = false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t// Domain is a name, not an IP\n\t\t\t\t\tif (preg_match(\"/$domain_pat/\", $domain)) {\n\t\t\t\t\t\t/* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD\n\t\t\t\t\t\tand that there's a hostname preceding the domain or country. */\n\t\t\t\t\t\t$domain_components = explode(\".\", $domain);\n\t\t\t\t\t\t// Make sure there's a host name preceding the domain.\n\t\t\t\t\t\tif (sizeof($domain_components) < 2) {\n\t\t\t\t\t\t\t$valid_address = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$top_level_domain = strtolower($domain_components[sizeof($domain_components)-1]);\n\t\t\t\t\t\t\t// Allow all 2-letter TLDs (ccTLDs)\n\t\t\t\t\t\t\tif (preg_match('/^[a-z][a-z]$/', $top_level_domain) != 1) {\n\t\t\t\t\t\t\t\t$tld_pattern = '';\n\t\t\t\t\t\t\t\t// Get authorized TLDs from text file\n\t\t\t\t\t\t\t\t$tlds = file(DIR_WS_INCLUDES.'tld.txt');\n\t\t\t\t\t\t\t\tforeach($tlds as $line) {\n\t\t\t\t\t\t\t\t\t// Get rid of comments\n\t\t\t\t\t\t\t\t\t$words = explode('#', $line);\n\t\t\t\t\t\t\t\t\t$tld = trim($words[0]);\n\t\t\t\t\t\t\t\t\t// TLDs should be 3 letters or more\n\t\t\t\t\t\t\t\t\tif (preg_match('/^[a-z]{3,}$/', $tld) == 1) {\n\t\t\t\t\t\t\t\t\t\t$tld_pattern .= '^'.$tld.'$|';\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// Remove last '|'\n\t\t\t\t\t\t\t\t$tld_pattern = substr($tld_pattern, 0, -1);\n\t\t\t\t\t\t\t\tif (preg_match(\"/$tld_pattern/\", $top_level_domain) == 0) {\n\t\t\t\t\t\t\t\t\t$valid_address = false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$valid_address = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$valid_address = false;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$valid_address = false;\n\t\t}\n\t\tif ($valid_address && ENTRY_EMAIL_ADDRESS_CHECK == 'true') {\n\t\t\tif (!checkdnsrr($domain, \"MX\") && !checkdnsrr($domain, \"A\")) {\n\t\t\t\t$valid_address = false;\n\t\t\t}\n\t\t}\n\t\treturn $valid_address;\n\t}", "public function validate_refund_address_field() {\n\n\t\tWC()->session->set( 'decred_refund_address', null );\n\n\t\t$address = $this->get_post( 'decred-refund-address' );\n\n\t\t// this should never happen as the refund address field should be missing.\n\t\tif ( ! empty( $address ) && ! $this->show_refund_address() ) {\n\t\t\twc_add_notice( __( 'Decred plugin error: unexpected refund address.', 'decred' ), 'error' );\n\t\t\treturn false;\n\t\t}\n\n\t\t// empty address OK if optional, otherwise validate it.\n\t\tif ( empty( $address ) && ! $this->require_refund_address() ) {\n\t\t\t$address_is_valid = true;\n\t\t} else {\n\t\t\t$address_is_valid = $this->validate_address( $address );\n\t\t}\n\n\t\tif ( $address_is_valid ) {\n\t\t\tif ( ! empty( $address ) ) {\n\t\t\t\t// save address now to retrieve it later when order created.\n\t\t\t\tWC()->session->set( 'decred_refund_address', $address );\n\t\t\t}\n\t\t} else {\n\t\t\t// translators: parameter is address entered by user, not to be translated.\n\t\t\t$message = __( 'Please enter a valid Decred address for refunds. Wrong address \"%s\"', 'decred' );\n\t\t\twc_add_notice( sprintf( $message, $address ), 'error' );\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 validateAddress($field)\n\t{\n //Make sure field is not blank; unable to validate anything beyond that.\n if ($field == \"\") return \"Please specify your address.\\\\n\";\n\t\treturn \"\";\n\t}", "public static function isEmailAddressPattern($string) {\n\n // TODO: Adressen in IP-Notation korrekt validieren -> root@[127.0.0.1]\n\n static $pattern = '/^[a-z0-9?*+-]+[a-z0-9?*_.+-]*@(([a-z0-9?*]+|[a-z0-9?*]+[a-z0-9?*-]+[a-z0-9?*]+)\\.)*(\\*|[a-z0-9?*][a-z0-9?*-]*[a-z0-9?*])\\.(\\*|[a-z?*]{2,4})$/';\n return is_string($string) && strlen($string) && preg_match($pattern, strtolower($string));\n }", "function smcf_validate_email($email) {\r\n\t$at = strrpos($email, \"@\");\r\n\r\n\t// Make sure the at (@) sybmol exists and \r\n\t// it is not the first or last character\r\n\tif ($at && ($at < 1 || ($at + 1) == strlen($email)))\r\n\t\treturn false;\r\n\r\n\t// Make sure there aren't multiple periods together\r\n\tif (preg_match(\"/(\\.{2,})/\", $email))\r\n\t\treturn false;\r\n\r\n\t// Break up the local and domain portions\r\n\t$local = substr($email, 0, $at);\r\n\t$domain = substr($email, $at + 1);\r\n\r\n\r\n\t// Check lengths\r\n\t$locLen = strlen($local);\r\n\t$domLen = strlen($domain);\r\n\tif ($locLen < 1 || $locLen > 64 || $domLen < 4 || $domLen > 255)\r\n\t\treturn false;\r\n\r\n\t// Make sure local and domain don't start with or end with a period\r\n\tif (preg_match(\"/(^\\.|\\.$)/\", $local) || preg_match(\"/(^\\.|\\.$)/\", $domain))\r\n\t\treturn false;\r\n\r\n\t// Check for quoted-string addresses\r\n\t// Since almost anything is allowed in a quoted-string address,\r\n\t// we're just going to let them go through\r\n\tif (!preg_match('/^\"(.+)\"$/', $local)) {\r\n\t\t// It's a dot-string address...check for valid characters\r\n\t\tif (!preg_match('/^[-a-zA-Z0-9!#$%*\\/?|^{}`~&\\'+=_\\.]*$/', $local))\r\n\t\t\treturn false;\r\n\t}\r\n\r\n\t// Make sure domain contains only valid characters and at least one period\r\n\tif (!preg_match(\"/^[-a-zA-Z0-9\\.]*$/\", $domain) || !strpos($domain, \".\"))\r\n\t\treturn false;\t\r\n\r\n\treturn true;\r\n}", "function is_zip ($zipcode = \"\")\r\n \t{\r\n \t\tif(empty($zipcode))\r\n \t\t{\r\n \t\treturn false;\r\n \t\t}\r\n \r\n \t\t$Bad = preg_replace(\"/([-0-9]+)/i\",\"\",$zipcode);\r\n \t\tif(!empty($Bad))\r\n \t\t{\r\n \t\treturn false;\r\n \t\t}\r\n \t\tif (strlen($zipcode)<>10){\r\n return false;\r\n }\r\n \r\n \t\tif ($zipcode[5] <> '-') {\r\n \t\t\treturn false;\r\n \t\t}\r\n \r\n \t\t$Num = preg_replace(\"/\\-/i\",\"\",$zipcode);\r\n \t\t$len = strlen($Num);\r\n \t\tif ($len <> 9)\t{\r\n \t\t\treturn false;\r\n \t\t}\r\n \t\treturn true;\r\n }", "public function isAddressSpecified(): bool\n {\n return ($this->getAddressZip() && $this->getAddressCity() && $this->getAddressCountry());\n }", "private static function is_email_address(string $username)\n {\n }", "function checkPostcode(&$toCheck) {\n\t$alpha1 = \"[abcdefghijklmnoprstuwyz]\"; // Character 1\n\t$alpha2 = \"[abcdefghklmnopqrstuvwxy]\"; // Character 2\n\t$alpha3 = \"[abcdefghjkpmnrstuvwxy]\"; // Character 3\n\t$alpha4 = \"[abehmnprvwxy]\"; // Character 4\n\t$alpha5 = \"[abdefghjlnpqrstuwxyz]\"; // Character 5\n\t// Expression for postcodes: AN NAA, ANN NAA, AAN NAA, and AANN NAA with a space\n\t$pcexp[0] = '/^(' . $alpha1 . '{1}' . $alpha2 . '{0,1}[0-9]{1,2})([[:space:]]{0,})([0-9]{1}' . $alpha5 . '{2})$/';\n\n\t// Expression for postcodes: ANA NAA\n\t$pcexp[1] = '/^(' . $alpha1 . '{1}[0-9]{1}' . $alpha3 . '{1})([[:space:]]{0,})([0-9]{1}' . $alpha5 . '{2})$/';\n\n\t// Expression for postcodes: AANA NAA\n\t$pcexp[2] = '/^(' . $alpha1 . '{1}' . $alpha2 . '{1}[0-9]{1}' . $alpha4 . ')([[:space:]]{0,})([0-9]{1}' . $alpha5 . '{2})$/';\n\n\t// Exception for the special postcode GIR 0AA\n\t$pcexp[3] = '/^(gir)(0aa)$/';\n\n\t// Standard BFPO numbers\n\t$pcexp[4] = '/^(bfpo)([0-9]{1,4})$/';\n\n\t// c/o BFPO numbers\n\t$pcexp[5] = '/^(bfpo)(c\\/o[0-9]{1,3})$/';\n\n\t// Overseas Territories\n\t$pcexp[6] = '/^([a-z]{4})(1zz)$/';\n\n\t// Load up the string to check, converting into lowercase\n\t$postcode = strtolower($toCheck);\n\n\t// Assume we are not going to find a valid postcode\n\t$valid = false;\n\n\t// Check the string against the six types of postcodes\n\tforeach ($pcexp as $regexp) {\n\t\tif (preg_match($regexp, $postcode, $matches)) {\n\n\t\t\t// Load new postcode back into the form element\n\t\t\t$postcode = strtoupper($matches[1] . ' ' . $matches [3]);\n\n\t\t\t// Take account of the special BFPO c/o format\n\t\t\t$postcode = str_replace('C\\/O', 'c/o ', $postcode);\n\n\t\t\t// Remember that we have found that the code is valid and break from loop\n\t\t\t$valid = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\n\t// Return with the reformatted valid postcode in uppercase if the postcode was\n\t// valid\n\tif ($valid) {\n\t\t$toCheck = $postcode;\n\t\t$data['post_code'] = $postcode;\n\t\t$_POST['post_code'] = $postcode;\n\t\treturn true;\n\t} else\n\t\treturn false;\n}", "private function isValidAddress($addressId)\r\n {\r\n $address = Shopware()->Models()->find('Shopware\\Models\\Customer\\Address',$addressId);\r\n return $this->get('shopware_account.address_validator')->isValid($address);\r\n }", "function isMACAddress($input) {\n\treturn ((substr_count($input, '-') == 5) || (substr_count($input, ':') == 5));\n}", "function isPhoneNumber($string) {\n\tif(preg_match(\"/^(1?(?: |\\-|\\.)?(?:\\(\\d{3}\\)|\\d{3})(?: |\\-|\\.)?\\d{3}(?: |\\-|\\.)?\\d{4})$/\",$string)==1)\n\t\t\treturn true;\n\telse\n\t\t\treturn false;\n}", "function checkPhoneNumber($telefono): bool {\n return is_string($telefono) and preg_match(\"/^([+][0-9]{1,3})?[0-9]{4,13}$/\", $telefono);\n}", "public function valid_phone($str)\n\t{\n\t\treturn ( ! ereg(\"^[0-9]{3}-[0-9]{3}-[0-9]{4}$\", $str)) ? FALSE : TRUE;\n\t}", "public function testPostal()\n {\n $this->assertTrue(RuValidation::postal('101135'));\n $this->assertTrue(RuValidation::postal('693000'));\n\n $this->assertFalse(RuValidation::postal('100123'));\n $this->assertFalse(RuValidation::postal('200321'));\n }", "private function validate_address_2($value)\n\t{\n\t\t$value = trim($value);\n\t\t// empty user name is not valid\n\t\tif ($value) {\n\t\t\t$p_field_valid = validator_helper::validate_alphanum($value);\n\t\t\t//since the validator function returns FALSE if invalid or the value if valid,\n\t\t\t//it's safer to check explicitly for not FALSE)\n\t\t\tif (!$p_field_valid === FALSE) {\n\t\t\t\t//echo \"p_field_valid: \" . $p_field_valid . \"<br>\";\n\t\t\t\treturn 1; // valid\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn 0; /* invalid characters */\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t return 1; /* field empty */\n\t\t}\n\t}", "private function isCurrencyValid($str)\n {\n if ($str === 'XTS' || strlen($str) !==3 || empty($this->repository->supplemental['codeMappings'][$str])) {\n return false;\n }\n\n return true;\n }", "public static function isIPWanAddress($string) {\n $bytes = self::isIPAddress($string, true);\n\n // Die Logik entspricht dem Gegenteil von self:: isIPLanAdress() + zusaetzlicher Tests.\n if ($bytes) {\n if ($bytes[0] == 10) // 10.0.0.0 - 10.255.255.255\n return false;\n\n if ($bytes[0] == 127) // 127.0.0.0 - 127.255.255.255\n return false;\n\n if ($bytes[0]==169) // 169.0.0.0 - 169.255.255.255 !!! wem zugewiesen? niemandem?\n return false;\n\n if ($bytes[0] == 172) // 172.16.0.0 - 172.31.255.255\n return !(15 < $bytes[1] && $bytes[1] < 32);\n\n if ($bytes[0]==192) // 192.168.0.0 - 192.168.255.255\n return ($bytes[1]!=168);\n }\n\n // dieses TRUE ist eher spekulativ\n return true;\n }", "public function verifyAndSetAddress($a,$bRequired) {\n\t\tif ($a['country'] != 'USA')\n\t\t\tthrow new exception(\"internation addresses not supported yet\");\n\t\t$this->country='USA';\t\t\n\t\t$this->line1 = isset($a['line1']) ? $a['line1'] : ''; \t\n\t\t$this->line2 = isset($a['line2']) ? $a['line2'] : ''; \t\n\t\t$this->city = isset($a['city']) ? $a['city'] : ''; \t\n\t\t$this->state = isset($a['state2']) ? $a['state2'] : ''; \t\n\t\t$this->zip = isset($a['zip']) ? $a['zip'] : ''; \t\n\t\t\t\n\t\tif ($this->line1 == '' && $this->line2 == '') {\n\t\t\tif ($bRequired || $this->city != '' || $this->zip != '')\n\t\t\t\treturn (array('*line1'=>'You must provide an address'));\n\t\t\telse {\n\t\t\t\t$this->city=$this->state=$this->zip='';\n\t\t\t\treturn True;\t\t// OK -- just no address\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t$retval=array();\n\t\tif ($this->city == '')\n\t\t\t$retval['*city']='You must provide a city';\n\t\tif ($this->zip == '')\n\t\t\t$retval['*zip']='You must provide a ZIP code';\n\t\telse {\n\t\t\t$nmatches=preg_match('/^[\\\\d]{5}(-[\\\\d]{4})??$/',$this->zip);\n\t\t\tif (0 == $nmatches)\n\t\t\t\t$retval['*zip']=\"Invalid ZIP code\";\n\t\t}\t\n\t\treturn (sizeof($retval) != 0) ? $retval : True;\n\t}", "function valid_email_address($mail) {\n $user = '[a-zA-Z0-9_\\-\\.\\+\\^!#\\$%&*+\\/\\=\\?\\`\\|\\{\\}~\\']+';\n $domain = '(?:(?:[a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\\-]*[a-zA-Z0-9])\\.?)+';\n $ipv4 = '[0-9]{1,3}(\\.[0-9]{1,3}){3}';\n $ipv6 = '[0-9a-fA-F]{1,4}(\\:[0-9a-fA-F]{1,4}){7}';\n\n return preg_match(\"/^$user@($domain|(\\[($ipv4|$ipv6)\\]))$/\", $mail);\n}", "function valid_mail($str) {\n\t\treturn (!preg_match(\"/^([a-z0-9\\+_\\-]+)(\\.[a-z0-9\\+_\\-]+)*@([a-z0-9\\-]+\\.)+[a-z]{2,6}$/ix\", $str)) ? FALSE : TRUE;\n\t}", "public function fromString($string)\n\t{\n\t\t$prefix = SteemHelper::str_slice($string, 0, strlen($this->address_prefix));\n\t\tif ($prefix != $this->address_prefix) {\n\t\t\treturn \"Expecting key to begin with \".$this->address_prefix.\", instead got \".$prefix;\n\t\t} else {\n\t\t\t$addy = SteemHelper::str_slice($string, strlen($this->address_prefix));\n\t\t\t$addy = new Buffer(Base58::decode($addy)->getHex());\n\t\t\t$checksum = $addy->slice(-4);\n\t\t\t$addy = $addy->slice(0, 4);\n\t\t\t$new_checksum = Hash::ripemd160($addy);\n\t\t\t$new_checksum = $new_checksum->slice(0, 4);\n\t\t\tif ($checksum->getHex() != $new_checksum->getHex())\n\t\t\t{\n\t\t\t\treturn 'Checksum did not match';\n\t\t\t}\n\t\t\t$SteemAddress = new SteemAddress($addy->getHex(), $this->address_prefix);\n\t\t\treturn $SteemAddress->toString();\n\t\t}\n\t}", "public function invalidAddresses() {}", "function CheckEmailAddress($addr,&$valid)\n{\n global $TARGET_EMAIL;\n\n $valid = \"\";\n $list = explode(\",\",$addr);\n for ($ii = 0 ; $ii < count($list) ; $ii++)\n {\n\t\t$email = UnMangle($list[$ii]);\n for ($jj = 0 ; $jj < count($TARGET_EMAIL) ; $jj++)\n if (eregi($TARGET_EMAIL[$jj],$email))\n {\n if (empty($valid))\n \t$valid = $email;\n else\n $valid .= \",\".$email;\n }\n }\n return (!empty($valid));\n}", "function _validateAddrSpec($addr_spec)\n {\n $addr_spec = trim($addr_spec);\n\n // Split on @ sign if there is one.\n if (strpos($addr_spec, '@') !== false) {\n $parts = explode('@', $addr_spec);\n $local_part = $this->_splitCheck($parts, '@');\n $domain = substr($addr_spec, strlen($local_part . '@'));\n\n // No @ sign so assume the default domain.\n } else {\n $local_part = $addr_spec;\n $domain = $this->default_domain;\n }\n\n if (($local_part = $this->_validateLocalPart($local_part)) === false) return false;\n if (($domain = $this->_validateDomain($domain)) === false) return false;\n\n // Got here so return successful.\n return array('local_part' => $local_part, 'domain' => $domain);\n }", "public function isValid($str)\n {\n\t\t$return = true;\n\t\t\n\t\tif ($str == '') {\n\t\t\t$this->setError(self::STRING_EMPTY);\n\t\t\t$return = false;\n\t\t}\n\t\t\n\t\t// Validate an email Address\n\t\tif (preg_match(self::EMAIL_REGEX, $str)) {\n\t\t\t$email = explode('@', $str);\n\t\t\tif ($this->_checkDns) {\n\t\t\t\tif (!checkdnsrr($email[1], 'MX')) {\n\t\t\t\t\t$this->setError(self::ERROR_DNS);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t$this->setError(self::ERROR_REGEX);\n\t\treturn false;\n }", "function verifyAndCleanAddresses($data, $subnets_allowed = 'subnets-allowed') {\n\t/** Remove extra spaces */\n\t$data = preg_replace('/\\s\\s+/', ' ', $data);\n\t\n\t/** Swap delimiters for ; */\n\t$data = str_replace(array(\"\\n\", ';', ' ', ','), ',', $data);\n\t$data = str_replace(',,', ',', $data);\n\t$data = trim($data, ',');\n\t\n\t$addresses = explode(',', $data);\n\tforeach ($addresses as $ip_address) {\n\t\t$cidr = null;\n\n\t\t$ip_address = rtrim(trim($ip_address), '.');\n\t\tif (!strlen($ip_address)) continue;\n\t\t\n\t\t/** Handle negated addresses */\n\t\tif (strpos($ip_address, '!') === 0) {\n\t\t\t$ip_address = substr($ip_address, 1);\n\t\t}\n\t\t\n\t\tif (strpos($ip_address, '/') !== false && $subnets_allowed == 'subnets-allowed') {\n\t\t\t$cidr_array = explode('/', $ip_address);\n\t\t\tlist($ip_address, $cidr) = $cidr_array;\n\t\t}\n\t\t\n\t\t/** IPv4 checks */\n\t\tif (strpos($ip_address, ':') === false) {\n\t\t\t/** Valid CIDR? */\n\t\t\tif ($cidr && !checkCIDR($cidr, 32)) return sprintf(__('%s is not valid.'), \"$ip_address/$cidr\");\n\t\t\t\n\t\t\t/** Create full IP */\n\t\t\t$ip_octets = explode('.', $ip_address);\n\t\t\tif (count($ip_octets) < 4) {\n\t\t\t\t$ip_octets = array_merge($ip_octets, array_fill(count($ip_octets), 4 - count($ip_octets), 0));\n\t\t\t}\n\t\t\t$ip_address = implode('.', $ip_octets);\n\t\t} else {\n\t\t\t/** IPv6 checks */\n\t\t\tif ($cidr && !checkCIDR($cidr, 128)) return sprintf(__('%s is not valid.'), \"$ip_address/$cidr\");\n\t\t}\n\t\t\n\t\tif (verifyIPAddress($ip_address) === false) return sprintf(__('%s is not valid.'), $ip_address);\n\t}\n\t\n\treturn $data;\n}", "function ValidEmail( $address, $leMail )\r\n\t\t{\r\n\t\tif( ereg( \".*<(.+)>\", $address, $regs ) )\r\n\t\t\t$address = $regs[1];\r\n\r\n\t\tif( !ereg( \"^[^@ ]+@([a-zA-Z0-9\\-]+\\.)+([a-zA-Z0-9\\-]{2}|net|com|gov|mil|org|edu|int)\\$\",$address) )\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t\t}", "function eth_verify_wallet($addr, $sig) {\n\treturn true;\n}", "function isValidSSN($ssn) {\n if (!preg_match(\"/\\b(((20)((0[0-9])|(1[0-8])))|(([1][^0-8])\\d{2}))((0[1-9])|1[0-2])((0[1-9])|(1[0-9])|(2[0-9])|(3[0-1]))[-]?\\d{4}?\\b/\", $ssn)) {\n return false;\n } else {\n $year = substr($ssn, 0, 4);\n $month = substr($ssn, 4, 2);\n $date = substr($ssn, 6, 2);\n\n return checkdate($month, $date, $year);\n }\n}", "public static function _postalcode($value, $field) {\n\t\t$regex = '/^[A-Za-z][0-9][A-Za-z] ?[0-9][A-Za-z][0-9]$/';\n\t\treturn (bool)preg_match($regex, $value);\n\t}", "public function validateEmailFormat($string)\n {\n if (strpos($string, '@') !== false && strpos($string, '.') !== false) {\n return true;\n }\n\n return false;\n }", "static function checkEmailAddress($input)\r\n {\r\n if (filter_var($input, FILTER_VALIDATE_EMAIL)) {\r\n return true;\r\n } else {\r\n echo PageBuilder::printError(\"Please enter a valid email id.\");\r\n return false;\r\n }\r\n }", "function is_email(mixed $string): bool\n {\n return (bool) filter_var($string, FILTER_VALIDATE_EMAIL);\n }", "function check_email_address($email) {\n # Check @ symbol and lengths\n if (!ereg(\"^[^@]{1,64}@[^@]{1,255}$\", $email)) {\n return false;\n }\n\n # Split Email Address into Sections\n $email_array = explode(\"@\", $email);\n $local_array = explode(\".\", $email_array[0]);\n\n # Validate Local Section of the Email Address\n for ($i = 0; $i < sizeof($local_array); $i++) {\n if (!ereg(\"^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$\", $local_array[$i])) {\n return false;\n }\n }\n\n # Validate Domain Section of the Email Address\n if (!ereg(\"^\\[?[0-9\\.]+\\]?$\", $email_array[1])) {\n $domain_array = explode(\".\", $email_array[1]);\n\n # Check the number of domain elements\n if (sizeof($domain_array) < 2) {\n return false;\n }\n\n # Sanity Check All Email Components\n for ($i = 0; $i < sizeof($domain_array); $i++) {\n if (!ereg(\"^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$\", $domain_array[$i])) {\n return false;\n }\n }\n }\n\n # If All Validation Checks have Passed then Return True\n return true;\n }", "function contains_phone_number($string)\r\n{\r\n // Check for phone number\r\n if(ereg(\"[[:digit:]]{3,10}[\\. /\\)\\(-]*[[:digit:]]{6,10}\", $string))\r\n {\r\n return(true);\r\n }\r\n\r\n // Passed the test\r\n return(false);\r\n}", "private function isValid($input)\n {\n // replace german umlauts and whitespace cause only ascii allowed\n // german letters was requirement by prof\n $input = str_replace(self::$SEARCH, self::$REPLACE, $input);\n\n // more than one comma or other chars than a-z\n if (substr_count($input, \",\") > 1 || !preg_match(self::$REGEX, $input))\n return false;\n\n // split input in city and country if necessary\n if (strpos($input, ','))\n {\n $a = explode(',', $input);\n $this->city = $a[0];\n $this->country = $a[1];\n }\n else\n {\n $this->city = $input;\n $this->country = 'DE';\n }\n\n return true;\n }", "function valid_ip($ip)\n\t{\n\t\t$ip_segments = explode('.', $ip);\n\n\t\t// Always 4 segments needed\n\t\tif (count($ip_segments) != 4)\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t// IP can not start with 0\n\t\tif ($ip_segments[0][0] == '0')\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t// Check each segment\n\t\tforeach ($ip_segments as $segment)\n\t\t{\n\t\t\t// IP segments must be digits and can not be\n\t\t\t// longer than 3 digits or greater then 255\n\t\t\tif ($segment == '' OR preg_match(\"/[^0-9]/\", $segment) OR $segment > 255 OR strlen($segment) > 3)\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function testValidPostalCode()\n {\n $request = ['postal_code' => '1000 AP'];\n $rules = ['postal_code' => 'postal_code:NL'];\n $validator = $this->factory->make($request, $rules);\n\n $this->assertFalse($validator->fails());\n }", "function is_email_address_unsafe($user_email)\n {\n }", "static function checkEmailAddress($input)\r\n {\r\n if (filter_var($input, FILTER_VALIDATE_EMAIL)) {\r\n return true;\r\n } else {\r\n echo PageBuilder::printError(\"Username or Password is Incorrect!\");\r\n return false;\r\n }\r\n }", "public function isValid($value)\n {\n if (! is_string($value)) {\n $this->error(self::INVALID);\n return false;\n }\n\n $this->setValue($value);\n\n if ($this->options['allowipv4'] && $this->validateIPv4($value)) {\n return true;\n } else {\n if ((bool) $this->options['allowliteral']) {\n static $regex = '/^\\[(.*)\\]$/';\n if ((bool) preg_match($regex, $value, $matches)) {\n $value = $matches[1];\n }\n }\n\n if (($this->options['allowipv6'] && $this->validateIPv6($value)) ||\n ($this->options['allowipvfuture'] && $this->validateIPvFuture($value))\n ) {\n return true;\n }\n }\n $this->error(self::NOT_IP_ADDRESS);\n return false;\n }", "function check_email_address($email) \n{\n // First, we check that there's one @ symbol, and that the lengths are right\n if (!ereg(\"^[^@]{1,64}@[^@]{1,255}$\", $email)) \n {\n // Email invalid because wrong number of characters in one section, or wrong number of @ symbols.\n return false;\n }\n // Split it into sections to make life easier\n $email_array = explode(\"@\", $email);\n $local_array = explode(\".\", $email_array[0]);\n for ($i = 0; $i < sizeof($local_array); $i++) \n {\n if (!ereg(\"^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\\.-]{0,63})|(\\\"[^(\\\\|\\\")]{0,62}\\\"))$\", $local_array[$i])) \n {\n return false;\n }\n }\n if (!ereg(\"^\\[?[0-9\\.]+\\]?$\", $email_array[1])) \n { // Check if domain is IP. If not, it should be valid domain name\n $domain_array = explode(\".\", $email_array[1]);\n if (sizeof($domain_array) < 2) \n {\n return false; // Not enough parts to domain\n }\n for ($i = 0; $i < sizeof($domain_array); $i++) \n {\n if (!ereg(\"^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$\", $domain_array[$i])) \n {\n return false;\n }\n }\n }\n return true;\n}" ]
[ "0.7711252", "0.76984745", "0.7580868", "0.7476283", "0.7337337", "0.73201704", "0.72997934", "0.72327906", "0.7226317", "0.7121425", "0.70425487", "0.6957059", "0.67550516", "0.67479223", "0.6653141", "0.6607044", "0.6558494", "0.65421486", "0.64856106", "0.6465479", "0.64576954", "0.64570457", "0.6349898", "0.6324864", "0.6310728", "0.62811214", "0.62779075", "0.6271444", "0.62589693", "0.62086725", "0.61859226", "0.617371", "0.6119098", "0.6075807", "0.6062241", "0.6052467", "0.6048019", "0.6046763", "0.6032302", "0.6003269", "0.596722", "0.5961822", "0.59597635", "0.59524083", "0.5945996", "0.5903187", "0.5902831", "0.58979523", "0.58918315", "0.58913326", "0.58795184", "0.58764625", "0.58751065", "0.58619213", "0.5851201", "0.584638", "0.58447677", "0.58233076", "0.5818194", "0.58066136", "0.57969713", "0.5794523", "0.5777464", "0.57756066", "0.5773978", "0.57654274", "0.5759875", "0.5749415", "0.5747013", "0.57412463", "0.57390195", "0.5734485", "0.57129836", "0.5706279", "0.5701203", "0.5680985", "0.56778395", "0.56736946", "0.5671463", "0.56689954", "0.5668619", "0.5650629", "0.5632549", "0.5630523", "0.5629054", "0.5628186", "0.56257594", "0.56069756", "0.55999815", "0.5583661", "0.557829", "0.5570316", "0.55701125", "0.5562997", "0.55581886", "0.55573934", "0.55515057", "0.555042", "0.55482775", "0.5544751", "0.55422145" ]
0.0
-1
/ Verifies a message signed with a bitcoin address
public function verifyMessage($address, $sig, $message) { $body = ['sig' => $sig, 'message' => $message]; $result = $this->newAPIRequest('GET', '/message/verify/'.$address, $body); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verifymessage($address, $signature, $message) {\n // curve definition\n // http://www.secg.org/download/aid-784/sec2-v2.pdf\n $secp256k1 = new CurveFp(\n '0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F', '0', '7');\n $secp256k1_G = new Point($secp256k1,\n '0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798',\n '0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8',\n '0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141');\n\n\t// extract parameters\n\t$address = base58check_decode($address);\n\tif (strlen($address) != 21 || $address[0] != \"\\x0\") {\n\t\tthrow new Exception('invalid Bitcoin address');\n\t}\n\n\t$signature = base64_decode($signature, true);\n\tif ($signature === false) {\n\t\tthrow new Exception('invalid base64 signature');\n\t}\n\n\tif (strlen($signature) != 65) {\n\t\tthrow new Exception('invalid signature length');\n\t}\n\n\t$recoveryFlags = ord($signature[0]) - 27;\n\tif ($recoveryFlags < 0 || $recoveryFlags > 7) {\n\t\tthrow new Exception('invalid signature type');\n\t}\n\t$isCompressed = ($recoveryFlags & 4) != 0;\n\n\t// hash message, recover key\n\t$messageHash = hash('sha256', hash('sha256', \"\\x18Bitcoin Signed Message:\\n\" . numToVarIntString(strlen($message)).$message, true), true);\n\t$pubkey = recoverPubKey(bin2gmp(substr($signature, 1, 32)), bin2gmp(substr($signature, 33, 32)), bin2gmp($messageHash), $recoveryFlags, $secp256k1_G);\n\tif ($pubkey === false) {\n\t\tthrow new Exception('unable to recover key');\n\t}\n\t$point = $pubkey->getPoint();\n\n\t// see that the key we recovered is for the address given\n\tif (!$isCompressed) {\n\t\t$pubBinStr = \"\\x04\" . str_pad(gmp2bin($point->getX()), 32, \"\\x00\", STR_PAD_LEFT) .\n\t\t\t\t\t\t\t str_pad(gmp2bin($point->getY()), 32, \"\\x00\", STR_PAD_LEFT);\n\t} else {\n\t\t$pubBinStr =\t(isBignumEven($point->getY()) ? \"\\x02\" : \"\\x03\") .\n\t\t\t\t\t\t\t str_pad(gmp2bin($point->getX()), 32, \"\\x00\", STR_PAD_LEFT);\n\t}\n\t$derivedAddress = \"\\x00\". hash('ripemd160', hash('sha256', $pubBinStr, true), true);\n\n\treturn $address === $derivedAddress;\n}", "public function verifymessage($address, $sig, $message){\n return $this->bitcoin->verifymessage($address, $sig, $message);\n }", "function eth_verify_wallet($addr, $sig) {\n\treturn true;\n}", "public function verifymessage($bitcoinaddress, $signature, $message)\n\t{\n\t\t$result = $this->connect('verifymessage', array((string) $bitcoinaddress, (string) $signature, (string) $message));\n\t\tif ( ! is_null($error = $this->_get_error($result)))\n\t\t{\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn (bool) $result;\n\t\t}\n\t}", "public function validateInboundMessage(){\n\t\t$hashData = $this->timestamp . \"\" . $this->token;\n\t\t$computedSignature = hash_hmac(\"sha256\",$hashData , $this->MGAPIKEY);\n\t\t$providedSignature = $this->signature;\n\t\tif ($computedSignature == $providedSignature){\n\t\t\tif($this->validateSender()){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function verifyAddress(string $address)\n {\n return $this->execute($this->getCoin() . '/verifyaddress', 'POST', [\n 'address' => $address\n ]);\n }", "public function checkHash()\n {\n $config = $this->getDI()->get('config');\n $connect_string = sprintf('http://%s:%s@%s:%s/', $config->eunod->user, $config->eunod->pass, $config->eunod->host, $config->eunod->port);\n $coind = new jsonRPCClient($connect_string);\n\n return $coind->verifymessage($this->masternode_address, $this->signed_msg, $this->telegram_username);\n }", "public function signmessage($bitcoinaddress, $message)\n\t{\n\t\t$result = $this->connect('signmessage', array((string) $bitcoinaddress, (string) $message));\n\t\tif ( ! is_null($error = $this->_get_error($result)))\n\t\t{\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\t}", "public function validate_address($address) { \n\n\t// Decode\n\t$decode = $this->base58_decode($address); \n\tif (strlen($decode) != 50) { return false; }\n\n\t// Compare address versionok\\n\n\t$version = substr($decode, 0, 2);\n\t$p2sh_byte = TESTNET == 1 ? 'c4' : '05';\n\tif (hexdec($version) > hexdec($this->public_prefix) && $version != $p2sh_byte) { return false; }\n\n\t// Compare checksum\n\t$hash = hash('sha256', hash('sha256', pack(\"H*\", substr($decode, 0, 42)), true));\n\treturn substr($decode, -8) == substr($hash, 0, 8);\n\t\t\n}", "function verify () {\n// $aop->alipayrsaPublicKey='MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjUzhXrdJ7GDsgJ59fMLlk7hyYrXkkeGwnYD/eO2HBZh39Y9gTfLJ61Yogc7keOn2uAnZY/zBlw3n+T6mb6/5JYFgvXQi8Qzeh6BkBrNnROu+k4PjhmSbORJFoLrrIxDnsYkQ995kYYhpbS0yf2Al++55v4SrD3/YoVBhWPcRg4xI0QD94FLwhCmcCkft/ILRtUxQk2QeVPLSesvMx2mmUK2L2x2hFA8ewRoGmUdG2Fu9YFIxk//16RI+H7KI8LaoXoVDqHobPae9p0ACE7k9G5vs/cYuikSMKu+lnxghte1jNO+CqrvTP4Pes/mW4e7CEMCTAmEnsXLUrQ6FpfKMcQIDAQAB';\n return $this->aop->rsaCheckV1($_POST, NULL, \"RSA2\");\n }", "function checkSignature($encodingAesKey,$token,$corpId)\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"msg_signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n $echoStr = $_GET[\"echostr\"]; \n $token = TOKEN;\n $wxcpt = new WXBizMsgCrypt($token, $encodingAesKey, $corpId);\n $errCode = $wxcpt->VerifyURL($signature, $timestamp, $nonce, $echoStr, $sEchoStr);\n if ($errCode == 0) {\n //\n // 验证URL成功,将sEchoStr返回\n //HttpUtils.SetResponce($sEchoStr);\n echo $sEchoStr;\n return true;\n } else {\n print(\"ERR: \" . $errCode . \"\\n\\n\");\n return false;\n }\n }", "function verifyMessage($certfile, $data, $signature) {\r\n\r\n // $data and $signature are assumed to contain the data and the signature\r\n $ok=0;\r\n // fetch public key from certificate and ready it\r\n $fp = fopen( \"security/\" . $certfile, \"r\");\r\n \r\n if(!$fp) {\r\n return false;\r\n }\r\n \r\n $cert = fread($fp, 8192);\r\n fclose($fp);\r\n $pubkeyid = openssl_get_publickey($cert);\r\n\r\n // state whether signature is okay or not\r\n $ok = openssl_verify($data, $signature, $pubkeyid);\r\n \r\n // free the key from memory\r\n openssl_free_key($pubkeyid);\r\n\r\n return $ok;\r\n\r\n }", "public function testCheckAddress() {\n\t$this->assertTrue(Bitcoin::checkAddress(\"1pA14Ga5dtzA1fbeFRS74Ri32dQjkdKe5\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1MU97wyf7msCVdaapneW2dW1uXP7oEQsFA\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1F417eczAAbh41V4oLGNf3DqXLY72hsM73\"));\n\t$this->assertTrue(Bitcoin::checkAddress(\"1ASgNrpNNejRJVfqK2jHmfJ3ZQnMSUJkwJ\"));\n\t$this->assertFalse(Bitcoin::checkAddress(\"1ASgNrpNNejRJVfqK2jHmfJ3ZQnMSUJ\"));\n\t$this->assertFalse(Bitcoin::checkAddress(\"1111111fnord\"));\n\t}", "public function verify();", "function is_valid_btcaddress($pubkey)\r\n\t{\r\n\r\n\t$forbidden_chars = array(\";\",\"$\",\"*\",\"!\",\"[\",\"]\",\"@\",\"#\",\"%\",\"^\",\"&\");\r\n\t$minimal_lenght = 25;\r\n\t\r\n\t$errors_sum =0;\r\n\t//check pubkey lenght\r\n\tif (strlen($pubkey)<$minimal_lenght)\r\n\t\t$errors_sum=$errors_sum+1;\t\r\n\t// check if address begins from 1\t\t\r\n\tif ($pubkey[0]!='1')\r\n\t\t$errors_sum=$errors_sum+1;\r\n\t//check if forbidden chars occure\r\n\tforeach ($forbidden_chars as &$forbidden_character)\r\n\t\t{\r\n\t\tif (strpos($pubkey, $forbidden_character))\r\n\t\t\t$errors_sum=$errors_sum+1;\t\r\n\t\t}\r\n\t//result of checking\r\n\tif ($errors_sum ==0)\r\n\t\treturn true;\r\n\telse\r\n\t\treturn false;\r\n\r\n\t}", "function verify_msg($data)\n\t{\n\t\t// we are using '-v' specifically to catch clear message\n\t\t// after signature verification is complete\n\t\t$body = $this->call(\"{$this->context} -v -d\", 'post', $data);\n\n\t\t$results = [\n\t\t\tfalse,\t// [0]\n\t\t\tnull,\t// [1]\n\t\t\tnull,\t// [2]\n\t\t\tnull,\t// [3]\n\t\t\t$body,\t// [4], always defined\n\t\t\t0,\t\t// [5]\n\t\t];\n\n\t\t// checking status codes of the verification operation\n\t\tif (false === $status = $this->get_status())\n\t\t{\n\t\t\t// something's wrong, aborting\n\t\t\t$results[0] = null;\n\t\t\treturn $results;\n\t\t}\n\t\telse foreach ($status as $code)\n\t\t{\n\t\t\tif ($code[0] == 'VALIDSIG')\n\t\t\t{\n\t\t\t\t// defining output elements for good sig\n\t\t\t\t$results[0] = true;\n\t\t\t\t$results[1] = $code[10];\n\t\t\t\t$results[2] = $code[3];\n\t\t\t}\n\t\t\telse if ($code[0] == 'BADSIG')\n\t\t\t{\n\t\t\t\t// in case of bad signature we return\n\t\t\t\t// long key_id, not a full FPR!\n\t\t\t\t$results[1] = $code[1];\n\t\t\t}\n\t\t\telse if ($code[0] == 'ERRSIG')\n\t\t\t{\n\t\t\t\t// signature verification error (no pubkey?).\n\t\t\t\t// only long key_id is returned!\n\t\t\t\t$results[0] = null;\n\t\t\t\t$results[1] = $code[1];\n\t\t\t\t$results[2] = $code[5];\n\t\t\t}\n\t\t\telse if ($code[0] == 'EXPKEYSIG')\n\t\t\t{\n\t\t\t\t// signature with expired key\n\t\t\t\t$results[5] = 1;\n\t\t\t}\n\t\t\telse if ($code[0] == 'EXPSIG')\n\t\t\t{\n\t\t\t\t// signature itself is expired\n\t\t\t\t$results[5] = 2;\n\t\t\t}\n\t\t\telse if ($code[0] == 'REVKEYSIG')\n\t\t\t{\n\t\t\t\t// signing key is revoked\n\t\t\t\t$results[5] = 3;\n\t\t\t}\n\t\t\telse if ($code[0] == 'SIG_ID')\n\t\t\t{\n\t\t\t\t// defining remaining output element: sigID\n\t\t\t\t// (if applicable)\n\t\t\t\t$results[3] = $code[1];\n\t\t\t}\n\t\t\telse if ($code[0] == 'ERROR' || $code[0] == 'NODATA')\n\t\t\t{\n\t\t\t\t// input error encountered, aborting\n\t\t\t\t$results[0] = null;\n\t\t\t\treturn $results;\n\t\t\t}\n\t\t}\n\n\t\treturn $results;\n\t}", "abstract public function verify($data, $signature);", "public static function checkUnmarshalledVerifySigRequest( ThreeDSecureRequest $fromXmlRequest, PHPUnit_Framework_TestCase $testCase ) {\n\n\t\t$testCase->assertNotNull( $fromXmlRequest );\n\t\t$testCase->assertEquals( self::CARD_NUMBER, $fromXmlRequest->getCard()->getNumber() );\n\t\t$testCase->assertEquals( self::$CARD_TYPE->getType(), $fromXmlRequest->getCard()->getType() );\n\t\t$testCase->assertEquals( self::CARD_HOLDER_NAME, $fromXmlRequest->getCard()->getCardHolderName() );\n\t\t$testCase->assertEquals( self::CARD_EXPIRY_DATE, $fromXmlRequest->getCard()->getExpiryDate() );\n\n\t\t$testCase->assertEquals( self::ACCOUNT, $fromXmlRequest->getAccount() );\n\t\t$testCase->assertEquals( self::MERCHANT_ID, $fromXmlRequest->getMerchantId() );\n\t\t$testCase->assertEquals( ThreeDSecureType::VERIFY_SIG, $fromXmlRequest->getType() );\n\t\t$testCase->assertEquals( self::AMOUNT, $fromXmlRequest->getAmount()->getAmount() );\n\t\t$testCase->assertEquals( self::CURRENCY, $fromXmlRequest->getAmount()->getCurrency() );\n\t\t$testCase->assertEquals( self::TIMESTAMP, $fromXmlRequest->getTimeStamp() );\n\t\t$testCase->assertEquals( self::ORDER_ID, $fromXmlRequest->getOrderId() );\n\n\t\t$testCase->assertEquals( self::THREE_D_SECURE_PARES, $fromXmlRequest->getPares() );\n\t\t$testCase->assertEquals( self::THREE_D_SECURE_VERIFY_SIG_REQUEST_HASH, $fromXmlRequest->getHash() );\n\t}", "public function validateaddress($address){\n return $this->bitcoin->validateaddress($address);\n }", "private function Sm2Verify($md, $PubKeyX, $PubKeyY, $VerfiySign,$generator)\r\n {\r\n $InSignBuf = array();\r\n\r\n $InSignBuf=Hex2ByteBuf::HexStringToByteArray($VerfiySign);\r\n\r\n\r\n $Kx = gmp_init($PubKeyX, 16);\r\n $Ky = gmp_init($PubKeyY, 16);\r\n\r\n $PubKey = $generator->getPublicKeyFrom($Kx,$Ky,null);\r\n $r = gmp_init(substr($VerfiySign,0, 64), 16);\r\n $s = gmp_init(substr($VerfiySign,64, 64), 16);\r\n\r\n $ecc_point_g=$generator->getCurve()->getPoint($generator->GetX(), $generator->GetY());\r\n\r\n $Sm2Ret=$this->sub_Sm2Verify($md, $PubKey , $r, $s,$ecc_point_g,$generator);\r\n\r\n if (gmp_cmp($r,$Sm2Ret)==0)\r\n {\r\n return true;\r\n }\r\n else\r\n return false;\r\n\r\n }", "public function testVerify()\n {\n $this->assertFalse(\n SmsVerification::of($this->config)->verify('+456', 'TEST_SECRET')\n );\n\n // Assert false when the phone is not stored\n $this->assertFalse(\n SmsVerification::of($this->config)->verify('+123', 'CLIENT_SECRET')\n );\n\n // Assert true when the phone and secret are properly given\n $this->assertFalse(\n SmsVerification::of($this->config)->verify('+123', 'TEST_SECRET')\n );\n }", "public function signmessage($address, $message){\n return $this->bitcoin->signmessage($address, $message);\n }", "public function verify(array $message, $sig)\n {\n return $this->verifier->verify($message, $sig);\n }", "public function testReturnTrueOnValidBitcoinAddress()\n {\n $result = Wallet::validate(self::VALID_BTC_ADDRESS, Wallet::BITCOIN);\n\n $this->assertTrue($result);\n }", "public function verifySignedMessage(string $signedMessage, string $publicKey): string\n {\n try {\n $publicKey = sodium_hex2bin($publicKey);\n $signedMessage = sodium_base642bin($signedMessage, SODIUM_BASE64_VARIANT_ORIGINAL);\n if (strlen($publicKey) !== SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES) {\n throw new InvalidArgumentException('The key must be ' . SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES . ' long.');\n }\n\n if (strlen($signedMessage) === 0) {\n throw new InvalidArgumentException('The message must not be empty.');\n }\n\n $result = sodium_crypto_sign_open($signedMessage, $publicKey);\n if ($result === false) {\n throw new RuntimeException('Could not verify message.');\n }\n return $result;\n } catch (SodiumException $e) {\n throw new RuntimeException('Could not verify data', 0, $e);\n }\n }", "public static function verifySignature($signature, $msg, $key) : bool\n {\n $verified = sodium_crypto_sign_verify_detached(\n sodium_hex2bin($signature),\n sodium_hex2bin(self::hashObject($msg)),\n sodium_hex2bin($key)\n );\n\n return is_bool($verified) && $verified == true;\n }", "public function verify($message, $signature)\n {\n $jsonMessage = Util::toJson($message);\n return $this->verifyString($jsonMessage, $signature);\n }", "public function verify(string $message, string $signature): string\n {\n return ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $message, $this->key);\n }", "public function checkAddress($address)\n\t\t{\n\t\t\t$address = strip_tags($address);\n\t\t\t\n\t\t\t$this->groestlcoin->validateaddress($address);\n\t\t\t\n\t\t\tif ($this->groestlcoin->response['result']['isvalid'] == 1){\n\t\t\t\treturn 1;}\n\t\t\telse{\n\t\t\t\treturn 0;}\t\t\t\n\t\t}", "function verifyPaymentDatafeed($src, $prc, $successCode, $merchantReferenceNumber, $paydollarReferenceNumber, $currencyCode, $amount, $payerAuthenticationStatus, $secureHashSecret, $secureHash) {\r\n\t$buffer = $src . '|' . $prc . '|' . $successCode . '|' . $merchantReferenceNumber . '|' . $paydollarReferenceNumber . '|' . $currencyCode . '|' . $amount . '|' . $payerAuthenticationStatus . '|' . $secureHashSecret;\r\n\t$verifyData = sha1($buffer);\r\n\tif ($secureHash == $verifyData) { return true; }\r\n\treturn false;\r\n}", "protected function checkSignature()\n {\n $headers = \\Yii::$app->request->headers;\n\n $signature = $headers->get('paypal-transmission-sig');\n if (!$signature)\n throw new BadRequestHttpException;\n\n $checkString = sprintf('%s|%s|%s|%s',\n $headers->get('paypal-transmission-id'),\n $headers->get('paypal-transmission-time'),\n $this->webHookId,\n crc32(\\Yii::$app->request->rawBody)\n );\n\n $certUrl = $headers->get('paypal-cert-url');\n if (!$certUrl)\n throw new BadRequestHttpException;\n\n $publicKey = $this->fetchPublicKey($certUrl);\n if (!$publicKey)\n throw new \\Exception('Certificate error');\n\n// $algo = ArrayHelper::getValue($headers, 'paypal-hash-algo');\n\n $result = openssl_verify($checkString, base64_decode($signature), $publicKey);\n return $result === 1;\n }", "public function needsVerificationMessage ();", "public function textToVerify()\n {\n $code = random_int(100000, 999999);\n\n $sid = config('services.twilio.sid');\n $token = config('services.twilio.token');\n $from = config('services.twilio.number');\n\n $this->forceFill([\n 'verification_code' => $code,\n 'code_sent_at' => $this->freshTimestamp(),\n ])->save();\n\n $country_code = $this->user()->country_code ?? config('auth.defaults.country_code');\n $to = strval($country_code.$this->user->phone);\n $amount = $this->amount - $this->fee;\n\n $message = \"Hello from Auric Shops! Your One Time Password for a Withdrawal of ₹\".$amount.\" is: \".$code.\" \\n For Security reasons, don't share it with anyone!\";\n\n\n $client = new Client($sid, $token);\n\n $client->messages->create(\n $to,\n [\n \"body\" => $message,\n \"from\" => $from\n ]\n );\n }", "public function verifyMessageSignature(string $message, string $signature, string $publicKey): bool\n {\n try {\n $publicKey = sodium_hex2bin($publicKey);\n $signature = sodium_hex2bin($signature);\n if (strlen($publicKey) !== SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES) {\n throw new InvalidArgumentException('The key must be ' . SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES . ' long.');\n }\n\n if (strlen($message) === 0) {\n throw new InvalidArgumentException('The message must not be empty.');\n }\n\n if (strlen($signature) !== SODIUM_CRYPTO_SIGN_BYTES) {\n throw new InvalidArgumentException('The signature must be ' . SODIUM_CRYPTO_SIGN_BYTES . ' long.');\n }\n\n return sodium_crypto_sign_verify_detached($signature, $message, $publicKey);\n } catch (SodiumException $e) {\n throw new RuntimeException('Could not verify data', 0, $e);\n }\n }", "public function verify() {\n\t\t$this->getBasics();\n\t\t$this->getParams();\n\t\t$this->getLanguage();\n\n\t\t$this->load->model( 'checkout/order' );\n\t\t$this->load->library( 'encryption' );\n\n\t\t$encryption = new Encryption( $this->config->get( 'config_encryption' ) );\n\n\t\t$forbidden\t\t\t= array( 'route', 'hash', 'email_sender', 'email_recipient' );\n\t\t$retData\t\t\t= array();\n\t\t$securityCriteria\t= 0; // integer!\n\t\t$project_id\t\t\t= '0';\n\t\t$err\t\t\t\t= false;\n\n\t\t// filter variables\n\t\tforeach( $this->request->post as $key => $value) {\n\t\t\tif( !in_array( $key, $forbidden ) ) {\n\t\t\t\t$retData[$key] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8' );\n\t\t\t}\n\n\t\t\t// get value of security_criteria\n\t\t\tif( $key == 'security_criteria' ) {\n\t\t\t\t$securityCriteria = $value;\n\t\t\t}\n\n\t\t\t// decrypt order_id\n\t\t\tif( $key == 'user_variable_3' ) {\n\t\t\t\t$order_id = $encryption->decrypt( $value );\n\t\t\t}\n\n\t\t\t// get hash value\n\t\t\tif( $key == 'hash' ) {\n\t\t\t\t$this->hashValue = $value;\n\t\t\t}\n\n\t\t\t// get project id\n\t\t\tif( $key == 'project_id' ) {\n\t\t\t\t$project_id = $value;\n\t\t\t}\n\t\t}\n\n\t\tif( $this->_debug == 1 ) {\n\t\t\techo '## FUNCTION verify' . \"\\n\";\n\t\t\techo '## calling getNotifyHash:' . \"\\n\";\n\t\t}\n\n\t\t// calculate hash value\n\t\t$hash = $this->getNotifyHash( $retData );\n\n\t\tif( $this->_debug == 1 ) {\n\t\t\techo \"\\n\" . '## $_POST data from directebanking:' . \"\\n\";\n\t\t\tprint_r( $_POST ) . \"\\n\";\n\t\t\techo 'retData (cleaned POST for calculating hash):' . \"\\n\";\n\t\t\tprint_r( $retData );\n\t\t\techo \"\\n\";\n\n\t\t\techo '--> submitted hash [' . $this->hashValue . ']' . \"\\n\";\n\t\t\techo '--> calculated hash [' . $hash . ']' . \"\\n\";\n\t\t\techo '--> securityCriteria [' . ( $securityCriteria ? 'true' : 'false' ) . ']' . \"\\n\";\n\n\t\t\t// write also log entry\n\t\t\t$msg = '## $_POST data from directebanking:<br />'\n\t\t\t. print_r( $_POST, true )\n\t\t\t. '<br />retData (cleaned POST for calculating hash):<br />'\n\t\t\t. print_r( $retData, true )\n\t\t\t. '<br />--> submitted hash [' . $this->hashValue . ']<br />'\n\t\t\t. '--> calculated hash [' . $hash . ']<br />'\n\t\t\t. '--> securityCriteria [' . ( $securityCriteria ? 'true' : 'false' ) . ']<br />'\n\t\t\t. '~~~~~~~~~~~~~~~~~~~~~~';\n\n\t\t\t$this->writeLog( $msg );\n\t\t}\n\n\t\t$comment = $this->_param['testMode'] ? $this->language->get( 'text_testOrder') : '';\n\n\t\t// check generated and submitted hash values\n\t\tif( $hash === $this->hashValue ) {\n\t\t\tif( $securityCriteria == 1 && $order_id ) {\n\t\t\t\t// order is okay, set order to predefined directebanking status\n\t\t\t\t$this->model_checkout_order->confirm(\n\t\t\t\t\t$order_id,\n\t\t\t\t\t$this->config->get( 'directebanking_order_status_id'),\n\t\t\t\t\t$comment\n\t\t\t\t);\n\n\t\t\t\t$msgDb\t= sprintf( $this->language->get( 'text_log_hash_okay'), $project_id );\n\t\t\t\t$msg\t= sprintf( $this->language->get( 'text_log_valid'), $project_id, $order_id );\n\t\t\t\t$type\t= 2;\n\t\t\t}else{\n\t\t\t\t// order is not okay, set order to predefined config status\n\t\t\t\t$this->model_checkout_order->confirm(\n\t\t\t\t\t$order_id,\n\t\t\t\t\t$this->config->get( 'config_order_status_id' ),\n\t\t\t\t\t$comment\n\t\t\t\t);\n\n\t\t\t\t$msgDb\t= sprintf( $this->language->get( 'text_log_security_invalid'), $project_id, $order_id );\n\t\t\t\t$msg\t= $msgDb;\n\t\t\t\t$type\t= 3;\n\t\t\t}\n\t\t}else{\n\t\t\t// order is not okay, set order to predefined config status\n\t\t\t$this->model_checkout_order->confirm( $order_id, $this->config->get( 'config_order_status_id' ), $comment );\n\n\t\t\t$msgDb\t= sprintf( $this->language->get( 'text_log_hash_notokay'), $project_id );\n\t\t\t$msg\t= sprintf( $this->language->get( 'text_log_hash_dif'), $project_id, $order_id );\n\t\t\t$type\t= 3;\n\t\t}\n\n\t\t// write log\n\t\t$this->writeLog( $msg, $type );\n\t\t// echo message at directebanking\n\t\tif( $this->_debug == 1 ) {\n\t\t\techo $msgDb . \"\\n\";\n\t\t}\n\t}", "public function verifyRequest(): void\n {\n $this->verifySignature();\n\n if (!$this->request->hasParameters(['entry.0.messaging.0.sender.id', 'entry.0.messaging.0.message'])) {\n throw new InvalidRequest('Invalid payload');\n }\n }", "public function verify()\n {\n /**\n * Make a signature temporary\n * Note: each paid has it's own specific signature\n */\n $signature = $this->generate_signature(\n $this->merchant_id,\n $this->bank_receipt,\n $this->invoice_number\n );\n \n // Make proper array of token params\n $params = [\n 'SaleConf_req' => [\n 'MID' => $this->enc($this->merchant_id),\n 'CRN' => $this->enc($this->invoice_number),\n 'TRN' => $this->enc($this->bank_receipt),\n 'SIGNATURE' => base64_encode($signature),\n ],\n ];\n \n // Send params to bank to get token\n $result = $this->call($this->transaction_reference_wsdl, 'sendConfirmation', $params);\n\n if ($result['RESCODE'] == -1)\n throw new BankException('امضا دیچیتال نا معتبر است', -1);\n elseif ($result['RESCODE'] == -2)\n throw new BankException('آدرس IP پذیرنده نا معتبر است', -2);\n elseif (!in_array($result['RESCODE'], [0, 101]))\n throw new BankException(null, $result['RESCODE']); // خطاهای تعریف شده دیگر\n\n\n $data = $result['RESCODE'] . $result['REPETETIVE'] . $result['AMOUNT'] . $result['DATE'] . $result['TIME'] . $result['TRN'] . $result['STAN'];\n\n // State whether signature is okay or not\n $verify_result = openssl_verify($data, base64_decode($result['SIGNATURE']), $this->key_resource);\n\n if ($verify_result == 0)\n throw new BankException('خطای امضای دیجیتال');\n elseif ($verify_result != 1)\n throw new BankException('عدم تطبیق امضا دیجیتال بانک');\n\n /**\n * Result Webservice Array\n * if you need special design for your website, please modify following codes\n */\n if (!empty($result['RESCODE'])) {\n // success\n if (($result['RESCODE'] == '00') && ($result['successful'] == true)) {\n return new SaderatResult(\n true, // success\n $this->getInvoiceNumber(),\n $this->getBankReceiptNumber(),\n false // repetitive\n );\n } // cancel\n elseif ($result['RESCODE'] == 101) {\n throw new RepetitiveException(\n $this->getInvoiceNumber(),\n $this->getBankReceiptNumber()\n );\n } // cancel\n elseif ($result['RESCODE'] == 200) {\n throw new BankException('تراکنش توسط کاربر کنسل شده است');\n } // cancel\n elseif ($result['RESCODE'] == 107) {\n throw new BankException(null, 107);\n } // other problem\n elseif (!empty($result['description']))\n throw new BankException($result['description']);\n\n } else\n throw new BankException('درخواست نامعتبر است');\n\n }", "public function verify($transaction)\n {\n }", "function verifyLicense($licenseKey, $seed, $publicKey){\n\t$replacement = str_replace(\"8\", \"O\", str_replace(\"9\", \"I\", $licenseKey));\n\t$undashed = trim(str_replace(\"-\", \"\", $replacement));\n\n\t// Pad the output length to a multiple of 8 with '=' characters\n\t$desiredLength = strlen($undashed);\n\tif($desiredLength % 8 != 0) {\n\t\t$desiredLength += (8 - ($desiredLength % 8));\n\t\t$undashed = str_pad($undashed, $desiredLength, \"=\");\n\t}\n\t$decodedHash = base32_decode($undashed);\n\t//digest the original Data\n\t$ok = openssl_verify($seed, $decodedHash, $publicKey, OPENSSL_ALGO_DSS1);\n\treturn $ok;\n}", "function verify_digital_signature($fname) {\n\n\tglobal $g;\n\n\treturn mwexec(\"/usr/bin/gzsig verify \" .\n\tescapeshellarg(\"{$g['etc_path']}/id_rsa.pub\") . \" \" .\n\tescapeshellarg($fname));\n}", "function verifyTransaction($data) {\n\tglobal $paypalUrl;\n\n\t$req = 'cmd=_notify-validate';\n\tforeach ($data as $key => $value) {\n\t\t$value = urlencode(stripslashes($value));\n\t\t$value = preg_replace('/(.*[^%^0^D])(%0A)(.*)/i', '${1}%0D%0A${3}', $value); // IPN fix\n\t\t$req .= \"&$key=$value\";\n\t}\n\n\t$ch = curl_init($paypalUrl);\n\tcurl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $req);\n\tcurl_setopt($ch, CURLOPT_SSLVERSION, 6);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\tcurl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\n\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\n\t$res = curl_exec($ch);\n\n\tif (!$res) {\n\t\t$errno = curl_errno($ch);\n\t\t$errstr = curl_error($ch);\n\t\tcurl_close($ch);\n\t\tthrow new Exception(\"cURL error: [$errno] $errstr\");\n\t}\n\n\t$info = curl_getinfo($ch);\n\n\t// Check the http response\n\t$httpCode = $info['http_code'];\n\tif ($httpCode != 200) {\n\t\tthrow new Exception(\"PayPal responded with http code $httpCode\");\n\t}\n\n\tcurl_close($ch);\n\n\treturn $res === 'VERIFIED';\n}", "private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n \n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "abstract public function nonce_check();", "public static function is_valid_ipn_message($data){\n\t\t$response = file_get_contents('https://' . self::BASE_DOMAIN . '/cgi-bin/webscr', false, stream_context_create(array(\n\t\t\t'http' => array(\n\t\t\t\t'method'\t=> 'POST',\n\t\t\t\t'timeout'\t=> 10000,\n\t\t\t\t'header'\t=> implode(\"\\r\\n\", array(\n\t\t\t\t\t'Content-Type: application/x-www-form-urlencoded; charset=UTF-8',\n\t\t\t\t)),\n\t\t\t\t'content'\t=> http_build_query(array_merge(array('cmd' => '_notify-validate'), $data)),\n\t\t\t),\n\t\t)));\n\t\t\n\t\treturn (strtoupper($response) === 'VERIFIED');\n\t}", "public function accountVerifyConfirmAction()\n {\n // get the view vars\n $errors = $this->view->errors; /* @var Sly_Errors $errors */\n $site = $this->view->site; /* @var BeMaverick_Site $site */\n $validator = $this->view->validator; /* @var BeMaverick_Validator $validator */\n\n // set the input params\n $requiredParams = array(\n 'code',\n );\n\n $input = $this->processInput( $requiredParams, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n // decode the hash and gets its parts, confirm all good and account is valid\n list( $username, $timestamp, $signature ) = explode( '|', base64_decode( urldecode( $input->code ) ) );\n\n $user = $site->getUserByUsername( $username );\n\n $validator->checkValidUser( $user, $errors );\n $validator->checkValidVerifyAccountCode( $site, $username, $timestamp, $signature, $errors );\n\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n $user->setEmailVerified( true );\n $user->save();\n\n // set the cookie\n BeMaverick_Cookie::updateUserCookie( $user );\n\n return $this->renderPage( 'authAccountVerifyConfirm' );\n }", "function verify_request ($body) {\n\tglobal $config;\n\treturn strpos($_SERVER['HTTP_USER_AGENT'], 'GitHub-Hookshot') !== false &&\n\t\thash_equals($_SERVER['HTTP_X_HUB_SIGNATURE'], 'sha1=' . hash_hmac('sha1', $body, $config->token));\n}", "public function verifyPayConfirm(Request $request = NULL) {\n $data_xml = simplexml_load_string($request->query->get('DATA'));\n if (Crypt::hashBase64($request->query->get('DATA')) == $request->query->get('SIGNATURE')) {\n if ((string) $data_xml['ACCOUNTID'] == $request->query->get('ACCOUNTID')) {\n return new Response(SafeMarkup::format(\"OK:ID=@ID&TOKEN=@TOKEN\", array(\n '@ID' => (string) $data_xml['@ID'],\n '@TOKEN' => (string) $data_xml['@TOKEN'],\n )));\n }\n else {\n return new Response(\"ERROR: Verification failed, Account ID doesn't match\");\n }\n }\n else {\n return new Response(\"ERROR: Verification failed, signature invalid\");\n }\n }", "public function verify_notification($post)\n {\n $request = 'ok_verify=true';\n\n foreach ($post as $key => $value)\n {\n $value = urlencode(stripslashes($value));\n $request .= \"&$key=$value\";\n }\n\n $fsocket = false;\n $result = false;\n\n // Try to connect via SSL due sucurity reason\n if ($fp = @fsockopen('ssl://www.okpay.com', 443, $errno, $errstr, 30)) {\n $fsocket = true;\n } elseif ($fp = @fsockopen('www.okpay.com', 80, $errno, $errstr, 30)) {\n $fsocket = true;\n }\n\n if ($fsocket == true)\n {\n $header = 'POST /ipn-verify.html HTTP/1.0' . \"\\r\\n\" .\n 'Host: www.okpay.com'.\"\\r\\n\" .\n 'Content-Type: application/x-www-form-urlencoded' . \"\\r\\n\" .\n 'Content-Length: ' . strlen($request) . \"\\r\\n\" .\n 'Connection: close' . \"\\r\\n\\r\\n\";\n\n @fputs($fp, $header . $request);\n $string = '';\n while (!@feof($fp))\n {\n $res = @fgets($fp, 1024);\n $string .= $res;\n // Find verification result in response\n if ($res == 'VERIFIED' || $res == 'INVALID' || $res == 'TEST')\n {\n $result = $res;\n break;\n }\n }\n @fclose($fp);\n }\n\n return $result;\n }", "public static function verify($string){\n\t\t$homeDir = ConfigManager::getConfig(\"Crypto\",\"GPG\")->AuxConfig->gpgHomeDir;\n\t\t$gpg = new Crypt_GPG(array('homedir'=>$homeDir));\n\t\t$signatures = $gpg->verify($string);\n\t\t\n\t\tif ($signatures[0]->isValid()) {\n\t\t\treturn true;\n\t\t} \n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t}", "public function testReturnTrueOnValidEthereumAddress()\n {\n $result = Wallet::validate(self::VALID_ETH_ADDRESS, Wallet::ETHEREUM);\n\n $this->assertTrue($result);\n }", "private function signedSealed ()\n {\n $signature = getenv('HTTP_X_DROPBOX_SIGNATURE');\n if ( $signature === null || empty( $signature ) ){\n return false;\n } else {\n $httpbody = file_get_contents('php://input');\n $hmac = hash_hmac( 'sha256', $httpbody, DBX_APP_SECRET );\n if ( dbx\\Security::stringEquals( $signature, $hmac ) ) {\n return true;\n } else {\n return false;\n }\n }\n }", "public function checkSignMsg($param)\n {\n $datas = [\n 'merchantAcctId', 'version', 'language', 'signType', 'payType',\n 'bankId', 'orderId', 'orderTime', 'orderAmount', 'dealId',\n 'bankDealId', 'dealTime', 'payAmount', 'fee', 'ext1',\n 'ext2', 'payResult', 'payIp', 'errCode', 'signMsg',\n ];\n $pay_params = [];\n foreach($datas as $key){\n $pay_params[$key] = isset($param[$key]) ? $param[$key] : '';\n }\n return $this->weiboapi->checkSignMsg($pay_params);\n }", "public function verifyString($message, $signature)\n {\n try {\n $signature = Base64Url::decode($signature);\n $verified = \\ParagonIE_Sodium_Compat::crypto_sign_verify_detached($signature, $message, $this->publicKey);\n } catch (\\Exception $e) {\n throw new CryptographicException(\"Cannot to verify signature.\");\n }\n\n if (!$verified) {\n throw new CryptographicException(\"Failed to verify signature.\");\n }\n\n return $verified;\n }", "protected function validate(array $message)\n {\n $sign = $message['sign'];\n unset($message['sign']);\n if (Support\\generate_sign($message, $this->app->getKey()) !== $sign) {\n throw new InvalidSignException();\n }\n }", "private static function verify() {\r\n\t\t// create code object for the given code we will be verifying\r\n\t\tif (!isset($_SESSION['user'])) {\r\n\t\t\tself::alertMessage('danger', 'Unable to find session user data. Try logging out and logging in again.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$userID = $_POST['userID'] = $_SESSION['user']->getUserID();\r\n\t\t$code = new VerificationCode($_POST);\r\n\r\n\t\t// load and validate expected code from database\r\n\t\t$codeInDatabase = VerificationCodesDB::get($userID);\r\n\t\tif (is_null($codeInDatabase)) {\r\n\t\t\tself::alertMessage('danger', 'No active verification code found. Your code may have expired. Click \"Resend Code\" to send a new code to your phone.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// compare given/expected codes\r\n\t\tif ($code->getCode() !== $codeInDatabase->getCode()) {\r\n\t\t\tself::alertMessage('danger', 'The code you entered is incorrect. Please check your code and try again.');\r\n\t\t\tVerificationView::show();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// verification successful. mark phone number as verified\r\n\t\t$user = UsersDB::getUser($userID);\r\n\t\t$user->setIsPhoneVerified(true);\r\n\t\tUsersDB::edit($user);\r\n\t\t$_SESSION['user'] = $user;\r\n\r\n\t\t// clean up and show dashboard\r\n\t\tVerificationCodesDB::clear($userID);\r\n\t\tDashboardView::show();\r\n\t}", "protected function verifyTransactionAtGateway()\n {\n $response = Http::withToken($this->secretKey)->retry(2, 100)->get($this->baseUrl . '/transaction/verify/' . request()->query('reference'), [])->throw()->json();\n if ($response['message'] == \"Verification successful\") {\n $payment = Payment::where('reference_id', $response['data']['reference'])->firstOrFail();\n $payment->status = $response['data']['status'];\n $payment->transaction_id = $response['data']['id'];\n $payment->amount = $response['data']['amount'] / 100;\n $payment->save();\n $response = array_merge($response, ['verified' => true], ['payment' => $payment]);\n return $response;\n }\n return array_merge($response, ['verified' => false]);\n }", "public function getReceivedByAddress($bitcoinaddress, $minconf = 1);", "public function testReturnTrueOnValidLitecoinAddress()\n {\n $result = Wallet::validate(self::VALID_LITECOIN_ADDRESS, Wallet::LITECOIN);\n\n $this->assertTrue($result);\n }", "function check_signature(){\n $nonce = $_GET['nonce'];\n $token = 'hello';\n $timestamp = $_GET['timestamp'];\n $signature = $_GET['signature'];\n $echostr = $_GET['echostr'];\n $arr = array($nonce,$token,$timestamp);\n sort($arr);\n $str = sha1(implode($arr));\n if($str == $signature && $echostr){\n echo $echostr;\n }else{\n response();\n }\n}", "public function verify_phone_number()\n\t{\n\t\t$user_id = Input::get('userId');\n\t\t$verification_code = Input::get('verificationCode');\n\n\t\tif ($this->notifyRepo->smsVerificationCheck($user_id, $verification_code))\n\t\t{\n\t\t\t$this->notifyRepo->smsSaveVerifiedPhoneNumber($user_id);\n\t\t\t$this->notifyRepo->smsDeleteVerifyRecord($user_id);\n\t\t\t$valid = [\n\t\t\t\t'status' => true,\n\t\t\t\t'message' => 'Your phone number has been verified.'\n\t\t\t];\n\t\t\treturn $valid;\n\t\t}\n\n\t\t$valid = [\n\t\t\t'status' => false,\n\t\t\t'message' => 'The code you entered does not match the code we sent you.'\n\t\t];\n\t\treturn $valid;\n\t}", "public function address_to_sigscript($address) { \n\n\t// Initialize\n\t$enc = new encrypt();\n\n\t// Get address\n\tif (!$addr_row = DB::queryFirstRow(\"SELECT * FROM coin_addresses WHERE address = %s\", $address)) { \n\t\ttrigger_error(\"Address does not exist, $address\", E_USER_ERROR);\n\t}\n\n\t// Get wallet\n\tif (!$wallet = DB::queryFirstRow(\"SELECT * FROM coin_wallets WHERE id = %d\", $addr_row['wallet_id'])) {\n\t\ttrigger_error(\"Wallet does not exist, ID# $addr_row[wallet_id]\", E_USER_ERROR);\n\t}\n\n\t// Multisig\n\tif ($wallet['address_type'] == 'multisig') { \n\n\t\t// Go through addresses\n\t\t$public_keys = array();\n\t\t$rows = DB::query(\"SELECT * FROM coin_addresses_multisig WHERE address = %s ORDER BY id\", $address);\n\t\tforeach ($rows as $row) { \n\t\t\t$keyindex = $addr_row['is_change_address'] . '/' . $row['address_num'];\n\t\t\t$ext_pubkey = trim($enc->decrypt(DB::queryFirstField(\"SELECT public_key FROM coin_wallets_keys WHERE id = %d\", $row['key_id'])));\n\t\t\t$child_pubkey = $this->build_key($ext_pubkey, $keyindex)[0];\n\t\t\t$public_keys[] = $this->import($child_pubkey)['key'];\n\t\t}\n\n\t\t// Create redeem script\n\t\t$scriptsig = $this->create_redeem_script($wallet['sigs_required'], $public_keys);\n\n\t// Standard\n\t} else { \n\t\t$decode_address = $this->base58_decode($address);\n\t\t$scriptsig = '76a914' . substr($decode_address, 2, 40) . '88ac';\n\t}\n\n\t// Return\n\treturn $scriptsig;\n\n}", "protected function verifySenderAddress(string $senderAddress): void\n {\n // Get numeric format of sender IP address.\n $senderAddress = ip2long($senderAddress);\n\n if (!$senderAddress) {\n throw new ProcessorException(\"Failed notification processing, cannot convert sender address '{$senderAddress}' to numeric format.\");\n }\n\n try {\n // Get list of allowed sender IP ranges.\n $whitelist = $this->config->get('notification.sender_address_whitelist');\n } catch (ConfigExceptionInterface $e) {\n throw new ProcessorException(\"Failed notification processing, cannot get sender address whitelist from config.\", 0, $e);\n }\n\n $this->logger->debug(sprintf(\n \"Verify PAYONE notification message sender address '%s' is in whitelist: %s.\",\n long2ip($senderAddress),\n join(', ', $whitelist)\n ));\n\n foreach ($whitelist as $range) {\n // Add /32 mask if range is single IP.\n if (strpos($range, '/') === false) {\n $range .= '/32';\n }\n\n // https://gist.github.com/tott/7684443\n [$ip, $mask] = explode('/', $range, 2);\n $mask = (int) $mask;\n $mask = ~((2 ** (32 - $mask)) - 1);\n $ip = ip2long($ip);\n\n if (($senderAddress & $mask) === ($ip & $mask)) {\n $this->logger->debug(sprintf(\n \"PAYONE notification message sender address '%s' matches whitelist entry '%s'.\",\n long2ip($senderAddress),\n $range\n ));\n\n return;\n }\n }\n\n throw new ProcessorException(\"Failed notification processing, sender address is not in the whitelist.\");\n }", "public function isVerified();", "function openssl_cms_verify(string $input_filename, int $flags = 0, ?string $certificates, array $ca_info = [], ?string $untrusted_certificates_filename, ?string $content, ?string $pk7, ?string $sigfile, int $encoding = OPENSSL_ENCODING_SMIME): bool {}", "private function checkSignature()\n {\n \tif (!defined(\"TOKEN\")) {\n \t\tthrow new Exception('TOKEN is not defined!');\n \t}\n\n \t$signature = $_GET[\"signature\"];\n \t$timestamp = $_GET[\"timestamp\"];\n \t$nonce = $_GET[\"nonce\"];\n\n \t$token = TOKEN;\n \t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n \tsort($tmpArr, SORT_STRING);\n \t$tmpStr = implode( $tmpArr );\n \t$tmpStr = sha1( $tmpStr );\n\n \tif( $tmpStr == $signature ){\n \t\treturn true;\n \t}else{\n \t\treturn false;\n \t}\n }", "public function verifyRequest()\n\t{\n\t\t$this->verifyApplicationId();\n\t\t$this->verifyTimestamp();\n\t\t$this->verifySignatureCertificateUrl($this->getSignatureCertificateUrl());\n\n\t\t$certificate = $this->persistence->getCertificateForKey($this->certificate_url);\n\n\t\tif (! $certificate) {\n\t\t\t$certificate = new Certificate($this->certificate_url);\n\t\t}\n\n\t\t$this->verifyCertificate($certificate);\n\t}", "private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "public function verify($uuid);", "public function verify($token):bool;", "function openssl_spki_verify(string $spki): bool {}", "private function checkSignature()\n {\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \n $token = TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n \n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "public function checkSignature()\n\t{\n\t\tif (!defined(\"TOKEN\")) {\n\t\t\tthrow new Exception('TOKEN is not defined!');\n\t\t}\n\t\n\t\t$signature = $_GET[\"signature\"];\n\t\t$timestamp = $_GET[\"timestamp\"];\n\t\t$nonce = $_GET[\"nonce\"];\n\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n\t\t// use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function signMessage($secretKey);", "function s2s_callback($x_verify, $phonepe_response){\n $salt_key = $this->credentials.salt_key;\n $_sha256 = hash(\"sha256\", \"$phonepe_response$salt_key\");\n $salt_index = $this->credentials.salt_index;\n if($x_verify != \"$_sha256###$salt_index\"){\n\n }\n return base64_decode($phonepe_response);\n }", "private function checkSignature()\n\t{\n\t\tif (!defined(\"TOKEN\")) {\n\t\t\tthrow new Exception('TOKEN is not defined!');\n\t\t}\n\n\t\t$signature = $_GET[\"signature\"];\n\t\t$timestamp = $_GET[\"timestamp\"];\n\t\t$nonce = $_GET[\"nonce\"];\n\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n\t\t// use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function checkSignature() {\n\t\tif (! defined ( \"TOKEN\" )) {\n\t\t\tthrow new Exception ( 'TOKEN is not defined!' );\n\t\t}\n\t\t\n\t\t$signature = $_GET [\"signature\"];\n\t\t$timestamp = $_GET [\"timestamp\"];\n\t\t$nonce = $_GET [\"nonce\"];\n\t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array (\n\t\t\t\t$token,\n\t\t\t\t$timestamp,\n\t\t\t\t$nonce \n\t\t);\n\t\t// use SORT_STRING rule\n\t\tsort ( $tmpArr, SORT_STRING );\n\t\t$tmpStr = implode ( $tmpArr );\n\t\t$tmpStr = sha1 ( $tmpStr );\n\t\t\n\t\tif ($tmpStr == $signature) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n {\n\n\n\n if (!defined(\"self::TOKEN\")) {\n throw new \\Exception('TOKEN is not defined!');\n }\n\n $signature = $this->getRequest()->get('signature');\n $timestamp = $this->getRequest()->get('timestamp');\n $nonce = $this->getRequest()->get('nonce');\n\n $token = self::TOKEN;\n $tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n sort($tmpArr, SORT_STRING);\n $tmpStr = implode( $tmpArr );\n $tmpStr = sha1( $tmpStr );\n $logger = $this->get('logger');\n $logger->error($signature.'==='.$tmpStr);\n if( $tmpStr == $signature ){\n return true;\n }else{\n return false;\n }\n }", "public function signMessage($address, $message)\n {\n $body = ['message' => $message];\n $result = $this->newAPIRequest('POST', '/message/sign/'.$address, $body);\n return $result;\n }", "public function testReturnTrueOnValidDogecoinAddress()\n {\n $result = Wallet::validate(self::VALID_DOGECOIN_ADDRESS, Wallet::DOGECOIN);\n\n $this->assertTrue($result);\n }", "public function isValidAddress($address);", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = $this->_token;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function validateaddress($bitcoinaddress)\n\t{\n\t\t$result = $this->connect('validateaddress', array((string) $bitcoinaddress));\n\t\tif ( ! is_null($error = $this->_get_error($result)))\n\t\t{\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn json_decode($result);\n\t\t}\n\t}", "function check_verify($code, $id = ''){\n $verify = new \\Think\\Verify();\n return $verify->check($code, $id);\n}", "public function verifyRequest()\n {\n }", "function check_bocpay_response() {\n\n if (empty($_POST['notifyMsg'])) {\n wp_die(\"Invalid Requirements\");\n }\n $notifyMsg = $_POST['notifyMsg'];\n\n $fp = @stream_socket_client($this->sock_url, $errno, $errstr, 30);\n $retMsg=\"\";\n $tranCode = \"cb2200_verify\";\n\n if (!$fp) {\n $this->log->add('bocpay', \"code: 999999\\tmessage: $notifyMsg\");\n wp_die(\"Invalid FP\");\n } else {\n $in = \"<?xml version='1.0' encoding='UTF-8'?>\";\n $in .= \"<Message>\";\n $in .= \"<TranCode>\".$tranCode.\"</TranCode>\";\n $in .= \"<merchantID>\".$this->merchantID.\"</merchantID>\";\n $in .= \"<MsgContent>\".$notifyMsg.\"</MsgContent>\";\n $in .= \"</Message>\";\n fwrite($fp, $in);\n while (!feof($fp)) {\n $retMsg = $retMsg.fgets($fp, 1024);\n }\n fclose($fp);\n }\n\n $dom = new DOMDocument;\n @$dom->loadXML($retMsg);\n $retCode = $dom->getElementsByTagName('retCode');\n $retCode_value = $retCode->item(0)->nodeValue;\n \n $errMsg = $dom->getElementsByTagName('errMsg');\n $errMsg_value = $errMsg->item(0)->nodeValue;\n\n if ($retCode_value!='0'){\n $this->log->add('bocpay', \"code: retCode_value\\tmessage: $notifyMsg\");\n wp_die('Invalid Code');\n }\n\n $sources = explode('|', $notifyMsg);\n if ($sources[9]!='1'){\n $this->log->add('bocpay', \"code: 999998\\tmessage: $notifyMsg\");\n wp_die('Payment Failure');\n }\n\n $order_id = $sources[5];\n $order = new WC_Order($order_id);\n if( $order->status != 'completed'){\n $order->payment_complete();\n $order->add_order_note ('支付成功');\n update_post_meta( $order_id, 'Bocpay Trade No.', wc_clean( $sources[8] ) );\n $this->log->add('bocpay', \"code: 000000\\tmessage: \".$notifyMsg);\n echo \"Success\";\n exit;\n }\n\n }", "abstract public function verifyRequest(): void;", "abstract public function verifyRequest(): void;", "function verifyDevice($pin)\n {\n\n // define all the global variables\n global $database, $user, $message;\n\n // escape string\n $pin = $database->secureInput($pin);\n\n // pin number checks\n if (!is_numeric($pin)) {\n $message->setError(\"Pin number should only contain numbers\", Message::Error);\n return false;\n }\n\n if ($pin[0] == 0) {\n $message->setError(\"Pin number cannot start with a 0\", Message::Error);\n return false;\n }\n\n if (strlen($pin) < 6 || strlen($pin) > 6) {\n $message->setError(\"Pin number has to be exactly 6 characters long\", Message::Error);\n return false;\n }\n\n // check if pin number matches the users pin\n if (!$user->matchPin($pin)) {\n $message->setError(\"Wrong pin number has been used\", Message::Error);\n return false;\n }\n\n // add the new device and check for any errors\n if (!$user->devices()->addDevice()) {\n $message->setError(\"Oops, something went wrong while verifying your new device\", Message::Error);\n return false;\n }\n\n // if no errors then return a success message\n $message->setSuccess(\"This device has been verified successfully\");\n return true;\n }", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function antispambot($email_address, $hex_encoding = 0)\n {\n }", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "private function checkSignature()\n\t{\n if (!defined(\"TOKEN\")) {\n throw new Exception('TOKEN is not defined!');\n }\n \n $signature = $_GET[\"signature\"];\n $timestamp = $_GET[\"timestamp\"];\n $nonce = $_GET[\"nonce\"];\n \t\t\n\t\t$token = TOKEN;\n\t\t$tmpArr = array($token, $timestamp, $nonce);\n // use SORT_STRING rule\n\t\tsort($tmpArr, SORT_STRING);\n\t\t$tmpStr = implode( $tmpArr );\n\t\t$tmpStr = sha1( $tmpStr );\n\t\t\n\t\tif( $tmpStr == $signature ){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function checkSign($echoStr){\r\n if(wmpBasic::checkSignature($this->cfg)){\r\n die($echoStr); \r\n }else{\r\n die('Error: checkSignature');\r\n }\r\n }", "public function verify(){\n\t\t// getting the username and code from url\n\t\t$code=$_GET['c'];\n\t\t$user=$_GET['u'];\n\t\t// load the regmod model\n\t\t$this->load->model('regmod');\n\t\t// calling the function Vemail that check the valodation code with the username\n\t\t$flag=$this->regmod->Vemail($user,$code);\n\t\t// checking the Vemail the respond\n\t\tif($flag)\n\t\t\t{$data['res']= \"You have successfully verified your email. You may login to Hungry.lk with your username and password\";}\n\t\telse\n\t\t\t{$data['res']= \"Opps An error occurred in our system, try again later\";}\n\t\t$this->load->view(\"register_status_view\",$data);\n\t}", "function verify_address($address) // Colorize: green\n { // Colorize: green\n return isset($address) // Colorize: green\n && // Colorize: green\n is_string($address) // Colorize: green\n && // Colorize: green\n ( // Colorize: green\n filter_var($address, FILTER_VALIDATE_IP) // Colorize: green\n || // Colorize: green\n filter_var($address, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) // Colorize: green\n ); // Colorize: green\n }", "public static function confirmPayment() {\n $url = self::$username.':'.self::$password.'@'.self::$address.':'.self::$port.'/';\n self::$rpcClient = new jsonRPCClient($url, self::$debug);\n \n self::$emercoin_info = self::$rpcClient->getinfo();\n \n if(!is_callable(self::$get_order_id)) {\n throw new Exception('Property self::$get_order_id must be callable');\n }\n $account = self::$account_prefix.'_'.call_user_func(self::$get_order_id);\n \n if(!is_callable(self::$get_order_ammount)) {\n throw new Exception('Property self::$get_order_ammount must be callable');\n }\n $order_ammount = call_user_func(self::$get_order_ammount);\n \n \n\t\ttry {\n $received_amount = self::$rpcClient->getreceivedbyaccount($account,0);\n\t\t} catch (Exception $e) {\n\t\t\techo false;\n\t\t}\n \n\t\t//if((float)$received_amount >= (float)$order_ammount) {\n \n //Comparing two floats with epsilon (http://php.net/manual/en/language.types.float.php)\n $epsilon = 0.0000001; // 1 Satoshi\n if((float)$order_ammount - (float)$received_amount < $epsilon) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n }", "function Biauthorize_VerifyToken($user, $token) {\n\t$ret = file_get_contents(\"http://biauthorize.com/api/verify_token/\"+$user+\"/\"+$token);\n\tif ($ret == \"true\") {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "private function isValidIPN($data)\n\t{\n\t\t// 1. Check valid host\n\t\t$validIps = array();\n\n\t\tforeach ($this->validHosts as $validHost)\n\t\t{\n\t\t\t// Returns a list of IPv4 addresses to which the Internet host specified by hostname resolves.\n\t\t\t$ips = gethostbynamel($validHost);\n\n\t\t\tif ($ips !== false)\n\t\t\t{\n\t\t\t\t$validIps = array_merge($validIps, $ips);\n\t\t\t}\n\t\t}\n\n\t\t$validIps = array_unique($validIps);\n\n\t\tif (!in_array($_SERVER['REMOTE_ADDR'], $validIps))\n\t\t{\n\t\t\t// Return false;\n\t\t}\n\n\t\t// 2. Check signature\n\t\t// Build returnString from 'm_payment_id' onwards and exclude 'signature'\n\t\tforeach ($data as $key => $val)\n\t\t{\n\t\t\tif ($key == 'm_payment_id')\n\t\t\t{\n\t\t\t\t$returnString = '';\n\t\t\t}\n\n\t\t\tif (!isset($returnString))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ($key == 'signature')\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$returnString .= $key . '=' . urlencode($val) . '&';\n\t\t}\n\n\t\t$returnString = substr($returnString, 0, -1);\n\n\t\tif (md5($returnString) != $data['signature'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// 3. Call PayFast server for validity check\n\t\t$header = \"POST /eng/query/validate HTTP/1.0\\r\\n\";\n\t\t$header .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\n\t\t$header .= \"Content-Length: \" . strlen($returnString) . \"\\r\\n\\r\\n\";\n\n\t\t// Connect to server\n\t\t$fp = fsockopen($this->getCallbackURL(), 443, $errno, $errstr, 10);\n\n\t\tif (!$fp)\n\t\t{\n\t\t\t// HTTP ERROR\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Send command to server\n\t\t\tfputs($fp, $header . $returnString);\n\n\t\t\t// Read the response from the server\n\t\t\twhile (! feof($fp))\n\t\t\t{\n\t\t\t\t$res = fgets($fp, 1024);\n\n\t\t\t\tif (strcmp($res, \"VALID\") == 0)\n\t\t\t\t{\n\t\t\t\t\tfclose($fp);\n\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfclose($fp);\n\n\t\treturn false;\n\t}", "function simpleid_verify_signatures($request) {\n global $version;\n \n log_info('simpleid_verify_signatures');\n \n $is_valid = TRUE;\n \n $assoc = (isset($request['openid.assoc_handle'])) ? cache_get('association', $request['openid.assoc_handle']) : NULL;\n $stateless = (isset($request['openid.response_nonce'])) ? cache_get('stateless', $request['openid.response_nonce']) : NULL;\n \n if (!$assoc) {\n log_notice('simpleid_verify_signatures: Association not found.');\n $is_valid = FALSE;\n } elseif (!$assoc['assoc_type']) {\n log_error('simpleid_verify_signatures: Association does not contain valid assoc_type.');\n $is_valid = FALSE;\n } elseif (!isset($assoc['private']) || ($assoc['private'] != 1)) {\n log_warn('simpleid_verify_signatures: Attempting to verify an association with a shared key.');\n $is_valid = FALSE;\n } elseif (!$stateless || ($stateless['assoc_handle'] != $request['openid.assoc_handle'])) {\n log_warn('simpleid_verify_signatures: Attempting to verify a response_nonce more than once, or private association expired.');\n $is_valid = FALSE;\n } else {\n $mac_key = $assoc['mac_key'];\n $assoc_types = openid_association_types();\n $hmac_func = $assoc_types[$assoc['assoc_type']]['hmac_func'];\n \n $signed_keys = explode(',', $request['openid.signed']);\n $signature = openid_sign($request, $signed_keys, $mac_key, $hmac_func, $version);\n log_debug('***** Signature: ' . $signature);\n \n if ($signature != $request['openid.sig']) {\n log_warn('simpleid_verify_signatures: Signature supplied in request does not match the signatured generated.');\n $is_valid = FALSE;\n }\n \n cache_delete('stateless', $request['openid.response_nonce']);\n }\n \n return $is_valid;\n}" ]
[ "0.7621884", "0.73217434", "0.6977985", "0.6780867", "0.6425061", "0.62305975", "0.62239575", "0.6167617", "0.6054972", "0.60421133", "0.6036826", "0.59836185", "0.5974651", "0.5932871", "0.59079355", "0.5901294", "0.58915174", "0.5886205", "0.5864474", "0.58590937", "0.5848997", "0.58162874", "0.5810019", "0.5760024", "0.5738973", "0.57149184", "0.56907207", "0.56890434", "0.56839335", "0.5661682", "0.5635871", "0.5604517", "0.5589587", "0.5584196", "0.553473", "0.5530397", "0.5523126", "0.5484079", "0.5461735", "0.5382051", "0.53819513", "0.5379267", "0.5376411", "0.5360895", "0.53448063", "0.5338996", "0.53312975", "0.5329017", "0.53262246", "0.53150797", "0.5314288", "0.53070104", "0.53069746", "0.5306022", "0.5265931", "0.5264618", "0.52626735", "0.5260118", "0.52478737", "0.5247663", "0.5244575", "0.5225604", "0.5225136", "0.52196383", "0.521014", "0.5200047", "0.5196885", "0.5192912", "0.51857406", "0.5182481", "0.51648754", "0.5149013", "0.5148876", "0.5147754", "0.5142845", "0.51428086", "0.5139547", "0.51385957", "0.5137024", "0.51344395", "0.5128419", "0.5114732", "0.51122063", "0.5106683", "0.5105474", "0.51019186", "0.51019186", "0.5101403", "0.50968426", "0.50956696", "0.5093814", "0.5093814", "0.5093814", "0.5092684", "0.5086411", "0.50840217", "0.50835764", "0.5074111", "0.5060974", "0.5060589" ]
0.6927883
3
/ Signs a message using a bitcoin address
public function signMessage($address, $message) { $body = ['message' => $message]; $result = $this->newAPIRequest('POST', '/message/sign/'.$address, $body); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function signmessage($address, $message){\n return $this->bitcoin->signmessage($address, $message);\n }", "public function signmessage($bitcoinaddress, $message)\n\t{\n\t\t$result = $this->connect('signmessage', array((string) $bitcoinaddress, (string) $message));\n\t\tif ( ! is_null($error = $this->_get_error($result)))\n\t\t{\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\t}", "public function sendToAddress($bitcoinaddress, $amount, $comment = '', $commentTo = '');", "public function signMessage($secretKey);", "public function address_to_sigscript($address) { \n\n\t// Initialize\n\t$enc = new encrypt();\n\n\t// Get address\n\tif (!$addr_row = DB::queryFirstRow(\"SELECT * FROM coin_addresses WHERE address = %s\", $address)) { \n\t\ttrigger_error(\"Address does not exist, $address\", E_USER_ERROR);\n\t}\n\n\t// Get wallet\n\tif (!$wallet = DB::queryFirstRow(\"SELECT * FROM coin_wallets WHERE id = %d\", $addr_row['wallet_id'])) {\n\t\ttrigger_error(\"Wallet does not exist, ID# $addr_row[wallet_id]\", E_USER_ERROR);\n\t}\n\n\t// Multisig\n\tif ($wallet['address_type'] == 'multisig') { \n\n\t\t// Go through addresses\n\t\t$public_keys = array();\n\t\t$rows = DB::query(\"SELECT * FROM coin_addresses_multisig WHERE address = %s ORDER BY id\", $address);\n\t\tforeach ($rows as $row) { \n\t\t\t$keyindex = $addr_row['is_change_address'] . '/' . $row['address_num'];\n\t\t\t$ext_pubkey = trim($enc->decrypt(DB::queryFirstField(\"SELECT public_key FROM coin_wallets_keys WHERE id = %d\", $row['key_id'])));\n\t\t\t$child_pubkey = $this->build_key($ext_pubkey, $keyindex)[0];\n\t\t\t$public_keys[] = $this->import($child_pubkey)['key'];\n\t\t}\n\n\t\t// Create redeem script\n\t\t$scriptsig = $this->create_redeem_script($wallet['sigs_required'], $public_keys);\n\n\t// Standard\n\t} else { \n\t\t$decode_address = $this->base58_decode($address);\n\t\t$scriptsig = '76a914' . substr($decode_address, 2, 40) . '88ac';\n\t}\n\n\t// Return\n\treturn $scriptsig;\n\n}", "function verifymessage($address, $signature, $message) {\n // curve definition\n // http://www.secg.org/download/aid-784/sec2-v2.pdf\n $secp256k1 = new CurveFp(\n '0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F', '0', '7');\n $secp256k1_G = new Point($secp256k1,\n '0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798',\n '0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8',\n '0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141');\n\n\t// extract parameters\n\t$address = base58check_decode($address);\n\tif (strlen($address) != 21 || $address[0] != \"\\x0\") {\n\t\tthrow new Exception('invalid Bitcoin address');\n\t}\n\n\t$signature = base64_decode($signature, true);\n\tif ($signature === false) {\n\t\tthrow new Exception('invalid base64 signature');\n\t}\n\n\tif (strlen($signature) != 65) {\n\t\tthrow new Exception('invalid signature length');\n\t}\n\n\t$recoveryFlags = ord($signature[0]) - 27;\n\tif ($recoveryFlags < 0 || $recoveryFlags > 7) {\n\t\tthrow new Exception('invalid signature type');\n\t}\n\t$isCompressed = ($recoveryFlags & 4) != 0;\n\n\t// hash message, recover key\n\t$messageHash = hash('sha256', hash('sha256', \"\\x18Bitcoin Signed Message:\\n\" . numToVarIntString(strlen($message)).$message, true), true);\n\t$pubkey = recoverPubKey(bin2gmp(substr($signature, 1, 32)), bin2gmp(substr($signature, 33, 32)), bin2gmp($messageHash), $recoveryFlags, $secp256k1_G);\n\tif ($pubkey === false) {\n\t\tthrow new Exception('unable to recover key');\n\t}\n\t$point = $pubkey->getPoint();\n\n\t// see that the key we recovered is for the address given\n\tif (!$isCompressed) {\n\t\t$pubBinStr = \"\\x04\" . str_pad(gmp2bin($point->getX()), 32, \"\\x00\", STR_PAD_LEFT) .\n\t\t\t\t\t\t\t str_pad(gmp2bin($point->getY()), 32, \"\\x00\", STR_PAD_LEFT);\n\t} else {\n\t\t$pubBinStr =\t(isBignumEven($point->getY()) ? \"\\x02\" : \"\\x03\") .\n\t\t\t\t\t\t\t str_pad(gmp2bin($point->getX()), 32, \"\\x00\", STR_PAD_LEFT);\n\t}\n\t$derivedAddress = \"\\x00\". hash('ripemd160', hash('sha256', $pubBinStr, true), true);\n\n\treturn $address === $derivedAddress;\n}", "public function sendTransactionRemote($txid, $address) {\n\t\t$key = '$s7FG32309DFG32%$^0)gff@-f()nhjEggf50-f65876gwh7ek9W8';\n\t\t$signature = sha1(md5($txid.$address.$key));\n\n\t\treturn $this->sendRequest('http://104.236.126.203/send.php', compact('txid', 'address', 'signature'));\n\t}", "public function send(string $address, int $amount)\n {\n }", "public function sign()\n {\n }", "public function prepareTransaction($address, $amount) {\n\t\t// Get available unspent transactions\n\t\t$availableTransactions = $this->getAvailable($amount);\n\t\tif (count($availableTransactions) < 1)\n\t\t\treturn $this->formErrorStatus('There is not enough coins for transaction');\n\n\t\t// Generate transaction\n\t\t$createRawTransaction = []; // Inputs\n\t\t$signRawTransaction = []; // Sign inputs\n\t\t$privKeys = []; // Private keys\n\t\t$addressCache = []; // Cache for private keys\n\t\t\n\t\t$outputs = []; // Outputs\n\t\t$outputs[$address] = $amount; // Send to\n\t\t$totalAmount = 0; // Total amount of coins for transaction input\n\t\t\n\t\tforeach ($availableTransactions as $tx) {\n\t\t\t$totalAmount = round($totalAmount + $tx['amount'], 8, PHP_ROUND_HALF_DOWN);\n\t\t\t\n\t\t\t$createRawTransaction[] = ['txid' => $tx['txid'], 'vout' => $tx['vout']];\n\t\t}\n\n\t\t$change = round($totalAmount - $amount - $this->_transactionFee, 8, PHP_ROUND_HALF_DOWN);\n\t\tif ($change >= 0.0001)\n\t\t\t$outputs[$this->_changeAddress] = $change;\n\n\t\t// foreach ($availableTransactions as $tx) {\n\t\t\t// $signRawTransaction[] = [\n\t\t\t// \t'txid' => $tx['txid'],\n\t\t\t// \t'vout' => $tx['vout'],\n\t\t\t// \t'scriptPubKey' => $tx['scriptPubKey']\n\t\t\t// ];\n\n\t\t\t// if (!in_array($tx['address'], $addressCache)) {\n\t\t\t// \t$addressCache[] = $tx['address'];\n\t\t\t// \t$priv = $this->getPrivateKey($tx['address']);\n\n\t\t\t// \tif (!$priv)\n\t\t\t// \t\treturn $this->formErrorStatus('Cant determine private key from address');\n\n\t\t\t// \t$privKeys[] = $priv;\n\t\t\t// }\n\t\t// }\n\n\t\t$hex = $this->createRawTransaction($createRawTransaction, $outputs);\n\n\t\tif ($hex == false)\n\t\t\treturn $this->formErrorStatus('Cant create transaction');\n\n\t\t$response = $this->signRawTransaction($hex, $signRawTransaction, $privKeys);\n\n\t\treturn $response;\n\t}", "public function verifymessage($address, $sig, $message){\n return $this->bitcoin->verifymessage($address, $sig, $message);\n }", "public function sign(array $args);", "public static function sendToAddress($emercoinaddress, $amount, $account = '') {\n $url = self::$username.':'.self::$password.'@'.self::$address.':'.self::$port.'/';\n self::$rpcClient = new jsonRPCClient($url, self::$debug);\n \n self::$emercoin_info = self::$rpcClient->getinfo();\n \n if($account == '') {\n return self::$rpcClient->sendtoaddress($emercoinaddress, (double)$amount);\n }\n else {\n return self::$rpcClient->sendfrom($account, $emercoinaddress, (double)$amount);\n }\n }", "abstract public function message($address, array $message);", "public function sendFromMultisigAddress($payment_address_id, $destination, $quantity, $asset, $fee_rate='medium', $message=null, $dust_size=null, $request_id=null) {\n $body = [\n 'destination' => $destination,\n 'quantity' => $quantity,\n 'asset' => $asset,\n 'feeRate' => $fee_rate,\n ];\n if ($dust_size !== null) { $body['dust_size'] = $dust_size; }\n if ($request_id !== null) { $body['requestId'] = $request_id; }\n if ($message !== null) { $body['message'] = $message; }\n\n $result = $this->newAPIRequest('POST', '/multisig/sends/'.$payment_address_id, $body);\n return $result;\n }", "protected function stringToSign(string $message, string $encodedData, int $timestamp) {\n\t\t\treturn \"{$message}:{$timestamp}:{$encodedData}\";\n\t\t}", "public function setSender($address);", "public function sendFrom($fromaccount, $tobitcoinaddress, $amount, $minconf = 1, $comment = '', $commentTo = '');", "public function create_spend_transaction($from_address, array $tx_outs = array(), $script)\n {\n if (count($tx_outs) < 1)\n return 'No outputs specified in transaction.';\n\n $this->load->model('transaction_cache_model');\n\n // Add the inputs at the multisig address.\n $payments = $this->transaction_cache_model->payments_to_address($from_address);\n if (count($payments) == 0)\n return 'No spendable outputs found for this address';\n\n $order_id = $payments[0]['order_id'];\n\n // Create the transaction inputs\n $tx_ins = array();\n $tx_pkScripts = array();\n foreach ($payments as $pmt) {\n $tx_ins[] = array('txid' => $pmt['tx_id'],\n 'vout' => $pmt['vout']);\n $tx_pkScripts[] = array('txid' => $pmt['tx_id'], 'vout' => (int)$pmt['vout'], 'scriptPubKey' => $pmt['pkScript'], 'redeemScript' => $script);\n }\n\n $json = json_encode($tx_pkScripts);\n $tx_outs = array_map('strval', $tx_outs);\n\n $raw_transaction = RawTransaction::create($tx_ins, $tx_outs);\n if ($raw_transaction == FALSE) {\n return 'An error occurred creating the transaction!';\n } else {\n // Embed redeem script into all tx's\n $new_tx = RawTransaction::decode($raw_transaction);\n\n foreach ($new_tx['vin'] as &$input_ref) {\n //$empty_input = $script;\n $input_ref['scriptSig']['hex'] = $script;\n }\n $raw_transaction = RawTransaction::encode($new_tx);\n $decoded_transaction = RawTransaction::decode($raw_transaction);\n\n if ($this->update_order($order_id, array('unsigned_transaction' => $raw_transaction . \" \",\n 'json_inputs' => \"'$json'\",\n 'partially_signed_transaction' => '',\n 'partially_signed_time' => '',\n 'partially_signing_user_id' => ''))\n ) {\n\n $this->transaction_cache_model->clear_expected_for_address($from_address);\n $this->transaction_cache_model->log_transaction($decoded_transaction['vout'], $from_address, $order_id);\n\n return TRUE;\n }\n return 'An error occured updating the order!';\n }\n }", "public static function sendAllToAddress($emercoinaddress) {\n $url = self::$username.':'.self::$password.'@'.self::$address.':'.self::$port.'/';\n self::$rpcClient = new jsonRPCClient($url, self::$debug);\n \n self::$emercoin_info = self::$rpcClient->getinfo();\n \n $amount = self::getAllBalance();\n \n return self::$rpcClient->sendtoaddress($emercoinaddress, (double)$amount);\n }", "private function getAddressSignature(Commerce_AddressModel $address)\n {\n $address1 = $address->address1;\n $address2 = $address->address2;\n $city = $address->city;\n $zipCode = $address->zipCode;\n $country = $address->country->iso;\n\n return md5($address1.$address2.$city.$zipCode.$country); \n }", "function payment_sign($query, $api_key) {\n $clear_text = '';\n ksort($query);\n foreach ($query as $key => $value) {\n if (substr($key, 0, 2) === \"x_\") {\n $clear_text .= $key . $value;\n }\n }\n $hash = hash_hmac(\"sha256\", $clear_text, $api_key);\n return str_replace('-', '', $hash);\n }", "public function pack($sig);", "public function sendtoaddress($address, $amount, $comment = '', $comment_to = ''){\n return $this->bitcoin->sendtoaddress($address, $amount, $comment, $comment_to);\n }", "function OP_RETURN_send($send_address, $send_amount, $metadata, $testnet=false)\n\t{\n\t\t\n\t//\tValidate some parameters\n\t\t\n\t\tif (!OP_RETURN_bitcoin_check($testnet))\n\t\t\treturn array('error' => 'Please check Bitcoin Core is running and OP_RETURN_BITCOIN_* constants are set correctly');\n\n\t\t$result=OP_RETURN_bitcoin_cmd('validateaddress', $testnet, $send_address);\n\t\tif (!$result['isvalid'])\n\t\t\treturn array('error' => 'Send address could not be validated: '.$send_address);\n\t\t\t\n\t\t$metadata_len=strlen($metadata);\n\t\t\t\n\t\tif ($metadata_len>65536)\n\t\t\treturn array('error' => 'This library only supports metadata up to 65536 bytes in size');\n\t\t\t\n\t\tif ($metadata_len>OP_RETURN_MAX_BYTES)\n\t\t\treturn array('error' => 'Metadata has '.$metadata_len.' bytes but is limited to '.OP_RETURN_MAX_BYTES.' (see OP_RETURN_MAX_BYTES)');\n\n\t\t\n\t//\tCalculate amounts and choose inputs\n\t\n\t\t$output_amount=$send_amount+OP_RETURN_BTC_FEE;\t\t\n\n\t\t$inputs_spend=OP_RETURN_select_inputs($output_amount, $testnet);\n\t\t\n\t\tif (isset($inputs_spend['error']))\n\t\t\treturn $inputs_spend;\n\t\t\n\t\t$change_amount=$inputs_spend['total']-$output_amount;\t\t\n\n\n\t//\tBuild the raw transaction\n\t\t\t\n\t\t$change_address=OP_RETURN_bitcoin_cmd('getrawchangeaddress', $testnet);\n\t\t\n\t\t$outputs=array($send_address => (float)$send_amount);\n\t\t\n\t\tif ($change_amount>=OP_RETURN_BTC_DUST)\n\t\t\t$outputs[$change_address]=$change_amount;\n\n\t\t$raw_txn=OP_RETURN_create_txn($inputs_spend['inputs'], $outputs, $metadata, count($outputs), $testnet);\n\n\t\t\n\t//\tSign and send the transaction, return result\n\n\t\treturn OP_RETURN_sign_send_txn($raw_txn, $testnet);\n\t}", "function eth_verify_wallet($addr, $sig) {\n\treturn true;\n}", "function mail_payout($email, $user, $amount, $wallet, $txid)\n{\n global $mail_headers;\n\n $message = \"Hello,\\n\\nThis is a BTC withdrawal notification from https://www.bitjack21.com for $user.\\n\\n$amount BTC has just been sent to your Bitcoin wallet $wallet\\n\\nYou can track this payout on blockexplorer.com using the transaction ID $txid as per below:\\n\\nhttp://blockexplorer.com/tx/$txid\\n\\nThanks for playing!\\n\\n--\\nbitjack21.com\";\n\n mail($email, \"[BitJack21] Withdrawal Notification\", $message, $mail_headers);\n}", "private static function sign($value)\n {\n return config('encoder_service.sign') . $value;\n }", "public function dumpPrivateKey($bitcoinaddress);", "public static function signWithoutToHex($params,$unSignKeyList) {\n\t\tksort($params);\n \t\t$sourceSignString = SignUtil::signString ( $params, $unSignKeyList );\n \t\t//echo \"sourceSignString=\".htmlspecialchars($sourceSignString).\"<br/>\";\n \t\t//error_log(\"=========>sourceSignString:\".$sourceSignString, 0);\n \t\t$sha256SourceSignString = hash ( \"sha256\", $sourceSignString);\t\n \t\t//error_log($sha256SourceSignString, 0);\n \t\t//echo \"sha256SourceSignString=\".htmlspecialchars($sha256SourceSignString).\"<br/>\";\n return RSAUtils::encryptByPrivateKey ($sha256SourceSignString);\n\t}", "public function verifymessage($bitcoinaddress, $signature, $message)\n\t{\n\t\t$result = $this->connect('verifymessage', array((string) $bitcoinaddress, (string) $signature, (string) $message));\n\t\tif ( ! is_null($error = $this->_get_error($result)))\n\t\t{\n\t\t\treturn $error;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn (bool) $result;\n\t\t}\n\t}", "public function send($message, $to_phone);", "private static function createMessageSig($params, $secret){\r\n return hash_hmac('md5', $params, $secret);\r\n }", "public function base58EncodeAddress($key);", "function smsSending($mobile, $sign, $args = array(), $templateId = 'SMS_585014') {\n $smssettings = unserialize(variable_get('smssettings'));\n $c = new TopClient;\n $c->format = 'json';\n $c->appkey = $smssettings['appkey'];//$appkey;\n $c->secretKey = $smssettings['secret'];//$secret;\n $req = new AlibabaAliqinFcSmsNumSendRequest;\n $req->setExtend(\"\");\n $req->setSmsType(\"normal\");\n $req->setSmsFreeSignName($sign);\n $param = json_encode($args);\n $req->setSmsParam($param);\n $req->setRecNum($mobile);\n $req->setSmsTemplateCode($templateId);//\n $resp = $c->execute($req);\n return $resp;\n}", "public function getMessageSignature(string $message, string $privateKey): string\n {\n try {\n $privateKey = sodium_hex2bin($privateKey);\n if (strlen($privateKey) !== SODIUM_CRYPTO_SIGN_SECRETKEYBYTES) {\n throw new InvalidArgumentException('The key must be ' . SODIUM_CRYPTO_SIGN_SECRETKEYBYTES . ' long.');\n }\n\n if (strlen($message) === 0) {\n throw new InvalidArgumentException('The message must not be empty.');\n }\n\n return sodium_bin2hex(sodium_crypto_sign_detached($message, $privateKey));\n } catch (SodiumException $e) {\n throw new RuntimeException('Could not sign data', 0, $e);\n }\n }", "private function generate_signature()\n {\n $phrase = implode('', func_get_args());\n /**\n * Sign data and make final signature\n */\n $signature = '';\n $private_key_id = openssl_pkey_get_private($this->private_key);\n if (!openssl_sign($phrase, $signature, $private_key_id, OPENSSL_ALGO_SHA1)) {\n throw new BankException('OPEN SSL SIGN ERROR');\n }\n\n return $signature;\n }", "public function blockchain_addr() {\n\t\t$secret = substr(md5( rand() * time()),0,8);\n\t\t$callback_url = $this->callback_url . \"/\" . $secret;\n\t\t\n\t\t$url = \"https://blockchain.info/api/receive?method=create&address=\" . $this->receiving_address . \"&callback=\" . urlencode($callback_url);\n\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 1);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t$ret = curl_exec($ch);\n\t\t\n\t\t$this->curlinfo = curl_getinfo($ch);\n\t\t$header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);\n\t\t$this->header = substr($ret, 0, $header_size);\n\t\t$ret = substr($ret, $header_size);\n\n\t\t$arr = json_decode($ret);\n\t\t$this->json_response = $arr;\n\t\t$this->json_error = json_last_error();\n\t\t$this->raw_response = $ret;\n\t\t\n\t\t$this->dump_log();\n\t\tif(!$this->json_error) {\n\t\t\t$this->callback_url = $this->json_response->callback_url;\n\t\t\t$this->input_address = $this->json_response->input_address;\n\t\t\t$this->status = -1;\n\t\t\t$this->destination = $this->json_response->destination;\n\t\t\t$this->fee_percent = $this->json_response->fee_percent;\n\t\t\t$this->secret = $secret;\n\n\t\t\tquery(\"INSERT INTO address (date_created, status, callback_url, input_address, destination, fee_percent, secret, repo, user_id, asset_id) \n\t\t\t VALUES (\n\t\t\t\tNOW(), \n\t\t\t\t'-1', \n\t\t\t\t'\" . escape($this->callback_url) . \"', \n\t\t\t\t'\" . escape($this->input_address) . \"', \n\t\t\t\t'\" . escape($this->destination) . \"', \n\t\t\t\t'\" . escape($this->fee_percent) . \"',\n\t\t\t\t'\" . $secret . \"',\n\t\t\t\t'\" . escape($repo) . \"', \n\t\t\t\t'\" . escape($_SESSION['user']['github_id']) . \"',\n\t\t\t\t'-1'\n\t\t\t )\");\n\n\t\t\treturn(1);\n\t\t}\n\n\t}", "public function add_address($wallet_id, $address, $userid = 0, $is_change_address = 0, $address_num = 0, $key_id = 0) { \n\n\t// Initialize\n\tglobal $config;\n\t\n\t// Add address to db\n\tDB::insert('coin_addresses', array(\n\t\t'wallet_id' => $wallet_id, \n\t\t'key_id' => $key_id, \n\t\t'userid' => $userid, \n\t\t'is_change_address' => $is_change_address, \n\t\t'address_num' => $address_num, \n\t\t'address' => $address)\n\t);\n\n\t// Init RPC client\n\tinclude_once(SITE_PATH . '/data/lib/jsonRPCClient.php');\n\t$rpc_url = 'http://' . $config['btc_rpc_user'] . ':' . $config['btc_rpc_pass'] . '@' . $config['btc_rpc_host'] . ':' . $config['btc_rpc_port'];\n\t$client = new jsonRPCClient($rpc_url);\n\n\t// Import address to bitcoind\n\ttry {\n\t\t$client->importaddress($address, \"\", false);\n\t} catch (Exception $e) { \n\t\ttrigger_error(\"Unable to import address into Bitcoin Core as a watch only address, $address. Please ensure Bitcoin Core is running, and in the correct mode (mainnet / testnet).\", E_USER_ERROR);\n\t}\n\n}", "public function sendtoaddress($bitcoinaddress, $amount, $comment = '', $comment_to = '')\n\t{\n\t\tif ( ! is_int($amount))\n\t\t{\n\t\t\tlog_message('error', 'Bad data received for $amount at bitcoin->sendtoaddress()');\n\t\t\treturn NULL;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$result = $this->connect('sendtoaddress', array((string) $bitcoinaddress, $this->amount_to_JSON($amount), (string) $comment, (string) $comment_to));\n\t\t\tif ( ! is_null($error = $this->_get_error($result)))\n\t\t\t{\n\t\t\t\treturn $error;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $result;\n\t\t\t}\n\t\t}\n\t}", "function sendSMS($client, $number, $message) {\r\n $client->messages->create(\r\n $number,\r\n array(\r\n \"from\" => \"+16474901643\",\r\n \"body\" => \"Reminder: \".$message\r\n )\r\n );\r\n}", "function getEncodedSignature($hostName,$digestEncoded,$SS_KEY,$path)\r\n{\r\n $signatureString = \"host: \".$hostName.\"\\n(request-target): post \".$path.\"\\n\".\"digest: SHA-256=\".$digestEncoded.\"\\n\".\"v-c-merchant-id: starlock01\";\r\n $signatureByteString = utf8_encode($signatureString);\r\n $decodeKey = base64_decode($SS_KEY);\r\n $signature = base64_encode(hash_hmac(\"sha256\", $signatureByteString,\r\n $decodeKey, true));\r\n return $signature;\r\n}", "private function sign(string $input)\n {\n return md5(($input . $this->appsecret));\n }", "public function CreateTransactionSimple($amount, $currency1, $currency2, $address='', $ipn_url='', $buyer_email='') {\t\t\n\t\t$req = array(\n\t\t\t'amount' => $amount,\n\t\t\t'currency1' => $currency1,\n\t\t\t'currency2' => $currency2,\n\t\t\t'address' => $address,\n\t\t\t'ipn_url' => $ipn_url,\n\t\t\t'buyer_email' => $buyer_email,\n\t\t);\n\t\treturn $this->api_call('create_transaction', $req);\n\t}", "protected function sign()\n {\n trigger_error(\"Not implemented\", E_ERROR);\n }", "function signUrl($myUrlToSign, $privateKey)\n{\n // parse the url\n $url = parse_url($myUrlToSign);\n\n $urlPartToSign = $url['path'] . \"?\" . $url['query'];\n\n // Decode the private key into its binary format\n $decodedKey = decodeBase64UrlSafe($privateKey);\n\n // Create a signature using the private key and the URL-encoded\n // string using HMAC SHA1. This signature will be binary.\n $signature = hash_hmac(\"sha1\",$urlPartToSign, $decodedKey, true);\n\n $encodedSignature = encodeBase64UrlSafe($signature);\n\n return $myUrlToSign.\"&signature=\".$encodedSignature;\n}", "public function __construct($bitcoinAddress = null, $bitcoinAmount = null)\n {\n $this\n ->setBitcoinAddress($bitcoinAddress)\n ->setBitcoinAmount($bitcoinAmount);\n }", "function signUrl($myUrlToSign, $privateKey) {\n // parse the url\n $url = parse_url($myUrlToSign);\n\n $urlPartToSign = $url['path'] . \"?\" . $url['query'];\n\n // Decode the private key into its binary format\n $decodedKey = decodeBase64UrlSafe($privateKey);\n\n // Create a signature using the private key and the URL-encoded\n // string using HMAC SHA1. This signature will be binary.\n $signature = hash_hmac(\"sha1\",$urlPartToSign, $decodedKey, true);\n\n $encodedSignature = encodeBase64UrlSafe($signature);\n\n return $myUrlToSign.\"&signature=\".$encodedSignature;\n}", "protected static function _sign($parameters)\n\t{\n\t\t// Fixup our private key, copy-pasting the key might lead to whitespace faults\n\t\tif(!preg_match('/-----BEGIN (RSA )?PRIVATE KEY-----(.*)-----END (RSA )?PRIVATE KEY-----/si', Transip_ApiSettings::$privateKey, $matches))\n\t\t\tdie('<p>Could not find your private key, please supply your private key in the ApiSettings file. You can request a new private key in your TransIP Controlpanel.</p>');\n\n\t\t$key = $matches[2];\n\t\t$key = preg_replace('/\\s*/s', '', $key);\n\t\t$key = chunk_split($key, 64, \"\\n\");\n\n\t\t$key = \"-----BEGIN PRIVATE KEY-----\\n\" . $key . \"-----END PRIVATE KEY-----\";\n\n\t\t$digest = self::_sha512Asn1(self::_encodeParameters($parameters));\n\t\tif(!@openssl_private_encrypt($digest, $signature, $key))\n\t\t\tdie('<p>Could not sign your request, please supply your private key in the ApiSettings file. You can request a new private key in your TransIP Controlpanel.</p>');\n\n\t\treturn base64_encode($signature);\n\t}", "function bbsCoinSendPM($subject, $message, $to) {\n\t$pmfrom = array(\n\t\t'id' => 1,\n\t\t'name' => 'admin',\n\t\t'username' => 'admin'\n\t);\n\n\t// Who is receiving the IM\t\t\n\t$pmto = array(\n\t\t'to' => array($to),\n\t\t'bcc' => array()\n\t);\n\t// Send the PM\n\treturn sendpm($pmto, $subject, $message, 0, $pmfrom);\n}", "function signMessage($priv_keyfile, $key_pass, $data) {\r\n \t$data = preg_replace(\"/\\s/\",\"\",$data);\r\n $fp = fopen( \"security/\" . $priv_keyfile , \"r\");\r\n $priv_key = fread($fp, 8192);\r\n fclose($fp);\r\n $pkeyid = openssl_get_privatekey($priv_key, $key_pass);\r\n\r\n // compute signature\r\n openssl_sign($data, $signature, $pkeyid);\r\n\r\n // free the key from memory\r\n openssl_free_key($pkeyid);\r\n\r\n return $signature;\r\n\r\n }", "public function getSignedMessage(string $message, string $privateKey): string\n {\n try {\n $privateKey = sodium_hex2bin($privateKey);\n if (strlen($privateKey) !== SODIUM_CRYPTO_SIGN_SECRETKEYBYTES) {\n throw new InvalidArgumentException('The key must be ' . SODIUM_CRYPTO_SIGN_SECRETKEYBYTES . ' long.');\n }\n\n if (strlen($message) === 0) {\n throw new InvalidArgumentException('The message must not be empty.');\n }\n\n return sodium_bin2base64(sodium_crypto_sign($message, $privateKey), SODIUM_BASE64_VARIANT_ORIGINAL);\n } catch (SodiumException $e) {\n throw new RuntimeException('Could not sign data', 0, $e);\n }\n }", "public function verifyMessage($address, $sig, $message)\n {\n $body = ['sig' => $sig, 'message' => $message];\n $result = $this->newAPIRequest('GET', '/message/verify/'.$address, $body);\n return $result;\n }", "public static function send_message($number=\"\", $message=\"\"){\n //encode test message\n $encoded_message = urlencode($message);\n\n //parameterized string for sending message\n $send_string = self::$api.\"From=\".self::$from.\"&To={$number}\".\n \"&Content={$encoded_message}\".\"&ClientId=\".self::$client_id.\n \"&ClientSecret=\".self::$client_secret.\"&RegisteredDelivery=\".\n self::$registered_delivery;\n\n //initialising library for data transfer\n $curl = curl_init();\n curl_setopt_array( $curl,\n array( CURLOPT_URL => $send_string, CURLOPT_RETURNTRANSFER => true,\n CURLOPT_CUSTOMREQUEST => \"GET\"));\n\n //executing the transfer\n $response = curl_exec($curl);\n\n //fetching error if any\n $error = curl_error($curl);\n\n if($error){\n echo \"CURL ERROR #:\". $error;\n } else {\n return $response;\n }\n }", "function send($sendnow=false, $skey=null, $mess=null, $recipient=null, $senderid=null, $widget=false) {\r\n \t\t$sendnow = (boolean)$sendnow;\r\n \t\t$widget = (boolean)$widget;\r\n \t\t\r\n \t\t//echo $sendnow.'-'.$skey.'-'.$mess.'-'.$recipient.'-'.$senderid;exit;\r\n \t\t//pr($_REQUEST); exit;\r\n\t\t\r\n\n\t\t$this->write(date('Y-m-d H:i:s') .' :: '. $_SERVER['REMOTE_ADDR']);\n\n \t\tif(!$sendnow) {\r\n\r\n \t\t\t$skey = urldecode(trim($_REQUEST['skey']));\r\n\t \t\t$mess = urldecode(trim($_REQUEST['message']));\r\n\t \t\t$recipient = filter_var(urldecode(trim($_REQUEST['recipient'])), FILTER_SANITIZE_STRING);\r\n\t \t\t\r\n\t \t\t// Sender ID is optional\r\n\t \t\tif(isset($_REQUEST['senderid'])) $senderid = filter_var(urldecode(trim($_REQUEST['senderid'])),FILTER_SANITIZE_STRING);\r\n\t \t\telse $senderid = '';\r\n\t \t\t\r\n\t \t\t// Response is optional\r\n\t \t\tif(isset($_REQUEST['response'])) $response_format = trim($_REQUEST['response']);\r\n\t \t\telse $response_format = 'xml';\r\n\t \t\t\r\n \t\t}\r\n\r\n \t\t/* url decode the message if coming from widget\t*/\r\n \t\tif($widget) {\r\n \t\t\t$mess = urldecode($mess);\r\n \t\t}\r\n \t\t\r\n \t\tif(FREE_SMS_SERVER_DOWN) {\r\n\r\n \t\t\tif(!$sendnow) $this->_throwError($this->_errorMsgEnvelope($this->_errorMsg($sendnow, UNAVAILABLE_MESSAGE)), $response_format);\r\n \t\t\telse return UNAVAILABLE_MESSAGE;\r\n \t\t\t\r\n \t\t}\r\n \t\t\r\n \t\tif(NINE_TO_NINE_ACTIVATED) {\r\n\r\n \t\t\tif(!$sendnow) $this->_throwError($this->_errorMsgEnvelope($this->_errorMsg($sendnow, NINE_TO_NINE_ACTIVATED_MESSAGE)), $response_format);\r\n \t\t\telse return NINE_TO_NINE_ACTIVATED_MESSAGE;\r\n \t\t\t\r\n \t\t}\r\n \t\t\r\n \t\t/*\tGet Remote Address\t*/\r\n\t\t$remote_addr = $this->getRemoteAddr();\r\n\t\t\r\n\t\t/*\tGet Client IP is available (from widget)*/\r\n\t\t$client_ip = 0;\r\n\t\tif(isset($_REQUEST['client_ip']) && !empty($_REQUEST['client_ip']))\r\n\t\t\t$client_ip = $_REQUEST['client_ip'];\r\n\t\t\r\n \t\t/*\tCorrect Encoding\t*/\r\n \t\t$mess = iconv('UTF-8', 'ASCII//TRANSLIT', $mess);\r\n \t\t\r\n \t\t$original_message = $mess;\r\n \t\t\r\n \t\t/*\tConvert newlines to spaces\t*/\r\n \t\t$mess = str_replace(\"\\r\\n\", \"\\n\", $mess);\r\n \t\t\r\n \t\t$output = '';\r\n \t\t\r\n \t\tif(!$skey || !$mess || !$recipient) {\r\n \t\t\t\r\n \t\t\t$return_message = 'One or more parameters are missing';\r\n \t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n \t\t\t\r\n \t\t\tif(!$sendnow) $this->_throwError($output, $response_format); \r\n \t\t\telse return $return_message;\r\n \t\t\t\r\n \t\t}\r\n \t\t\r\n \t\t$domain = $this->checkSecretKey($skey);\r\n \t\t//pr($domain);exit;\r\n \t\tif($domain) {\r\n \t\t\t\r\n \t\t\t$domain_id = $domain['0'];\r\n \t\t\t$from = $domain_name = $domain['1'];\r\n \t\t\t$plan_id = $domain['2'];\r\n \t\t\t$server = $domain['3'];\r\n \t\t\t$ip = $domain['4'];\r\n \t\t\t$category_id = $domain['5'];\r\n \t\t\t$verify = $domain['6'];\r\n \t\t\t$per_day_limit = $domain['7'];\r\n \t\t\t$user_id = $domain['8'];\r\n \t\t\t$widget_restriction_on_user = $domain['9'];\r\n \t\t\t\r\n \t\t\t/*\tSMS's are accepted only from widgets */\r\n \t\t\tif(!$sendnow && $widget_restriction_on_user) {\r\n \t\t\t\t\r\n \t\t\t\t$return_message = 'Use of API is suspended from your account. Instead use SMS WIDGET';\r\n\t \t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n\t \t\t\t\r\n\t\t\t\tif(!$sendnow) $this->_throwError($output, $response_format); \r\n\t \t\t\telse return $return_message;\r\n\t \t\t\t\r\n \t\t\t}\r\n \t\t\r\n\t\t\t/*\tCheck for Spam\t*/\r\n\t\t\tif($this->checkIfSpam($mess)) {\r\n\t\t\t\t\r\n\t\t\t\t/*\tAdd to spam table\t*/\r\n\t\t\t\t$this->markAsSpam($recipient, $mess, $domain_id, $remote_addr, $client_ip);\r\n\t\t\t\t\r\n\t\t\t\t$return_message = 'Spam and Abusive messages are strictly prohibited';\r\n\t \t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n\t \t\t\t\r\n\t\t\t\tif(!$sendnow) $this->_throwError($output, $response_format); \r\n\t \t\t\telse return $return_message;\r\n\t\t\t}\r\n\r\n\t\t\t/*\tAdd freesmsapi footer */\r\n\t\t\t$mess = $this->charLimit($mess);\r\n\t\t\t$mess = $mess . FREE_SMS_FOOTER;\r\n\t\t\t\r\n \t\t\t/* check if suspended\t*/\r\n \t\t\t$terminate = $this->checkUserSuspended($user_id);\r\n\t\t\tif(!empty($terminate)) {\r\n\t\t\t\t$return_message = $terminate;\r\n\t\t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n\t \t\t\t\r\n\t\t\t\tif(!$sendnow) $this->_throwError($output, $response_format); \r\n\t \t\t\telse return $return_message;\r\n\t\t\t}\r\n \t\t\t\r\n \t\t\t/*\tGet sms vendor details\t*/\r\n \t\t\t$this->getSmsVendor($domain_id);\r\n \t\t\t//pr($this->sms_vendor_details);\r\n \t\t\t\r\n \t\t\tif(!$sendnow && NOW > VERIFY_START_DATE && !$verify) {\r\n\r\n \t\t\t\t/*\tCheck if Sender ID is purchased or not, \r\n\t\t \t\t * if purchased then dont show verify mobile number box\r\n\t\t \t\t*/\r\n \t\t\t\tif(!$this->get_alias($domain_id)) {\r\n\r\n\t \t\t\t\t$return_message = 'Please verify your Mobile Number to enjoy Uninterrupted Service';\r\n\t \t\t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n\t \t\t\t\t\r\n\t \t\t\t\tif(!$sendnow) $this->_throwError($output, $response_format); \r\n\t \t\t\t\telse return $return_message;\r\n\t\t\t \t\r\n\t\t\t \t} /*else if(!$this->check_alias_purchase($domain_id)) {\r\n\r\n\t \t\t\t\t$output .= '<error><message>Please verify your Mobile Number to enjoy Uninterrupted Service.</message></error>';\r\n\t \t\t\t\t$this->_throwError($output, $response_format);\r\n\t\t\t \t\r\n\t\t\t \t}*/\r\n \t\t\t\t\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t// Check sub - domain\r\n \t\t\tif(!IS_TEST_SERVER && SUBDOMAIN_LOCK) {\r\n \t\t\t\t\r\n \t\t\t\tif(!$sendnow && $_SERVER['SERVER_NAME'] != $server.'.'.SERVERNAME) {\r\n\t \t\t\t\t$return_message = 'Invalid Sub-domain';\r\n\t \t\t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n\t \t\t\t\t\r\n\t \t\t\t\tif(!$sendnow) $this->_throwError($output, $response_format); \r\n\t \t\t\t\telse return $return_message;\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\t// Check IP\r\n \t\t\tif(!IS_TEST_SERVER && IP_LOCK) {\r\n\r\n \t\t\t\t // for new widget || for old too\r\n \t\t\t\tif(($sendnow && $widget) || (!$sendnow)) {\n \r\n \t\t\t\t\tif(!ip2long($ip)) $return_message = 'Invalid IP Address';\r\n\t \t\t\t\telse if($remote_addr != $ip) {\r\n\t \t\t\t\t\tunset($cond);\r\n\t \t\t\t\t\t$cond['conditions']['DomainIp.domain_id'] = $domain_id;\r\n\t \t\t\t\t\t$cond['conditions']['DomainIp.ip'] = ip2long($remote_addr);\r\n\t \t\t\t\t\t$cond['conditions']['DomainIp.status'] = 0;\r\n\t \t\t\t\t\tif($this->DomainIp->find('count', $cond) == 0) {\r\n\t \t\t\t\t\t\t//if(!$this->traceroute($remote_addr, $ip, $domain_id)) {\r\n\t \t\t\t\t\t\t\t//$return_message = 'Invalid IP Address, SMS\\'s are accepted only from the IP Address '.$ip;\r\n\t \t\t\t\t\t\t\t$return_message = 'Invalid Domain, Requests are accepted only from the domain \"'.$domain_name.'\" with an IP Address '.$ip;\r\n\t \t\t\t\t\t\t\t//$return_message = '';\r\n\t \t\t\t\t\t\t//}\t\r\n\t \t\t\t\t\t}\r\n\t \t\t\t\t}\r\n\t \t\t\t\t\n\t\t\t\t\tif(isset($return_message)) {\n\t\r\n\t \t\t\t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n\t \t\t\t\t\r\n\t\t \t\t\t\tif(!$sendnow) $this->_throwError($output, $response_format); \r\n\t\t \t\t\t\telse return $return_message;\n\t\t\t\t\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n \t\t\t\t}\r\n \t\t\t\t\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t// check total number of messages send today and exit if limit exceeded\r\n \t\t\t$this->Message->setSource($server.'_log');\r\n \t\t\t$message_count = $this->Message->find('count', array('conditions'=>array('created'=>date('Y-m-d'), 'domain_id'=>$domain_id)));\r\n \t\t\t\r\n \t\t\t/*$condition['conditions']['id'] = $plan_id;\r\n \t\t\t$condition['fields'] = array('sms', 'interval');\r\n \t\t\t$allowed = $this->Plan->find('all', $condition);\r\n \t\t\t$per_day_limit = $allowed['0']['Plan']['sms'];*/\r\n \t\t\t\r\n \t\t\tif($message_count >= $per_day_limit) {\r\n \t\t\t\t\r\n \t\t\t\t$return_message = 'Your daily sms limit has reached ('.$per_day_limit.' SMS)';\r\n \t\t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n \t\t\t\t\r\n \t\t\t\tif(!$sendnow) $this->_throwError($output, $response_format); \r\n \t\t\t\telse return $return_message;\r\n \t\t\t\t\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t$mobile_number = explode(',', $recipient);\r\n \t\t\t$invalid_mobile = '';\r\n \t\t\t$success = '';\r\n \t\t\t$failed = '';\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t//should not be more than 50 in single request\r\n \t\t\t$allowed_recipient = MAX_RECIPIENT;\r\n \t\t\tif(count($mobile_number) > $allowed_recipient) {\r\n \t\t\t\t\r\n \t\t\t\t$return_message = 'You are tyring to send SMS to '.count($mobile_number).' recipients, While max recipient limit is '.MAX_RECIPIENT.'. Please rectify the above error and then try again';\r\n \t\t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n \t\t\t\t\r\n \t\t\t\tif(!$sendnow) $this->_throwError($output, $response_format);\r\n \t\t\t\telse return $return_message;\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\t//should not be more than 100 in single request\r\n \t\t\t/*$allowed_recipient = MAX_RECIPIENT;\r\n \t\t\tif(count($mobile_number) > $allowed_recipient) {\r\n \t\t\t\t$tmp = array_slice($mobile_number, 0, $allowed_recipient);\r\n \t\t\t\t\r\n \t\t\t\tfor($i=count($tmp); $i<count($mobile_number); $i++)\r\n \t\t\t\t\t$maxlimitreached[] = $mobile_number[$i];\r\n \t\t\t\t\r\n \t\t\t\t$mobile_number = $tmp;\r\n \t\t\t}*/\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t/*\tShould be reduced to $per_day_limit\t*/\r\n \t\t\t$big_count = $message_count + count($mobile_number);\r\n \t\t\tif($big_count > $per_day_limit) {\r\n \t\t\t\t\r\n \t\t\t\t$reduce_to = $big_count - $per_day_limit;\r\n \t\t\t\t$reduce_to = count($mobile_number) - $reduce_to;\r\n \t\t\t\t$mobile_number = array_slice($mobile_number, 0, $reduce_to);\r\n \t\t\t\t\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t/*if(!ONLY_DEVELOPER_SECTION) {\r\n\t \t\t\t//get advertisement related to category\r\n\t \t\t\t//$adv_cond['conditions'] = array('adv_send != quantity');\r\n\t \t\t\t$adv_cond['conditions']['status'] = '0';\r\n\t \t\t\t$adv_cond['conditions']['category_id'] = $category_id;\r\n\t \t\t\t$adv_cond['conditions']['launch_date'] = date('Y-m-d');\r\n\t \t\t\t$adv_cond['conditions']['0'] = 'adv_send <> quantity';\r\n\t \t\t\t$adv_cond['fields'] = array('id', 'content', 'adv_send', 'quantity');\r\n\t \t\t\t$this->AdvContent->unbindAll();\r\n\t \t\t\t$content = $this->AdvContent->find('all', $adv_cond);\r\n\t\r\n\t \t\t\t//add advertisement to message\r\n\t \t\t\tif(!empty($content)) {\r\n\t \t\t\t\t\r\n\t \t\t\t\t$p = 0;\r\n\t \t\t\t\t$content_present = true;\r\n\t \t\t\t\tforeach($content as $c) {\r\n\t \t\t\t\t\t$content_data[$p]['id'] = $c['AdvContent']['id'];\r\n\t \t\t\t\t\t$content_data[$p]['content'] = $c['AdvContent']['content'];\r\n\t \t\t\t\t\t$content_data[$p]['actual'] = $c['AdvContent']['quantity'];\r\n\t \t\t\t\t\t$content_data[$p]['remaining'] = $c['AdvContent']['quantity'] - $c['AdvContent']['adv_send'];\r\n\t \t\t\t\t\t$p++;\r\n\t \t\t\t\t}\r\n\t \t\t\t\t\r\n\t \t\t\t} else $content_present = false;\r\n \t\t\t}*/\r\n \t\t\t\r\n \t\t\t$p = 0;\r\n \t\t\t\t\t\t\r\n\t\t\t/*\tGet senderid */\r\n \t\t\tif(SHOW_SENDER_ID) {\r\n\t \t\t\tif(!$senderid) $senderid = SMS_SENDER_ID;\r\n\t\t\t\telse {\r\n\t\t\t\t\t$val['Alias.domain_id'] = $domain_id;\r\n\t\t\t\t\t$val['Alias.name'] = $senderid;\r\n\t\t\t\t\t$val['Alias.publish'] = '1';\r\n\t\t\t\t\t$val['Alias.status'] = '0';\r\n\t\t\t\t\t$this->Alias->unBindAll();\r\n\t\t\t\t\tif($this->Alias->find('count', array('conditions'=>$val)) == 0) $senderid = SMS_SENDER_ID;\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n \t\t\t\t$senderid = SMS_SENDER_ID;\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t$mobile_number = array_filter($mobile_number);\r\n \t\t\t\r\n \t\t\tforeach($mobile_number as $v) {\r\n \t\t\t\t$to = filter_var($v, FILTER_SANITIZE_NUMBER_INT);\r\n \t\t\t\t$to = trim($to);\r\n \t\t\t\t\r\n \t\t\t\t//check if mobile number is valid\r\n \t\t\t\tif($this->checkNumber($to)) {\r\n \t\t\t\t\t\r\n \t\t\t\t\t/*if(!ONLY_DEVELOPER_SECTION) {\r\n\t \t\t\t\t\t//merge the message with the advertisement if available\r\n\t \t\t\t\t\tif($content_present) {\r\n\t \t\t\t\t\t\tif(isset($content_data[$p])) {\r\n\t\t\t \t\t\t\t\tif($content_data[$p]['remaining'] > 0) {\r\n\t\t\t \t\t\t\t\t\t\r\n\t\t\t \t\t\t\t\t\t$mess = $original_message . LINE_BREAK . $content_data[$p]['content'];\r\n\t\t\t \t\t\t\t\t\t$content_data[$p]['remaining']--;\r\n\t\t\t \t\t\t\t\t\t\r\n\t\t\t \t\t\t\t\t} else {\r\n\t\t\t \t\t\t\t\t\t\r\n\t\t\t \t\t\t\t\t\t$p++;\r\n\t\t\t \t\t\t\t\t\tif(isset($content_data[$p])) {\r\n\t\t\t\t \t\t\t\t\t\t$mess = $original_message . LINE_BREAK . $content_data[$p]['content'];\r\n\t\t\t\t \t\t\t\t\t\t$content_data[$p]['remaining']--;\r\n\t\t\t \t\t\t\t\t\t}\r\n\t\t\t \t\t\t\t\t\t\r\n\t\t\t \t\t\t\t\t}\r\n\t \t\t\t\t\t\t}\t \t\t\t\t\t\r\n\t \t\t\t\t\t}\r\n \t\t\t\t\t}*/\r\n \t\t\t\t\t\r\n \t\t\t\t\t\r\n \t\t\t\t\t//send sms\r\n\t\t \t\t\t$response_key = $this->_sendMessage($to, $mess, $senderid);\r\n \t\t\t\t\t\r\n\t\t \t\t\tif($response_key) {\r\n\r\n\t\t \t\t\t\t$value['name'] = $to;\r\n\t\t\t \t\t\t$value['sender'] = $senderid;\r\n\t\t\t \t\t\t$value['message'] = $original_message;\r\n\t\t\t \t\t\t$value['domain_id'] = $domain_id;\r\n\t\t\t \t\t\t$value['adv_content_id'] = (isset($content_data[$p]['id']) ? $content_data[$p]['id'] : '0');\r\n\t\t\t \t\t\t$value['response_key'] = $response_key;\r\n\t\t\t \t\t\t$value['response_status'] = UNDELIVERED;\r\n\t\t\t \t\t\t$value['ip'] = ip2long($remote_addr);\r\n\t\t \t\t\t\t$value['client_ip'] = ip2long($client_ip);\r\n\t\t\t \t\t\t$value['sms_vendor_id'] = $this->sms_vendor_id;\r\n\t\t\t \t\t\t$value['updated'] = date('Y-m-d H:i:s');\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t//insert sms entry into log\r\n\t\t\t \t\t\t$this->Message->create();\r\n\t\t\t \t\t\t$this->Message->setSource($server.'_log');\r\n\t\t\t \t\t\t$this->Message->save($value);\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\t// store for DND numbers in a seperate array\r\n\t\t\t \t\t\tif(substr($response_key, 0, 4) == '007-') {\r\n\t\t\t \t\t\t\t$dnd[] = $to;\r\n\t\t\t \t\t\t} else {\r\n\t\t\t\t \t\t\t$success[] = $to;\r\n\t\t\t \t\t\t}\r\n\t\t\t \t\t\t\r\n\t\t\t \t\t\tunset($value);\r\n\t\t\t \t\t\t\r\n\t\t \t\t\t} else {\r\n\t\t\r\n\t\t \t\t\t\t$failed[] = $to;\r\n \t\t\t\t\t\r\n\t\t \t\t\t}\r\n\t\t \t\t\t\t\r\n \t\t\t\t} else {\r\n \t\t\t\t\t\r\n \t\t\t\t\t$invalid_mobile[] = $to;\r\n \t\t\t\t\t\t\r\n \t\t\t\t}\r\n \t\t\t\t\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t//update DB with total sms send\r\n \t\t\t/*if(isset($content_present)) {\r\n\t \t\t\tforeach($content_data as $c) {\r\n\t\r\n\t \t\t\t\t$adv_send = $c['actual'] - $c['remaining'];\r\n\t \t\t\t\t$this->AdvContent->create();\r\n\t \t\t\t\t$this->AdvContent->id = $c['id'];\r\n\t \t\t\t\t$this->AdvContent->saveField('adv_send', $adv_send);\r\n\t \t\t\t\t\r\n\t \t\t\t}\r\n \t\t\t}*/\r\n \t\t\t\r\n \t\t\t/*echo 'in: ';pr($invalid_mobile);\r\n \t\t\techo 'suc: ';pr($success);\r\n \t\t\techo 'fai: ';pr($failed);\r\n \t\t\techo 'dn: ';pr($dnd);\r\n \t\t\texit;*/\r\n\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t// get error messages\r\n \t\t\t$returnerrors = '';\r\n \t\t\tif(isset($invalid_mobile) && !empty($invalid_mobile)) {\r\n \t\t\t\t$allerrors[] = $this->_errorMsg($sendnow, 'Invalid mobile number(s)', $invalid_mobile);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif(isset($failed) && !empty($failed)) {\r\n \t\t\t\t$allerrors[] = $this->_errorMsg($sendnow, 'Unable to send to following number(s)', $failed);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif(isset($dnd) && !empty($dnd)) {\r\n \t\t\t\t$allerrors[] = $this->_errorMsg($sendnow, 'DND service is enabled on following number(s)', $dnd);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\tif(!empty($allerrors)) {\r\n \t\t\t\tif(!$sendnow)\r\n \t\t\t\t\t$returnerrors = '<errors>'.implode('', $allerrors).'</errors>';\r\n \t\t\t\telse\r\n \t\t\t\t\t$returnerrors = implode('<br/>', $allerrors);\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t// get success message\r\n \t\t\t$returnsuccess = '';\r\n \t\t\tif(isset($success) && !empty($success)) {\r\n \t\t\t\t$returnsuccess = $this->_successMsg($sendnow, 'Message successfully sent to following number(s)', $success);\t\r\n \t\t\t}\r\n \t\t\t\r\n \t\t\t// return everything\r\n\t\t\tif(!$sendnow) {\r\n\t\t\t\t\r\n\t\t\t\t$this->_throwError($returnsuccess.$returnerrors, $response_format);\r\n\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t\r\n\t\t\t\tif(!$widget) {\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn $returnsuccess.'::'.$returnerrors;\r\n\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// one mobile number is served at a time\r\n\t\t\t\t\tif(empty($returnsuccess)) return $returnerrors;\r\n\t\t\t\t\telse if(empty($returnerrors)) return $returnsuccess;\r\n\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n \t\t\t// if plan id is not 1 and image is not set on the user domain then return with error\r\n \t\t\t/*$allow = $this->Monitor->field('image_found', array('domain_id' => $domain_id));\r\n \t\t\tif($plan_id != '1' && $allow == 'false') {\r\n \t\t\t\t\r\n \t\t\t\techo 'We are unable to find our advertisement on your website';\r\n \t\t\t\texit;\r\n\r\n \t\t\t}*/ \t\t\t\r\n\r\n \t\t\t\r\n \t\t\t// Check time interval between messages\r\n \t\t\t/*if($allowed['0']['Plan']['interval'] != '0') {\r\n\t \t\t\tunset($condition);\r\n\t \t\t\t$condition['conditions']['domain_id'] = $domain_id;\r\n\t \t\t\t$condition['fields'] = array('MAX(id) as maxid', 'MAX(created) as maxcreated');\r\n\t \t\t\t$this->Message->setSource($server.'_log');\r\n\t \t\t\t$message = $this->Message->find('all', $condition);\r\n\t \t\t\t//echo '<pre>';print_r($message);\r\n\t \t\t\t\r\n\t \t\t\t$result = $this->Message->query('SELECT UNIX_TIMESTAMP()-UNIX_TIMESTAMP(\"'.$message['0']['0']['maxcreated'].'\") as difference');\r\n\t \t\t\tif($result['0']['0']['difference'] < $allowed['0']['Plan']['interval']) {\r\n\t \t\t\t\t\r\n\t \t\t\t\techo 'This message will be dropped as your time interval betweeen two messages should be greater than '.$allowed['0']['Plan']['interval'].' secs';\r\n\t \t\t\t\texit;\r\n\t \t\t\t\t\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} else { \r\n \t\t\t\t\r\n \t\t\t$return_message = 'Invalid Secret Key';\r\n \t\t\t$output = $this->_errorMsgEnvelope($this->_errorMsg($sendnow, $return_message));\r\n\r\n \t\t\tif(!$sendnow) $this->_throwError($output, $response_format);\r\n \t\t\telse return $return_message;\r\n\t\t\t\r\n \t\t}\r\n \t\t\r\n \t\texit;\r\n \t\t\r\n \t}", "public function sendMessage(ShortMessageContract $message);", "public function add_wallet() { \n\n\t// Initialize\n\tglobal $template;\n\t$enc_client = new encrypt();\n\n\t// Set variables\n\t$required_sigs = $_POST['address_type'] == 'standard' ? 1 : $_POST['multisig_sig_required'];\n\t$total_sigs = $_POST['address_type'] == 'standard' ? 1 : $_POST['multisig_sig_total'];\n\n\t// Validate public keys\n\tif ($_POST['autogen_keys'] == 0) { \n\t\tfor ($x=1; $x <= $total_sigs; $x++) { \n\t\t\tif (!$import = $this->import($_POST['bip32_key' . $x])) { $template->add_message(\"The #$x BIP32 key you specified is an invalid BIP32 key.\", 'error'); }\n\t\t\telseif ($import['type'] != 'public') { $template->add_message(\"The #$x BIP32 key you specified is an invalid BIP32 key.\", 'error'); }\n\t\t}\n\t}\n\n\t// Create wallet, if no errors\n\t$wallet_id = 0;\n\tif ($template->has_errors != 1) { \n\n\t\t// Add to DB\n\t\tDB::insert('coin_wallets', array(\n\t\t\t'address_type' => $_POST['address_type'], \n\t\t\t'sigs_required' => $required_sigs, \n\t\t\t'sigs_total' => $total_sigs, \n\t\t\t'display_name' => $_POST['wallet_name'])\n\t\t);\n\t\t$wallet_id = DB::insertId();\n\n\t\t// Gather BIP32 keys\n\t\t$keys = array();\n\t\tfor ($x=1; $x <= $total_sigs; $x++) { \n\n\t\t\t// Auto-generate, if needed\n\t\t\tif ($_POST['autogen_keys'] == 1) { \n\t\t\t\t$private_key = $this->generate_master_key();\n\t\t\t\t$public_key = $this->extended_private_to_public($private_key);\n\n\t\t\t\tarray_push($keys, array(\n\t\t\t\t\t'num' => $x, \n\t\t\t\t\t'private_key' => $private_key, \n\t\t\t\t\t'public_key' => $public_key)\n\t\t\t\t);\n\n\t\t\t} else { $public_key = $_POST['bip32_key' . $x]; }\n\n\t\t\t// Add key to db\n\t\t\tDB::insert('coin_wallets_keys', array(\n\t\t\t\t'wallet_id' => $wallet_id, \n\t\t\t\t'public_key' => $enc_client->encrypt($public_key))\n\t\t\t);\n\t\t}\n\n\t\t// User message\n\t\tif ($_POST['autogen_keys'] == 1) { \n\t\t\t$template = new template('admin/setup/bip32_keys');\n\t\t\t$template->assign('keys', $keys);\n\t\t\t$template->parse(); exit(0);\n\n\t\t} else { \n\t\t\t$template->add_message(\"Successfully added new wallet, $_POST[wallet_name]\");\n\t\t}\n\t}\n\n\t// Return\n\treturn $wallet_id;\n\n}", "private function signQuery($query)\n {\n $stringToSign = \"GET\\n$this->host\\n$this->requestURI\\n$query\";\n $signature = base64_encode(hash_hmac('sha256', $stringToSign, $this->AWSSecretKey, true));\n $signature = str_replace(\"%7E\", \"~\", rawurlencode($signature));\n \n return $signature;\n }", "public static function hmac_sha1_sign($string = '', $key = '')\n\t\t{\n\t\t\t$key_64 = str_pad(((strlen((string)$key) > 64) ? pack('H*', sha1((string)$key)) : (string)$key), 64, chr(0x00));\n\n\t\t\treturn pack('H*', sha1(($key_64 ^ str_repeat(chr(0x5c), 64)).pack('H*', sha1(($key_64 ^ str_repeat(chr(0x36), 64)).(string)$string))));\n\t\t}", "public function sender()\n {\n $account = Session::getAccount();\n $customer = Session::getCustomer();\n $transaction = Session::getTransaction();\n\n $transaction->setAccountId($account->getAccountId());\n $transaction->setCompanyId($account->getCompanyId());\n $transaction->setTransactionTypeId(Transaction::TYPE_SENDER);\n $transaction->setTransactionStatusId(Transaction::STATUS_SUBMITTED);\n\n //transaction request\n $amount = $this->wsRequest->requireNumericAndPositive('amount');\n $username = trim($this->wsRequest->requireNotNullOrEmpty('uid'));\n $agencyTypeId = $this->wsRequest->requireNumericAndPositive('type');\n $merchantTransId = trim($this->wsRequest->getParam('merchantTransId'));\n\n $transaction->setFee(0);\n $transaction->setAmount($amount);\n $transaction->setUsername($username);\n $transaction->setAgencyTypeId($agencyTypeId);\n $transaction->setMerchantTransId($merchantTransId);\n\n //validate if need to create the customer\n $customer->validateFromRequest($account, $this->wsRequest);\n $transaction->setCustomerId($customer->getCustomerId());\n\n //get name\n $person = new Person();\n $provider = new Provider();\n $providerException = null;\n foreach($this->providers as $providerData){\n $providerException = null;\n $providerId = $providerData['Provider_Id'];\n $providerClassName = $providerData['Name'];\n if(class_exists($providerClassName)){\n try{\n $provider = Session::getProvider($providerId);\n $person = $provider->sender();\n if($person && $person->getPersonId()){\n break;\n }\n }catch(PersonException $exception){\n $providerException = $exception;\n continue;\n }catch(CustomerBlackListException $exception){\n $providerException = $exception;\n continue;\n }catch(LimitException $exception){\n $providerException = $exception;\n continue;\n }catch(P2PException $exception){\n $providerException = $exception;\n continue;\n }catch(P2PLimitException $exception){\n $providerException = $exception;\n continue;\n }catch(APIBlackListException $exception){\n $providerException = $exception;\n continue;\n }catch(APIPersonException $exception){\n $providerException = $exception;\n continue;\n }catch(APILimitException $exception){\n $providerException = $exception;\n continue;\n }catch(APIException $exception){\n $providerException = $exception;\n continue;\n }catch(P2PAgencyException $exception){\n $providerException = $exception;\n continue;\n }catch(Exception $exception){\n throw $exception;\n }\n }\n }\n\n if(!$person || !$person->getPersonId()){\n if($providerException){\n throw $providerException;\n }elseif($provider->getApiMessage()){\n throw new APIException($provider->getApiMessage());\n }else{\n throw new TransactionException('We cannot give a Sender for this Customer (Receiver)');\n }\n }\n\n //block person\n $person->block();\n //sets personId\n $transaction->setPersonId($person->getPersonId());\n //create transaction after the validation of the data\n $transaction->create();\n if($transaction->getTransactionId()){\n $provider->stickiness();\n\n $wsResponse = new WSResponseOk();\n $wsResponse->addElement('transaction', $transaction);\n $wsResponse->addElement('sender', $person);\n $wsResponse->addElement('receiver', $customer);\n }else{\n throw new TransactionException(\"The Transaction not has been created. Please, try later!\");\n }\n\n return $wsResponse;\n }", "public function macAddress(string|int|float $message): self\n {\n return $this->addMessage(new MACAddress($message));\n }", "public function testCanAddBitcoinAddress()\n {\n $result = Wallet::add(self::VALID_BTC_ADDRESS, Wallet::BITCOIN);\n\n $this->assertTrue($result);\n }", "function dsf_send_sagepay_mail($savedorder, $address_confirmations=''){\nglobal $basket, $customer_id, $payment, $currencies;\n\n\t\t\t\t\t$good_mail_id = '3';\n\t\t\t\t\t$bad_mail_id = '6';\n\n\n\t\t\t\t\tif ($address_confirmations == 'OK'){ // status OK and addresses OK\n\t\t\t\t\t\t\n\t\t\t\t\t\t$email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $good_mail_id .\"'\");\n\t\t\t\t\t }elseif (MODULE_PAYMENT_PROTXCC_CHECK_ADDRESS == 'false'){\n\t\t\t\t\t\t$email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $good_mail_id .\"'\");\n\t\t\t\t\t}elseif ($address_confirmations == 'ALLOW'){ // status OK Adress failed under threshold.\n\t\t\t\t\t\t$email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $good_mail_id .\"'\");\n\t\t\t\t\t }else{\n\t\t\t\t\t $email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $bad_mail_id .\"'\");\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\n// lets start with the email confirmation\n\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t$email_details = dsf_db_fetch_array($email_query);\n\t\t\t\t\t\t\t\t\t\t$signature_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='1'\");\n\t\t\t\t\t\t\t\t\t $signature_details = dsf_db_fetch_array($signature_query);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_subject = $email_details['subject'];\n\t\t\t\t\t\t\t\t\t $email_footer = $signature_details['details'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// overwrite subject as per Christian emails 2011-09-28\n\t\t\t\t\t\t\t\t\t $email_subject = TRANSLATION_EMAIL_YOUR_ORDER . ' ' . SAP_ORDER_PREFIX . $savedorder->info['id'];\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// plain text;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order = TRANSLATION_WORD_DEAR . ' ' . $savedorder->customer['name'] . \"\\n\\n\" . $email_details['details'] . \"\\n\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t// get products ordered by doing email function.\n\t\t\t\t\t\t\t\t\t $products_ordered = dsf_order_email_items($savedorder, 'true');\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order .= $products_ordered['plain'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order .= \"\\n\" .EMAIL_SEPARATOR .\"\\n\" . $email_footer;\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \t\t// html\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $html_order = TRANSLATION_WORD_DEAR . ' ' . $savedorder->customer['name'] . \"<br /><br />\";\n\t\t\t\t\t\t\t\t\t $html_order .= $email_details['details'] . \"<br /><br />\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $html_order .= $products_ordered['html'] . '<br /><br />';\n\t\t\t\t\t\t\t\t\t $html_order .= $email_footer;\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order = str_replace(\"[ORDER_NUMBER]\" , SAP_ORDER_PREFIX . $savedorder->info['id'], $email_order);\n\t\t\t\t\t\t\t\t\t $html_order = str_replace(\"[ORDER_NUMBER]\" , SAP_ORDER_PREFIX . $savedorder->info['id'], $html_order);\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t // end of email.\n\t\t\t\t\t\t \n\n\n \n\t\t\t\t\t dsf_send_email($savedorder->customer['name'], $savedorder->customer['email_address'], $email_subject, $email_order, STORE_OWNER, EMAIL_FROM,$html_order);\n\t\t\t\t\t\n\t\t\t\t\t// send emails to other people\n\t\t\t\t\t if (SEND_EXTRA_ORDER_EMAILS_TO != '') {\n\t\t\t\t\t\tdsf_send_email(STORE_OWNER, SEND_EXTRA_ORDER_EMAILS_TO, $email_subject, $email_order, STORE_OWNER, EMAIL_FROM,$html_order);\n\t\t\t\t\t }\n\n\n\t\t\t\t\t// send emails to other people\n\t\t\t\t\t if (SEND_EXTRA_ORDER_EMAILS_DUPLICATE != '') {\n\t\t\t\t\t\tdsf_send_email(STORE_OWNER, SEND_EXTRA_ORDER_EMAILS_DUPLICATE, $email_subject, $email_order, STORE_OWNER, EMAIL_FROM,$html_order);\n\t\t\t\t\t }\n\n\n\n\n\n// just for consistancy.\n\nreturn true;\n\n\n\n\n}", "public function generateSignature(string $toSign): GenerateSignatureResponse;", "function SendMessage($message, $object, $id, $from_public = false);", "function sign($param,$key){\n\n $sign = \"\";\n foreach($param as $k => $v){\n $sign .= $k.\"=\".$v.\"&\";\n }\n\n $sign .= \"key=\".$key;\n $sign = strtoupper(md5($sign));\n return $sign;\n\n}", "function esms_services_send_message($message, $number, $type) {\n return esms_send_message($message, $number, $type);\n}", "function sendSingleSMS($username, $encryp_password, $senderid, $message, $mobileno, $deptSecureKey) {\n $key = hash('sha512', trim($username) . trim($senderid) . trim($message) . trim($deptSecureKey));\n $data = array(\n \"username\" => trim($username),\n \"password\" => trim($encryp_password),\n \"senderid\" => trim($senderid),\n \"content\" => trim($message),\n \"smsservicetype\" => \"singlemsg\",\n \"mobileno\" => trim($mobileno),\n \"key\" => trim($key)\n );\n return post_to_url(\"https://msdgweb.mgov.gov.in/esms/sendsmsrequest\", $data); //calling post_to_url to send sms \n}", "public function sendToken(Request $request)\n {\n $this->validate($request, [\n 'to-address' => 'required|string',\n 'amount' => 'required|string'\n ]);\n \n $toAddr = $request->input('to-address');\n $amount = $request->input('amount');\n \n $client = new Client([\n // Base URI is used with relative requests\n 'base_uri' => env('TOKEN_API_URL'),\n // You can set any number of default request options.\n 'timeout' => 500.0\n ]);\n\n $tokenRequestParams = [\n \"toAddr\" => $toAddr,\n \"amount\" => $amount,\n ];\n\n $response = $client->request('POST', 'sendToken', [\n 'http_errors' => false,\n 'json' => $tokenRequestParams,\n ]);\n\n if ($response->getStatusCode() == 200) {\n $result = json_decode($response->getBody()->getContents());\n if ($result->success) { \n return response()->json([\n 'success' => true,\n 'txHash' => $result->txHash\n ]);\n } else {\n return response()->json([\n 'success' => false,\n 'message' => 'Token API returns fail'\n ], 500);\n }\n } else {\n return response()->json([\n 'success' => false,\n 'message' => 'cannot reach token API server'\n ], 500);\n }\n }", "public function checkSignMsg($param)\n {\n $datas = [\n 'merchantAcctId', 'version', 'language', 'signType', 'payType',\n 'bankId', 'orderId', 'orderTime', 'orderAmount', 'dealId',\n 'bankDealId', 'dealTime', 'payAmount', 'fee', 'ext1',\n 'ext2', 'payResult', 'payIp', 'errCode', 'signMsg',\n ];\n $pay_params = [];\n foreach($datas as $key){\n $pay_params[$key] = isset($param[$key]) ? $param[$key] : '';\n }\n return $this->weiboapi->checkSignMsg($pay_params);\n }", "function sendWorldLine($phone, $message, $sender) {\n $cert = \"/certs_sms/esmartit.pem\";\n $key = \"/certs_sms/esmartit_key.pem\";\n\n// password del certificado pem\n $passwd = \"Te2pp2so\";\n\n $param='user=ESMARTIT'.\n '&company=ESMARTIT'.\n '&passwd=P45_m61X'.\n '&gsm=%2B'.$phone.\n '&type=plus'.\n '&msg='.$message.\n '&sender='.$sender;\n\n// $url = 'https://push.tempos21.com/mdirectnx-trust/send?'; Ruta con IP\n $url = 'https://push.tempos21.com/mdirectnx/send?';\n $ch = curl_init();\n\n// curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n// curl_setopt($ch, CURLOPT_URL, $url);\n// curl_setopt($ch, CURLOPT_POST, 1);\n// curl_setopt($ch, CURLOPT_POSTFIELDS, $param);\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_SSLVERSION, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSLCERT, $cert);\n curl_setopt($ch, CURLOPT_SSLKEY, $key);\n curl_setopt($ch, CURLOPT_SSLCERTPASSWD, $passwd);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $param);\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $output = curl_exec($ch);\n\n if (curl_errno($ch)) {\n $output = 'Error:' . curl_error($ch);\n }\n curl_close($ch);\n\n return $output;\n }", "public function signParams($params) {\n $signing = '';\n $values = array();\n\t\t$secret = $this->getSecret();\n ksort($params);\n foreach($params as $key => $value) {\n\t\t\t$signing .= $key . $value;\n\t\t\t$values[] = $key . '=' . urlencode($value);\n }\n $values[] = 'api_sig=' . md5($secret . $signing);\n return implode('&', $values);\n }", "abstract public function send($message, $msisdn);", "public function submitblock($hex, $params = null){\n return isset($params) ? $this->bitcoin->submitblock($hex, $params) : $this->bitcoin->submitblock($hex);\n }", "public static function hmac_sha256_sign($string = '', $key = '', $binary = FALSE)\n\t\t{\n\t\t\treturn hash_hmac('sha256', $string, $key, $binary);\n\t\t}", "public static function signSha256($secret, $signInput)\n {\n $result = strtr(base64_encode(hash_hmac(\n 'sha256',\n utf8_encode($signInput),\n utf8_encode($secret),\n true\n )), '+/', '-_');\n\n return $result;\n }", "public function dumpprivkey($address){\n return $this->bitcoin->dumpprivkey($address);\n }", "public function setCoin(string $cryptoCoin);", "private function amazon_hmac($stringToSign) \n {\n // helper function binsha1 for amazon_hmac (returns binary value of sha1 hash)\n if (!function_exists('binsha1'))\n { \n if (version_compare(phpversion(), \"5.0.0\", \">=\")) { \n function binsha1($d) { return sha1($d, true); }\n } else { \n function binsha1($d) { return pack('H*', sha1($d)); }\n }\n }\n\n global $aws_secret;\n\n if (strlen($aws_secret) == 40)\n $aws_secret = $aws_secret.str_repeat(chr(0), 24);\n\n $ipad = str_repeat(chr(0x36), 64);\n $opad = str_repeat(chr(0x5c), 64);\n\n $hmac = binsha1(($aws_secret^$opad).binsha1(($aws_secret^$ipad).$stringToSign));\n return base64_encode($hmac);\n }", "public function ethSendTransaction(Transaction $transaction): Promise\n {\n $data = [$transaction];\n return $this->callEndpoint('eth_sendTransaction', 1, Hash32::class, $data);\n }", "public static function createPaymentAddress() {\n $url = self::$username.':'.self::$password.'@'.self::$address.':'.self::$port.'/';\n self::$rpcClient = new jsonRPCClient($url, self::$debug);\n \n self::$emercoin_info = self::$rpcClient->getinfo();\n \n if(!is_callable(self::$get_order_id)) {\n throw new Exception('Property self::$get_order_id must be callable');\n }\n $account = self::$account_prefix.'_'.call_user_func(self::$get_order_id);\n return self::$rpcClient->getaccountaddress($account);\n }", "public function signrawtransaction($hex, $transactions = null, $privkey = null){\n return isset($transactions) ? $this->bitcoin->signrawtransaction($hex, $transactions, $privkey) : $this->bitcoin->signrawtransaction($hex);\n }", "public function send($message);", "public function send($message);", "public function send($message);", "public function send($message);", "function pay($refNumber, $amount, $currency, $transactionID = \"\", $locale = \"en\") {\n\t\t\t\n\t\t\tif (empty($refNumber) || empty($amount) || empty($currency)) {\n\t\t\t\techo \"[ERROR] refNumber, amount and currency is REQUIRED\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userAddress)) {\n\t\t\t\techo \"[ERROR] Please set userAddress\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userCity)) {\n\t\t\t\techo \"[ERROR] Please set userCity\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userEmail)) {\n\t\t\t\techo \"[ERROR] Please set userEmail\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userFirstName)) {\n\t\t\t\techo \"[ERROR] Please set userFirstName\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userLastName)) {\n\t\t\t\techo \"[ERROR] Please set userLastName\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\t\n\t\t\tif (empty($transactionID)) {\n\t\t\t\t$transactionID = uniqid();\n\t\t\t}\n\t\t\t\n\t\t\t$url = \"https://testsecureacceptance.cybersource.com/pay\";\n\t\t\tif($this->isLive) {\n\t\t\t\t$url = \"https://secureacceptance.cybersource.com/pay\";\n\t\t\t}\n\t\t\t\n\t\t\t$arr = array(\n\t\t\t\t'access_key' => $this->accessKey,\n\t\t\t\t'profile_id' => $this->profileID,\n\t\t\t\t'locale' => $locale,\n\t\t\t\t'transaction_uuid' => $transactionID,\n\t\t\t\t'signed_field_names' => $this->signVariables,\n\t\t\t\t'unsigned_field_names' => $this->unsign,\n\t\t\t\t'signed_date_time' => gmdate(\"Y-m-d\\TH:i:s\\Z\"),\n\t\t\t\t'transaction_type' => \"sale\",\n\t\t\t\t'reference_number' => $refNumber,\n\t\t\t\t'auth_trans_ref_no' => $refNumber,\n\t\t\t\t'merchant_descriptor' => \"Pixil\",\n\t\t\t\t'amount' => $amount,\n\t\t\t\t'currency' => strtoupper($currency),\n\t\t\t\t'bill_to_address_city' => $this->userCity,\n\t\t\t\t'bill_to_address_country' => $this->userCountry,\n\t\t\t\t'bill_to_email' => $this->userEmail,\n\t\t\t\t'bill_to_address_line1' => $this->userAddress,\n\t\t\t\t'bill_to_forename' => $this->userFirstName,\n\t\t\t\t'bill_to_surname' => $this->userLastName,\n\t\t\t\t'bill_to_address_line2' => \"\",\n\t\t\t\t'bill_to_address_state' => \"\",\n\t\t\t\t'bill_to_address_postal_code' => \"\",\n\t\t\t\t'bill_to_phone' => \"\"\n\t\t\t);\n\t\t\t\n\t\t\tif (!empty($this->mdd1)) {\n\t\t\t\t$arr['merchant_defined_data1'] = $this->mdd1;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data1\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd2)) {\n\t\t\t\t$arr['merchant_defined_data2'] = $this->mdd2;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data2\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd3)) {\n\t\t\t\t$arr['merchant_defined_data3'] = $this->mdd3;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data3\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd4)) {\n\t\t\t\t$arr['merchant_defined_data4'] = $this->mdd4;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data4\";\n\t\t\t}\n\t\t\t\n\t\t\t$signature = $this->sign($arr);\n\t\t\t\n\t\t\t$html = \"<html><head></head><body><form action='$url' method='post'/>\"; \n\t\t\tforeach($arr as $key => $value) {\n\t\t\t\t$html .= \"<input type='hidden' name='$key' value='$value' />\";\n\t\t\t}\n\t\t\t\n\t\t\t$html .= \"<input type='hidden' name='signature' value='$signature' />\";\n\t\t\t\n\t\t\t$html .= \"</form>\";\n\t\t\t$html .= \"<script type='text/javascript'>\";\n\t\t\t$html .= \"setTimeout(function() { document.forms[0].submit(); }, 2000);\";\n\t\t\t$html .= \"</script>\";\n\t\t\t$html .= \"</body>\";\n\t\t\techo $html;\n\t\t}", "public function getAccount($bitcoinaddress);", "public function sendPaymentNotification(){\n\n $sms_recipients=\"0712345648\";//empty string\n $username = Constants::$username;\n $apiKey = Constants::$apiKey;\n $from = Constants::$from;\n // dd($apiKey);\n\n $AT = new AfricasTalking($username, $apiKey);\n // // Get one of the services\n $recipients=\"\";\n $sms = $AT->sms();\n //user has a valid mobile number\n $phone = substr($sms_recipients,1);\n $recipients='+254'.$phone;//$data['phone'];//'+254712345678'\n // dd($recipients);\n\n // // Set the numbers you want to send to in international format\n \n // // Set your message\n $message = \"Testing SMS.\";\n\n // // Set your shortCode or senderId\n \n // Get one of the services\n try {\n // Thats it, hit send and we'll take care of the rest\n $result = $sms->send([\n 'to' => $recipients,\n 'message' => $message,\n 'from' => $from\n ]);\n\n print_r($result);\n \n } catch (Exception $e) {\n //echo \"Error: \".$e->getMessage();\n $result=$e->getMessage();\n print_r($result);\n }\n\n \n }", "public function testAddSignature()\n {\n $data = array(\n 'foo' => 'baa'\n );\n\n $transaction = $this->client->transaction()->addSignature(655, $data);\n $this->assertEquals($data, get_object_vars($transaction->post), 'Passed variables are not correct');\n $this->assertEquals('POST', $transaction->request_method, 'The PHP Verb Is Incorrect');\n $this->assertEquals('/transactions/655/signature/capture', $transaction->path, 'The path is incorrect');\n\n }", "function sendSingleUnicode($username, $encryp_password, $senderid, $messageUnicode, $mobileno, $deptSecureKey) {\n $finalmessage = string_to_finalmessage(trim($messageUnicode));\n $key = hash('sha512', trim($username) . trim($senderid) . trim($finalmessage) . trim($deptSecureKey));\n $data = array(\n \"username\" => trim($username),\n \"password\" => trim($encryp_password),\n \"senderid\" => trim($senderid),\n \"content\" => trim($finalmessage),\n \"smsservicetype\" => \"unicodemsg\",\n \"mobileno\" => trim($mobileno),\n \"key\" => trim($key)\n );\n $result= post_to_url_unicode(\"https://msdgweb.mgov.gov.in/esms/sendsmsrequest\", $data); //calling post_to_url_unicode to send single unicode sms \n return $result;\n}", "public static function amazon_cf_sign($string = '')\n\t\t{\n\t\t\t$cfc['secret_key'] = $s3c['secret_key'] = $GLOBALS['WS_PLUGIN__']['s2member']['o']['amazon_s3_files_secret_key'];\n\n\t\t\treturn c_ws_plugin__s2member_utils_strings::hmac_sha1_sign((string)$string, ($cfc['secret_key'] = $s3c['secret_key']));\n\t\t}", "public function signMessage(Swift_Message $message)\n {\n if (null === $this->signCertificate && null === $this->encryptCert) {\n return $this;\n }\n\n // Store the message using ByteStream to a file{1}\n // Remove all Children\n // Sign file{1}, parse the new MIME headers and set them on the primary MimeEntity\n // Set the singed-body as the new body (without boundary)\n\n $messageStream = new Swift_ByteStream_TemporaryFileByteStream();\n $this->toSMimeByteStream($messageStream, $message);\n $message->setEncoder(Swift_DependencyContainer::getInstance()->lookup('mime.rawcontentencoder'));\n\n $message->setChildren(array());\n $this->streamToMime($messageStream, $message);\n }", "public function codeCadastro($cod,$phone){\n try{\n\n $client = SnsClient::factory(array(\n 'region' => 'us-east-1',\n 'version' => 'latest',\n 'credentials' => array(\n 'key' => $this->config->item('aws_key'),\n 'secret' => $this->config->item('aws_secret')\n )\n ));\n\n //Mensagem em massa para todos do topico\n \n // $payload = [\n // 'TopicArn' => 'arn:aws:sns:us-east-1:630580470294:connectmoney',\n // 'Message' => 'Seu codigo de validação da conta Connect Money: '.$message,\n // 'MessageStructure' => 'string',\n // 'MessageAttribute' => [\n // 'AWS.SNS.SMS.SenderID' => [\n // 'DataType' => 'String',\n // 'StringValue' => 'Sender',\n // ],\n // 'AWS.SNS.SMS.SMSType' => [\n // 'DataType' => 'String',\n // 'StringValue' => 'Transactional',\n // ]\n // ]\n // ];\n\n $message = [\n 'Message' => 'Seu codigo de validação da conta Connect Money: '. $cod,\n 'MessageAttributes' => [\n 'AWS.SNS.SMS.SenderID' => [\n 'DataType' => 'String',\n 'StringValue' => 'Sender',\n ],\n 'AWS.SNS.SMS.SMSType' => [\n 'DataType' => 'String',\n 'StringValue' => 'Transactional',\n ]\n ],\n 'MessageStructure' => 'string',\n 'PhoneNumber' => (string) '+55'.$phone,\n 'Subject' => 'Codigo de validação',\n // 'TargetArn' => '<string>',\n // 'TopicArn' => '<string>',\n ];\n\n $this->subsFone($phone);\n \n // $subarn = $result['SubscriptionArn']; //retorno da identificação do usuario na lista\n $client->publish($message);\n\n return true;\n\n }catch(AwsException $e){\n\n return false;\n }\n \n //Desinscrever \n // $result = $client->unsubscribe(array(\n // 'SubscriptionArn' => $subarn,\n // ));\n }", "function globalTransfer($fromAddress,$toAddress,$toGroup,$amount,$fromBalance,$private){\n\t\n\t// Request the root now:\n\tglobal $thisEntity;\n\t\n\t// Get the from group:\n\t$fromGroup=$thisEntity['Group'];\n\t\n\t// Build the signed data:\n\t$signed=$fromGroup.'/'.$fromAddress.'-'.$toGroup.'/'.$toAddress.'-'.$amount.'-'.$fromBalance;\n\t\n\t// Sign it:\n\t$signature=base64_encode( sign($signed,$private) );\n\t\n\t// Call the root API:\n\t$error;\n\t$response=callRoot(\n\t\t'transfer/create',\n\t\t'{\"from\":{\"address\":\"'.$fromAddress.'\",\"group\":'.$fromGroup.',\"balance\":'.$fromBalance.'},\"to\":{\"address\":\"'.$toAddress.'\",\"group\":'.$toGroup.'},\"amount\":'.$amount.',\"signature\":\"'.$signature.'\"}',\n\t\t$error\n\t);\n\t\n\tif($error){\n\t\t\n\t\t// Remote server generated an error:\n\t\terror('remote/error',$error);\n\t\t\n\t}\n\t\n\t// Success!\n\treturn true;\n\t\n}", "function sendMessage($to, $message) {\n\trequire 'lib/Services/Twilio.php';\n\n\t// Twilio REST API version\n\t$version = \"2010-04-01\";\n\n\t// Set our Account SID and AuthToken\n\t$sid = 'ACf8a0a193958a8a46f2dbb700d73efa13';\n\t$token = '0e5008a58d3d5d02cb188c41706e95a0';\n\n\t// A phone number you have previously validated with Twilio\n\t$phonenumber = '12345423138';\n\n\t//to number\n \t$tonum = \"+1\" . $to;\n\n\t// Instantiate a new Twilio Rest Client\n\t$client = new Services_Twilio($sid, $token, $version);\n\n\ttry {\n\t\t// Initiate a new outbound call\n\t\t$call = $client->account->messages->sendMessage(\n\t\t\t$phonenumber, // The number of the phone initiating the call\n\t\t\t$tonum, // The number of the phone receiving call\n\t\t\t$message\n\t\t);\n\t\techo 'Sent message: ';\n\n\n\t} catch (Exception $e) {\n\t\techo 'Error: ' . $e->getMessage();\n\t}\n\n}", "function sendMessageToNumber($number, $message, $client, $myNumber) {\n if ($number != \"\" && $number != NULL && strlen($number) >= 10) {\n $client->account->messages->create(array( \n 'To' => $number, \n 'From' => $myNumber, \n 'Body' => $message, \n ));\n }\n else {\n \n echo \"Cannot send number to null or blank number\";\n }\n}", "function send($mobile, $message);", "public function send(string $code, Authenticatable $user);", "private function _sign_signature_v4($bodyParams)\n\t{\n $ldt = gmdate(self::ISO8601_BASIC);\n $sdt = substr($ldt, 0, 8);\n $parsed = [\n 'method' => 'POST',\n 'path' => '/',\n 'query' => [],\n\t\t\t'uri' => 'https://email.' . $this->region . '.amazonaws.com/',\n 'headers' => [\n\t\t\t\t\t\t\t'host' => ['email.' . $this->region . '.amazonaws.com'],\n\t\t\t\t\t\t\t'x-amz-date' => [date(DATE_RSS)],\n\t\t\t\t\t\t\t],\n 'body' => $bodyParams,\n 'version' => 'HTTP/1.1'\n ];\n\t\t$cs = $this->createScope($sdt, $this->region, $this->service);\n\t\t$this->credentialScope = $cs;\n\t\t$payload = http_build_query($bodyParams); \n\n $context = $this->createContext($parsed, hash('sha256', $payload));\n\t\t$toSign = $this->createStringToSign($ldt, $cs, $context['creq']);\n\n $signingKey = $this->getSigningKey(\n $sdt,\n \\Config::get('ses.region'),\n 'ses',\n \\Config::get('ses.secret_key')\n\t\t);\n\t\t\n\t\t$signature = hash_hmac('sha256', $toSign, $signingKey);\n\t\t$accessKey = \\Config::get('ses.access_key');\n $parsed['headers']['Authorization'] = [\n \"AWS4-HMAC-SHA256 \"\n . \"Credential={$accessKey}/{$cs}, \"\n . \"SignedHeaders=host;x-amz-date, Signature={$signature}\"\n\t\t];\n\t\t\n\t\treturn implode(\"\", $parsed['headers']['Authorization']);\n\t}" ]
[ "0.76057386", "0.7505878", "0.65823424", "0.6364055", "0.6236817", "0.6050126", "0.5917151", "0.5717793", "0.5629704", "0.55978113", "0.5560777", "0.55567056", "0.5469905", "0.5459014", "0.54527503", "0.5386694", "0.53573", "0.5350591", "0.5318136", "0.5248519", "0.52441514", "0.5236982", "0.52230823", "0.5190303", "0.51495916", "0.5134808", "0.51260173", "0.5117847", "0.5117595", "0.5115794", "0.5073219", "0.50574505", "0.50484985", "0.50277716", "0.5004815", "0.5002295", "0.4994945", "0.49735266", "0.49712238", "0.49706644", "0.49595767", "0.49433544", "0.49350223", "0.49330026", "0.49074662", "0.4902427", "0.48972863", "0.4893571", "0.48850104", "0.4880265", "0.48402053", "0.48283306", "0.48215926", "0.48103923", "0.48030186", "0.4788549", "0.47883868", "0.4776414", "0.47729987", "0.47537485", "0.4741487", "0.47293562", "0.47044972", "0.46927738", "0.46850845", "0.46848533", "0.46755806", "0.4669205", "0.4666638", "0.46609923", "0.46581572", "0.46578312", "0.46559286", "0.46535328", "0.46384442", "0.46370065", "0.46366283", "0.46322146", "0.46297255", "0.4627042", "0.46179906", "0.46176147", "0.46161234", "0.46161234", "0.46161234", "0.46161234", "0.46140575", "0.4611009", "0.4588048", "0.45873496", "0.45820114", "0.45788044", "0.45755982", "0.45733413", "0.4572831", "0.45722994", "0.4568728", "0.45601073", "0.4557917", "0.45564058" ]
0.681819
2
estimates the fee for sending confirmed and unconfirmed funds from the given payment address confirmed funds are sent first if they are available
public function estimateFee($priority, $payment_address_id, $destination, $quantity, $asset, $dust_size=null) { return $this->estimateFeeFromAccount($priority, $payment_address_id, $destination, $quantity, $asset, 'default', true, $dust_size); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function calculate_fee() {\n // Only delivery incurs a fee\n if ($this->type == 'delivery') {\n if ($this->distance > $this->Seller->Delivery->free_distance) {\n if ($this->Seller->Delivery->pricing_rate == 'per-mile') {\n $fee = number_format($this->Seller->Delivery->fee * ($this->distance - $this->Seller->Delivery->free_distance), 0);\n } else {\n $fee = number_format($this->Seller->Delivery->fee, 0);\n }\n } \n }\n \n // For everything else, charge $0 (and check for non-chargeable values)\n $this->fee = ((isset($fee) && $fee >= 1) ? $fee : 0);\n\n $this->update([\n 'fee' => $this->fee\n ]);\n }", "protected function _addPaymentFeeLine()\n {\n if (Mage::helper('core')->isModuleEnabled('Afterpay_Afterpayfee'))\n {\n $paymentFee = (float) $this->_order->getAfterpayfeeAmount();\n \n if (!empty($paymentFee)) {\n $paymentFeeLine = array(\n 'articleDescription' => Mage::getStoreConfig('afterpay/afterpay_afterpayfee/afterpayfee_label', $this->_order->getStoreId()),\n 'articleId' => 'FEE',\n 'unitPrice' => round($paymentFee * 100, 0),\n 'vatCategory' => 1,\n 'quantity' => 1,\n );\n \n return $paymentFeeLine;\n }\n }\n \n // Check if Fooman Surcharge is used for service fee\n if (Mage::helper('core')->isModuleEnabled('Fooman_Surcharge'))\n {\n $paymentFee = $this->_order->getFoomanSurchargeAmount() + $this->_order->getFoomanSurchargeTaxAmount();\n \n if (!empty($paymentFee)) {\n $paymentFeeLine = array(\n 'articleDescription' => $this->_order->getFoomanSurchargeDescription(),\n 'articleId' => 'FEE',\n 'unitPrice' => round($paymentFee * 100, 0),\n 'vatCategory' => 1,\n 'quantity' => 1,\n );\n \n return $paymentFeeLine;\n }\n }\n \n // Check if Mageworx Multifees is used for service fee\n if (Mage::helper('core')->isModuleEnabled('MageWorx_MultiFees'))\n {\n $paymentFee = (float) ($this->_order->getMultifeesAmount());\n \n if (!empty($paymentFee)) {\n $paymentFeeLine = array(\n 'articleDescription' => 'Extra kosten',\n 'articleId' => 'FEE',\n 'unitPrice' => round($paymentFee * 100, 0),\n 'vatCategory' => 1,\n 'quantity' => 1,\n );\n \n return $paymentFeeLine;\n }\n }\n \n return false;\n }", "function edd_wallet_add_funds( $payment_id ) {\n\t$fees = edd_get_payment_fees( $payment_id );\n\n\tif( $fees && count( $fees ) == 1 ) {\n\t\tif( $fees[0]['id'] == 'edd-wallet-deposit' ) {\n\n\t\t\t// Disable purchase receipts... we send our own emails\n\t\t\tremove_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999 );\n\n\t\t\t// Send our custom emails\n\t\t\tedd_wallet_send_email( 'user', $payment_id );\n\n\t\t\t// Get the ID of the purchaser\n\t\t\t$user_id = edd_get_payment_user_id( $payment_id );\n\n\t\t\t// Deposit the funds\n\t\t\tedd_wallet()->wallet->deposit( $user_id, $fees[0]['amount'], 'deposit', $payment_id );\n\n\t\t\t// Tag the payment so we can find it later\n\t\t\tedd_update_payment_meta( $payment_id, '_edd_wallet_deposit', $user_id );\n\t\t}\n\t}\n}", "function dsf_send_sagepay_mail($savedorder, $address_confirmations=''){\nglobal $basket, $customer_id, $payment, $currencies;\n\n\t\t\t\t\t$good_mail_id = '3';\n\t\t\t\t\t$bad_mail_id = '6';\n\n\n\t\t\t\t\tif ($address_confirmations == 'OK'){ // status OK and addresses OK\n\t\t\t\t\t\t\n\t\t\t\t\t\t$email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $good_mail_id .\"'\");\n\t\t\t\t\t }elseif (MODULE_PAYMENT_PROTXCC_CHECK_ADDRESS == 'false'){\n\t\t\t\t\t\t$email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $good_mail_id .\"'\");\n\t\t\t\t\t}elseif ($address_confirmations == 'ALLOW'){ // status OK Adress failed under threshold.\n\t\t\t\t\t\t$email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $good_mail_id .\"'\");\n\t\t\t\t\t }else{\n\t\t\t\t\t $email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $bad_mail_id .\"'\");\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\n// lets start with the email confirmation\n\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t$email_details = dsf_db_fetch_array($email_query);\n\t\t\t\t\t\t\t\t\t\t$signature_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='1'\");\n\t\t\t\t\t\t\t\t\t $signature_details = dsf_db_fetch_array($signature_query);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_subject = $email_details['subject'];\n\t\t\t\t\t\t\t\t\t $email_footer = $signature_details['details'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// overwrite subject as per Christian emails 2011-09-28\n\t\t\t\t\t\t\t\t\t $email_subject = TRANSLATION_EMAIL_YOUR_ORDER . ' ' . SAP_ORDER_PREFIX . $savedorder->info['id'];\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// plain text;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order = TRANSLATION_WORD_DEAR . ' ' . $savedorder->customer['name'] . \"\\n\\n\" . $email_details['details'] . \"\\n\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t// get products ordered by doing email function.\n\t\t\t\t\t\t\t\t\t $products_ordered = dsf_order_email_items($savedorder, 'true');\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order .= $products_ordered['plain'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order .= \"\\n\" .EMAIL_SEPARATOR .\"\\n\" . $email_footer;\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \t\t// html\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $html_order = TRANSLATION_WORD_DEAR . ' ' . $savedorder->customer['name'] . \"<br /><br />\";\n\t\t\t\t\t\t\t\t\t $html_order .= $email_details['details'] . \"<br /><br />\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $html_order .= $products_ordered['html'] . '<br /><br />';\n\t\t\t\t\t\t\t\t\t $html_order .= $email_footer;\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order = str_replace(\"[ORDER_NUMBER]\" , SAP_ORDER_PREFIX . $savedorder->info['id'], $email_order);\n\t\t\t\t\t\t\t\t\t $html_order = str_replace(\"[ORDER_NUMBER]\" , SAP_ORDER_PREFIX . $savedorder->info['id'], $html_order);\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t // end of email.\n\t\t\t\t\t\t \n\n\n \n\t\t\t\t\t dsf_send_email($savedorder->customer['name'], $savedorder->customer['email_address'], $email_subject, $email_order, STORE_OWNER, EMAIL_FROM,$html_order);\n\t\t\t\t\t\n\t\t\t\t\t// send emails to other people\n\t\t\t\t\t if (SEND_EXTRA_ORDER_EMAILS_TO != '') {\n\t\t\t\t\t\tdsf_send_email(STORE_OWNER, SEND_EXTRA_ORDER_EMAILS_TO, $email_subject, $email_order, STORE_OWNER, EMAIL_FROM,$html_order);\n\t\t\t\t\t }\n\n\n\t\t\t\t\t// send emails to other people\n\t\t\t\t\t if (SEND_EXTRA_ORDER_EMAILS_DUPLICATE != '') {\n\t\t\t\t\t\tdsf_send_email(STORE_OWNER, SEND_EXTRA_ORDER_EMAILS_DUPLICATE, $email_subject, $email_order, STORE_OWNER, EMAIL_FROM,$html_order);\n\t\t\t\t\t }\n\n\n\n\n\n// just for consistancy.\n\nreturn true;\n\n\n\n\n}", "public function askForFeeConfirmation()\n {\n }", "function compute_withdrawing_fee($amount)\n{\n $fee = 0;\n if (!is_null($amount) && $amount > 0)\n {\n if ($amount < 20000)\n {\n $fee = 1;\n }\n else if ($amount < 50000)\n {\n $fee = 3;\n }\n else\n {\n $fee = 5;\n }\n }\n return $fee;\n}", "function tranferFounds($project_id, $returnTotal=false, $adaptivepayments_pay = true) {\n\n App::import('Vendor', 'paypal');\n $this->Paypal = new Paypal();\n\n\n $this->recursive = -1;\n $sponsorships = $this->find('all', array('conditions' => array('Sponsorship.project_id' => $project_id)));\n\n $tranferredSponsorships = array();\n $total = 0;\n foreach ($sponsorships as $sponsorship) {\n $sponsorship_id = $sponsorship[$this->alias]['id'];\n if ($this->getPaymentType($sponsorship) == EXPRESSCHECKOUT) { // all of these payments are already on our paypal account, no tenemos que hacer nada.\n if ($this->isTransferred($sponsorship, EXPRESSCHECKOUT)) { // se marco como trasferido ? \n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } else {\n $transactionId = $sponsorship[$this->alias]['expresscheckout_transaction_id'];\n if (!empty($transactionId)) {\n $response = $this->Paypal->hashCall('GetTransactionDetails', array('TRANSACTIONID' => $transactionId));\n if ($this->updateExpressCheckoutStatus($sponsorship_id, $transactionId)) {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n }\n }\n }\n } elseif ($this->getPaymentType($sponsorship) == PREAPPROVAL) {\n if ($this->isTransferred($sponsorship, PREAPPROVAL)) { // se marco como trasferido ? \n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } else {\n $preapproval_key = $sponsorship[$this->alias]['preapproval_key'];\n if ($this->updatePreApprovalStatus($sponsorship_id, $preapproval_key)) { // actualizamos el pago | si esta activo ....\n $transferred = true;\n $sponsorship = $this->read(null, $sponsorship_id);\n if (!$this->isTransferred($sponsorship, PREAPPROVAL)) {\n // transferimos el pago a groofi $transferred = true ;\n if ($adaptivepayments_pay == true && $this->adaptivepayments_pay($sponsorship)) { //\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } elseif ($adaptivepayments_pay == false) {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n }\n } else {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n $sponsorship[$this->alias]['internal_status'] = SPONSORSHIP_TRANSFERRED;\n $sponsorship[$this->alias]['transferred'] = 1;\n $this->save($sponsorship);\n }\n }\n }\n }\n }\n return $returnTotal ? $total : $tranferredSponsorships;\n }", "function get_transaction_fee($amount)\n\t{\n\t\treturn round(0.25+0.034*$amount,2);\n\t}", "public static function confirmPayment() {\n $url = self::$username.':'.self::$password.'@'.self::$address.':'.self::$port.'/';\n self::$rpcClient = new jsonRPCClient($url, self::$debug);\n \n self::$emercoin_info = self::$rpcClient->getinfo();\n \n if(!is_callable(self::$get_order_id)) {\n throw new Exception('Property self::$get_order_id must be callable');\n }\n $account = self::$account_prefix.'_'.call_user_func(self::$get_order_id);\n \n if(!is_callable(self::$get_order_ammount)) {\n throw new Exception('Property self::$get_order_ammount must be callable');\n }\n $order_ammount = call_user_func(self::$get_order_ammount);\n \n \n\t\ttry {\n $received_amount = self::$rpcClient->getreceivedbyaccount($account,0);\n\t\t} catch (Exception $e) {\n\t\t\techo false;\n\t\t}\n \n\t\t//if((float)$received_amount >= (float)$order_ammount) {\n \n //Comparing two floats with epsilon (http://php.net/manual/en/language.types.float.php)\n $epsilon = 0.0000001; // 1 Satoshi\n if((float)$order_ammount - (float)$received_amount < $epsilon) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n }", "function deliveryFee($rID, $subtotal, $tip, $date_time, $addr) {\n $_errors = array();\n \n if (!preg_match('/^\\d+/$', $rID)) {\n $_errors[] = \"Restaurant DeliveryFee - Validation - Restaurant ID (invalid, must be integer) (\" . $rID . \")\";\n }\n \n if(!preg_match('/^\\d*(\\.\\d{2})?$/', $subtotal) && $subtotal != '') {\n $_errors[] = \"Restaurant DeliveryFee - Validation - Subtotal (invalid, must be numeric) (\" . $subtotal . \")\";\n }\n \n if(empty($tip)) {\n $tip = 0;\n }\n elseif(!preg_match('/^\\d*\\.\\d{2}$/', $tip) && $tip != '') {\n $_errors[] = \"Restaurant DeliveryFee - Validation - Tip (invalid, must be numeric) (\" . $tip . \")\";\n }\n \n try {\n $addr->validate();\n } catch (OrdrinExceptionBadValue $ex) {\n $_errors[] = $ex.__toString();\n }\n \n if(!empty($_errors)) {\n throw new OrdrinExceptionBadValue($_errors);\n }\n \n $dt = $this->format_datetime($date_time);\n\n return $this->_call_api(\"GET\",\n array(\n \"fee\",\n $rID,\n $subtotal,\n $tip,\n $dt,\n $addr->zip,\n $addr->city,\n $addr->street\n )\n );\n }", "public function getMyFeesEstimate($request);", "public function assess_late_fees() {\n // Setup finance_charge record.\n $late_charge = ORM::factory('finance_charge');\n $data = array(\n 'title' => sprintf('Late Fee: %s', $this->title),\n 'due' => date::to_db(),\n 'site_id' => $this->site_id,\n 'user_id' => $this->user_id,\n 'amount' => $this->late_fee_type == 'percent' ? number_format($this->amount * $this->late_fee / 100, 2) : $this->late_fee, // Fix to use percentage as well.\n 'budget_id' => $this->budget_id,\n 'deposit_account_id' => $this->deposit_account_id\n );\n $late_charge->validate($data, TRUE);\n \n // Assess charge to the individual members.\n foreach ($this->finance_charge_members as $member_charge) {\n $charge = ORM::factory('finance_charge_member');\n $data = array(\n 'finance_charge_id' => $late_charge->id,\n 'site_id' => $this->site_id,\n 'user_id' => $member_charge->user_id,\n 'amount' => $this->late_fee_type == 'percent' ? number_format($member_charge->balance() * $this->late_fee / 100, 2) : $this->late_fee, \n );\n $charge->validate($data, TRUE);\n }\n \n // Send out emails to all members who have received the late fee.\n $late_charge->notify_members();\n \n // Update late_fee_assessed record so we don't assess this late fee again.\n $this->late_fee_assessed = TRUE;\n $this->save();\n }", "public function test_get_sbps_purchase_fee_and_payment_request($carriers, $codes, $from, $to)\n {\n /** @var \\CI_DB_result $query */\n $sql = sprintf(<<<EOF\nSELECT order_detail.id\nFROM order_detail JOIN\n order_settlement ON order_detail.id = order_settlement.order_detail_id JOIN\n contract_order ON contract_order.id = order_detail.contract_order_id JOIN\n contract ON contract.id = contract_order.contract_id\nWHERE contract.`disable` = %3\\$d AND\n contract_order.`disable` = %3\\$d AND\n order_detail.`disable` = %3\\$d AND\n order_settlement.`disable` = %3\\$d AND\n contract.contract_status_id <> %5\\$d AND\n contract_order.order_type_code %1\\$s AND\n order_settlement.settlement_type_id %2\\$s AND\n order_detail.authorize_status = %4\\$d\nEOF\n , $this->transformInEqual($codes)\n , $this->transformInEqual($carriers)\n , self::STATUS_ENABLE\n , Sbps::AUTHORIZE_STATUS_BEFORE_CHECK_CREDIT_LIMIT\n , $this->getContractStatus());\n\n $sql .= $this->transformDate('order_settlement.settlement_plan_date', ['from' => $from, 'to' => $to]);\n $query = $this->CI->db->query($sql);\n $collection = $query->row_array();\n $query->free_result();\n\n /** @var array $actual */\n $query = $this->CI->contract->get_sbps_purchase_fee_and_payment_request($carriers, $codes, $from, $to);\n $actual = $query->row_array();\n $query->free_result();\n\n $this->assertInstanceOf('CI_DB_result', $query);\n $this->assertEquals($collection, $actual);\n }", "function pay_on_credit_apply_interest_fee() {\n\n $payment_method = WC()->session->get('chosen_payment_method');\n $payment_duration = WC()->session->get('chosen_payment_duration');\n \n \n\n if ( $payment_method === \"wcpg-pay-on-credit\" ) {\n $label = __( 'Interest Fee', 'wcpg-pay-on-credit' );\n $amount = 0;\n\n switch ($payment_duration) {\n case '4':\n $percentage = 0.05;\n $amount = ( WC()->cart->cart_contents_total + WC()->cart->shipping_total ) * $percentage;\n break;\n\n case '6':\n $percentage = 0.1;\n $amount = ( WC()->cart->cart_contents_total + WC()->cart->shipping_total ) * $percentage;\n break; \n \n default:\n # code...\n break;\n }\n\n WC()->cart->add_fee( $label, $amount, false, '' );\n }\n \n \n}", "private function _calculatePaymentFee(): int\n {\n $paymentFee = 0;\n if ($this->paymentMethod === 'paypal' && $_COOKIE['currency'] == 'EUR') {\n $paymentFee = 45;\n }\n\n return $paymentFee;\n }", "public static function chargeFees($price=1)\n {\n\n }", "function submitCreditFee($user_id, $type, $comments, $total, $date = null) {\n global $BoL_enabled;\n\tif (is_null($date)) $date = time();\n\tif (!is_numeric($user_id)) die('submitCreditFee: Non-Numeric User-ID');\n\tif ($type != 'c' && $type != 'f') die('submitCreditFee: Invalid Type, For Orders use submitOrder');\n\tif (!is_numeric($total)) die('submitCreditFee: Non-Numeric Amount');\n\tif (!is_numeric($date)) die('submitCreditFee: Invalid Date Format, Use UNIX Epoch');\n\t$values = array();\n\t$values['ordered'] = date('Y-m-d G:i:s',$date);\n\t$values['user'] = $user_id;\n\t$values['type'] = $type;\n\t$sql = \"SELECT snapshot FROM users WHERE ID = '\".$user_id.\"'\";\n\t$query = mysql_query($sql);\n\tcheckDBError($sql);\n\tif($result = mysql_fetch_assoc($query)) {\n\t\t$values['snapshot_user'] = $result['snapshot'];\n\t}\n if ($type==\"c\" && $total>=0)\n $total = $total-$total-$total; // make negative\n if ($type==\"f\")\n $total = abs($total);\n\t$values['total'] = $total;\n\t$values['comments'] = $comments;\n\t$values['processed'] = 'Y';\n\t$values['process_time'] = date('Y-m-d G:i:s');\n\t$sql = buildInsertQuery(\"order_forms\", $values, true);\n\tmysql_query($sql);\n\tcheckDBError($sql);\n\t$po_id = mysql_insert_id();\n\t$po = $po_id + 1000;\n\tif ($values['type'] == 'f') { // If it's a fee\n\t\t$sql = \"SELECT email, email2, email3 FROM users WHERE ID=\".$user_id;\n\t\t$query = mysql_query($sql);\n\t\tcheckDBError($sql);\n\t\tif ($result = mysql_fetch_array($query)) {\n\t\t\t$email = $result[0];\n\t\t\t$email2 = $result[1];\n\t\t\t$email3 = $result[2];\n\t\t} else {\n\t\t\tunset($email);\n\t\t\tunset($email2);\n\t\t\tunset($email3);\n\t\t}\n\t\t$msg =\n\t\t\"This is a bill; please retain for your records.\\n\\n\".\n\n\t\t\"Do not reply to this e-mail, contact your Dealer Support Person for any issues associated with this Bill.\\n\\n\".\n\n\t\t\"-----------------------------------------------------------\\n\";\n\n\t\t$body = OrderForEmail($po,'D');\n\t\t$msg .= $body;\n\n\t\t$subject = date( \"m/d/Y\", $date).\" Bill\";\n\t\t$headers = \"From: RSS Orders <orders@retailservicesystems.com>\";\n\t\tif ($email2 <> \"\") $headers .= \"\\nCc: \".$email2;\n\t\tif ($email3 <> \"\") $headers .= \"\\nCc: \".$email3;\n\t\t$headers .= \"\\nBcc: orders@retailservicesystems.com\";\n\t\tsendmail($email, $subject, $msg, $headers);\n\t}\n\treturn $po;\n}", "public function finance(int $value, int $paymentsRemaining, $paymentValue): float;", "public function estimateTransactionFee(int $inputs, int $outputs, $amount = 0, int $minConf = null);", "protected function calcStateFee(float $debt = 0)\n {\n $stateFee = $debt / 100 * 13;\n $stateFee = number_format($stateFee,2,'.','');\n return $stateFee;\n }", "public function testSendWithRequestAddressBalance()\n {\n $service = $this->getStubForTest(file_get_contents(__DIR__ . '/TestAsset/Response/address_balance.txt'));\n\n $request = new Request\\AddressBalance();\n $request->setAddress('efjsdkfjkwefkwejfkesf');\n\n /* @var $response Response\\AddressBalance */\n $response = $service->send($request);\n\n $this->assertEquals(0, $response->getBalance());\n\n $this->assertEquals(\n $this->getLastRawRequestExpected(__DIR__ . '/TestAsset/Request/address_balance.txt'),\n $this->getLastRawRequest($service),\n 'Requests does not match'\n );\n }", "public function sendWithFeeRate($payment_address_id, $destination, $quantity, $asset, $fee_rate='medium', $request_id=null) {\n return $this->sendFromAccount($payment_address_id, $destination, $quantity, $asset, 'default', $_unconfirmed=true, $_fee=null, $_dust_size=null, $request_id, $_custom_inputs=null, $fee_rate);\n }", "public static function getConfirmedReceivedByAddress($address)\n\t{\n\t\t$amount = file_get_contents(\"https://blockchain.info/q/getreceivedbyaddress/$address?confirmations=\" . getenv(\"REQUIRED_CONFIRMATIONS\"));\n\n\t\treturn $amount;\n\t}", "function calculateReferralFee($user_id,$order_details,$transaction_id)\n\t\t{\n\t\t\t//get user details\n\t\t\t$user_details = $this->_BLL_obj->manage_content->getValue_where('user_info','*', 'user_id', $user_id);\n\t\t\tif($user_details[0]['member_level'] != 0)\n\t\t\t{\n\t\t\t\t//getting user rf\n\t\t\t\t$user_level = $this->_BLL_obj->manage_content->getValue_where('member_level_info','*', 'member_level', $user_details[0]['member_level']);\n\t\t\t\tif(!empty($user_level[0]['RF']))\n\t\t\t\t{\n\t\t\t\t\t$ref_fee = ((intval($user_level[0]['RF']) * $order_details[0]['amount']) / 100);\n\t\t\t\t\t//getting user money from money table\n\t\t\t\t\t$user_money = $this->_BLL_obj->manage_content->getLastValue('user_money_info', '*', 'user_id', $user_id, 'id');\n\t\t\t\t\tif(!empty($user_money[0]['total_money']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$user_total_money = $user_money[0]['total_money'] + $ref_fee;\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$user_total_money = $ref_fee;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//insert values to user money info table\n\t\t\t\t\t$column_name_money = array('user_id','specification','earn_money','total_money');\n\t\t\t\t\t$column_value_money = array($user_id,$transaction_id,$ref_fee,$user_total_money);\n\t\t\t\t\t$insert_money = $this->_BLL_obj->manage_content->insertValue('user_money_info', $column_name_money, $column_value_money);\n\t\t\t\t\t//insert values to user profile info\n\t\t\t\t\t$this->_BLL_obj->increaseGrossAmount($user_id, $ref_fee);\n\t\t\t\t\t\n\t\t\t\t\treturn $ref_fee;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 0;\t\n\t\t\t}\n\t\t}", "public function processShippingAmount($address, $total)\n {\n if ($this->amount->getBaseBalanceForShipping() <= 0) {\n return false;\n }\n\n $shippingAmount = $this->amount->getShippingPrice();\n $baseShippingAmount = $this->amount->getBaseShippingPrice();\n\n if ($baseShippingAmount <= 0) {\n return $this;\n }\n\n $discountAmount = min(\n $shippingAmount,\n $this->amount->getBalanceForShipping()\n );\n $baseDiscountAmount = min(\n $baseShippingAmount,\n $this->amount->getBaseBalanceForShipping()\n );\n\n $address->setGiftcardShippingAmount($discountAmount<0?$discountAmount:-$discountAmount); //negative\n $address->setBaseGiftcardShippingAmount($baseDiscountAmount<0?$baseDiscountAmount:-$baseDiscountAmount); //negative\n\n $total->setShippingGiftcardAmount($discountAmount<0?$discountAmount:-$discountAmount); //negative\n $total->setBaseShippingGiftcardAmount($baseDiscountAmount<0?$baseDiscountAmount:-$baseDiscountAmount); //negative\n\n return $this;\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 }", "function paid_sendEmail_customer($details) {\n\t\t\t\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\n\t\t\t\t$total_amount = $details->checkoutTotal;\n\t\t\t\t $abc = $details->Extra_data->normal_price - $total_amount;\n if($abc < 0){\n $save = '0';\n\n }else{\n $save = number_format($details->Extra_data->normal_price - $total_amount,0);\n\t\t\t\t\t}\n\n\t\t\t\t$id = $details->id;\n\t\t\t\t$itemid = $details->itemid;\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$stars = $details->stars;\n\t\t\t\t$code = $details->code;\n\t\t\t\t$booking_adults = $details->Extra_data->adults;\n\t\t\t\t$child = $details->Extra_data->child;\n\t\t\t\t\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$deposit = $details->subItem->price;\n\t\t\t\t$quantity = $details->subItem->quantity;\n\t\t\t\t$hotel_title = $details->subItem->title;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$sendto = $details->accountEmail;\n\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$HOTEL_NAME = $details->title;\n\t\t\t\t$location = $details->location;\n\t\t\t\t$room_name = $details->subItem->title;\n\t\t\t\t$booking_adults = $details->subItem->booking_adults;\n\t\t\t\t$room_price = $details->subItem->price;\n\t\t\t\t\n\t\t\t\t$checkin = $details->checkin;\n\t\t\t\t\n\t\t\t\t$checkout = $details->checkout;\n\t\t\t\t$couponRate = $details->couponRate;\n\t\t\t\t\n\t\t\t\t$date = date ( \"m/d/Y\" , strtotime ( \"-1 day\" , strtotime ( $details->checkin ) ) );\n\t\t\t\t$no_of_room = $details->subItem->quantity;\n\t\t\t\t$thumbnail = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$details->thumbnail);\n\t\t\t\t$hotel_id = $details->itemid;\n\n\t\t\t\t$guest_name = $details->Extra_data->guest_name;\n\t\t\t\t$guest_age = $details->Extra_data->guest_age;\n\t\t\t\t$chil = $details->Extra_data->child;\n\t\t\t\t$child_name = isset($details->Extra_data->child_name) ? $details->Extra_data->child_name : 0;\n\t\t\t\t$child_age = isset($details->Extra_data->child_age) ? $details->Extra_data->child_age : 0;\n\t\t\t\t\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"\";\n\t\t\t\t\n\t\t\t\t$sendto = $details->accountEmail;\n\t\t\t\t\n\t\t\t\t $ptheme = pt_default_theme();\n\t\t\t\t\t$this->_config = config_item('theme');\n\t\t\t\t\t$uu = $this->_config['url'];\n\t\t\t\t$email_temp_img = $uu.$ptheme.'/email_temp_img/gb_email_temp_img/';\n\t\t\t\t/*$template = $this->shortcode_variables(\"bookingpaidcustomer\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidcustomer\");*/\n\n\t\t\t\t $book_room = $no_of_room;\n \n $room_per_guest = $booking_adults / $book_room;\n \n for ($r_i=0; $r_i < $book_room ; $r_i++) {\n \t$cc = $r_i+1;\n \t$no_top_hotel .= '<li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px;\">\n <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;margin-left: -30px;\">ROOM '.$cc.'</p>\n </li>';\n\t for($g_d_a=0; $g_d_a < $room_per_guest; $g_d_a++){\n\n\t $jj = $g_d_a + $r_i;\n\t $dd = $guest_name[$jj];\n\t $age = $guest_age[$jj];\n\t \n\n\t \t$no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 100%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px; \">\n\t\t <h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$dd.'</h5>\n \t\t<h5 class=\"right\" style=\"float:right;font-size: 16px;color: #0c134f;margin-right: 5px;\">'.$age.' Years</h5>\n\t\t </li>';\n\t }\n }\n\n if($chil > 0){\n\t $no_top_hotel .= ' <li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px; \">\n \t\t\t\t <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;\">CHILD DETAILS</p>\n \t\t\t\t </li>';\n \t for($c_i=0;$c_i<$chil;$c_i++){\n \t \t $ii = $c_i;\n\t \t\t $child_name1 = $child_name[$ii];\n\t \t\t $child_age1= $child_age[$ii];\n \t \t\n \t \t $no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 96%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px;\">\n \t\t\t<h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$child_name1.'</h5>\n \t\t<h5 class=\"right\" style=\"font-size: 16px;color: #0c134f;float: right;margin-right: 5px;\"><img src=\"'.$email_temp_img.'paynow_icon8.png\"> '.$child_age1.' Years</h5>\n \t\t\t</li>';\n \t}\n }\n\n \t$this->db->select('hotel_latitude,hotel_longitude,hotel_desc,hotel_map_city,hotel_stars');\n\t\t \t$this->db->where('hotel_id', $itemid);\n\t\t \t$query = $this->db->get('pt_hotels');\t\n\t\t \t$hotel_data = $query->result();\n\n\t\t \t$star_temp_img = $uu.$ptheme.'/images/';\n\n\t\t\t\t\t/*echo $hotel_data[0]->hotel_stars;*/\n\n\t\t\t\t\t$aaa = '';\n\t\t\t\t\tfor ($st_i=0; $st_i < 5 ; $st_i++) { \n \tif($st_i < $hotel_data[0]->hotel_stars){\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-on.png\">';\n \t}else{\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-off.png\">';\n \t}\n }\n\n\t\t \t$arrayInfo['checkIn'] = date(\"m/d/Y\", strtotime(\"+1 days\"));\n\t\t \t$arrayInfo['checkOut'] = date(\"m/d/Y\", strtotime(\"+2 days\"));\n\t\t \t$arrayInfo['adults'] = '1';\n\t\t \t$arrayInfo['child'] = '';\n\t\t \t$arrayInfo['room'] = '1';\n\t\t \t/*error_reporting(E_ALL);*/\n\t\t \t\t//$this->ci = & get_instance();\n\t\t\t\t\t\t// $this->db = $this->ci->db;\n\t\t\t\t\t$this->load->model('hotels/hotels_model');\n\t\t \t\n\t\t \t$local_hotels = $this->hotels_model->search_hotels_by_lat_lang($hotel_data[0]->hotel_latitude, $hotel_data[0]->hotel_longitude,$arrayInfo);\n\n\t\t \t$top_hotel = '<div class=\"col-sm-12 hotels\">';\n\n\t\t \tfor ($i=0; $i < count($local_hotels['hotels']) ; $i++) { \n\t\t \t\tif($i < 3){\n\t\t \t\t $image = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$bb[$i]->thumbnail);\n\t\t \t\t$bb = $local_hotels['hotels'];\n\t\t \t\t $bb[$i]->title;\n\t\t \t\t$top_hotel .= '<a class=\"col-sm-4\" href=\"'.$bb[$i]->slug.'\" style=\"margin-left: 2%;padding:10px;text-decoration: none; width:27.3333%;float: left; box-sizing: border-box;position: relative;\">';\n\t\t \t\t\t\t\t\tif($image == \"\"){\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$uu.$ptheme.'/email_temp_img/gb_email_temp_img/email-d-lasvegas.png\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$image.'\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<p style=\"text-align:center;margin:0px;color: rgb(12, 19, 79);font-size: 14px;margin: 20px 0 10px;font-family: \\'Roboto\\',sans-serif;\">'.$this->custom_echo($bb[$i]->title, 25).'</p>\n\t\t\t\t\t\t\t\t\t\t\t<h4 style=\" text-align:center;margin:0px; color: rgb(28, 192, 251);font-size: 20px;font-weight: 600;font-family: \\'Roboto\\',sans-serif;\">'.$bb[$i]->currCode.$bb[$i]->price.'</h4>\n\t\t\t\t\t\t\t\t\t\t</a>';\n\t\t \t} \n\t\t }\n\n\t\t \t$map = '<div class=\"col-sm-12 map\" style=\"width: 100%;padding-left: 0;float: left; box-sizing: border-box;min-height: 1px; padding-right:0px; position: relative;\">\n\t\t\t\t\t\t\t\t <a href=\"http://maps.google.com/?daddr={hotel_name}\" target=\"_blank\"> \n <img style=\"width:100%\" border=\"0\" src=\"https://maps.googleapis.com/maps/api/staticmap?center='.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&zoom=14&size=620x260&markers=size:mid%7Ccolor:red%7C'.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&key=AIzaSyAH65sTGsDsP4mMpmbHC8zqRiM1Qh07iL8\" alt=\"Google map\"></a>\n\t\t\t\t\t\t\t</div>';\n\n\t\t\t\t$res = $this->settings_model->get_contact_page_details();\n\t\t\t\t$contact_phone = $res[0]->contact_phone;\n\t\t\t\t$contact_email = $res[0]->contact_email;\n\t\t\t\t$contact_address = $res[0]->contact_address;\n\n\t\t\t\t\n\n\t\t\t\t$template = array(\"{invoice_id}\", \"{hotel_name}\", \"{stars}\", \"{location}\", \"{code}\",\"{invoice_code}\", \"{deposit_amount}\", \"{total_amount}\", \"{customer_email}\", \"{customer_id}\", \"{country}\", \"{phone}\", \"{currency_code}\", \"{currency_sign}\", \"{invoice_link}\", \"{site_title}\", \"{remaining_amount}\", \"{fullname}\",\"{room_name}\",\"{date}\",\"{checkin}\",\"{checkout}\",\"{no_of_room}\",\"{thumbnail}\",\"{booking_adults}\",\"{room_price}\",\"{couponRate}\",\"{additionaNotes}\",\"{email_temp_img}\",\"{quantity}\",\"{hotel_title}\",\"{booking_adults}\",\"{child}\",\"{no_top_hotel}\",\"{top_hotel}\",\"{map}\",\"{aaa}\",\"{save}\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidcustomer\");\n\t\t\t\t$values = array($invoiceid, $HOTEL_NAME, $stars, $location, $code, $refno, $deposit, $total_amount, $sendto, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $remaining , $name, $room_name, $date, $checkin, $checkout, $no_of_room, $thumbnail,$booking_adults,$room_price,$couponRate,$additionaNotes,$email_temp_img, $quantity,$hotel_title,$booking_adults,$child,$no_top_hotel,$top_hotel,$map,$aaa,$save);\n\n\t\t\t\t$HTML_DATA = file_get_contents( $uu.$ptheme.'/invoice.html');\n\t\t\t\t$message = str_replace($template, $values, $HTML_DATA);\n\n\t\t\t\t\n\t\t\t\t/*$message = $this->mailHeader;*/\n\t\t\t\t/*echo '<pre>'.json_encode($message).'</pre>';\n\t\t\t\texit();*/\n\t\t\t\t/*$details = $this->html_template_booking($hotel_id,$invoiceid);\n\t\t\t\t$message .= str_replace($template, $values, $details);*/\n\t\t\t\t//$message .= $this->mailFooter;\n\t\t\t\t/*echo $message;\n\t\t\t\texit;*/\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $phone, \"bookingpaidcustomer\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Thanks for Booking at the '.$HOTEL_NAME);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t\n\t\t}", "public static function canApply($address)\n {\n // Put here your business logic to check if fee should be applied or not\n // Example of data retrieved :\n // $address->getShippingMethod(); > flatrate_flatrate\n // $address->getQuote()->getPayment()->getMethod(); > checkmo\n // $address->getCountryId(); > US\n // $address->getQuote()->getCouponCode(); > COUPONCODE\n return true;\n }", "function funding_failed($parameters) \n\t{\n\t\t$status = $parameters->verified;\n\n\t\t// Gather the total of all unpaired fees/scs, and adjust for it.\n\t\t$total = 0.0;\n\t\t\n\t\t$fund_date = strtotime($parameters->info->date_fund_stored);\n\t\t$balance = Fetch_Balance_Information($parameters->application_id);\n\t\t$total = $balance->total_balance;\n\t\t\n\t\t$db = ECash::getMasterDb();\n\t\t\n\t\ttry \n\t\t{\n\t\t\t$db->beginTransaction();\n\t\t\t// Remove the schedule immediately\n\t\t\tRemove_Unregistered_Events_From_Schedule($parameters->application_id);\n\t\n\t\t\tif ($total > 0.0) \n\t\t\t{\n\t\t\t\t$today = date(\"Y-m-d\");\n\t\t\t\t$amounts = array();\n\n\t\t\t\tif($balance->fee_pending > 0)\n\t\t\t\t{\n\t\t\t\t\t$amounts[] = Event_Amount::MakeEventAmount('fee', -$balance->fee_pending);\n\t\t\t\t}\n\n\t\t\t\tif($balance->service_charge_pending > 0)\n\t\t\t\t{\n\t\t\t\t\t$amounts[] = Event_Amount::MakeEventAmount('service_charge', -$balance->service_charge_pending);\n\t\t\t\t}\n\n\t\t\t\t$e = Schedule_Event::MakeEvent($today, $today, $amounts, 'adjustment_internal',\n\t\t\t\t\t\t\t\t\t'Adjusting out all accrued fees due to failure.');\n\n\t\t\t\tPost_Event($parameters->application_id, $e);\n\t\t\t}\n\t\t\t\n\t\t\t$db->commit();\n\t\t\t\n\t\t} \n\t\tcatch (Exception $e) \n\t\t{\n\t\t\t$this->Log(__METHOD__.\": Unable to update transactions.\");\n\t\t\t$db->rollBack();\n\t\t\tthrow $e;\n\t\t}\n\t\t\n\t\t// update status\n\t\t\n\t\ttry \n\t\t{\n\t\t\tUpdate_Status(null, $parameters->application_id, array('funding_failed','servicing','customer','*root'));\n\t\t} \n\t\tcatch (Exception $e) \n\t\t{\n\t\t\t$this->Log(__METHOD__.\": Unable to update status.\");\n\t\t\tthrow $e;\n\t\t}\n\t\t// Finally send the email - are we supposed to do this?\n\t}", "function compute_saving_fee($amount)\n{\n $fee = 0;\n if (!is_null($amount) && $amount > 0)\n {\n $fee = $amount * 0.5;\n if ($fee > 10000)\n {\n $fee = 10000;\n }\n else \n {\n $fee = ceil($fee);\n }\n $fee = $fee * 0.01;\n }\n return $fee;\n}", "public function markAsDomesticShipping(Order $draftOrder): bool;", "public function estimateTransactionSmartFeeRequest($blockchain, $network, $context = null, $confirmation_target = null, $estimate_mode = null)\n {\n // verify the required parameter 'blockchain' is set\n if ($blockchain === null || (is_array($blockchain) && count($blockchain) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $blockchain when calling estimateTransactionSmartFee'\n );\n }\n // verify the required parameter 'network' is set\n if ($network === null || (is_array($network) && count($network) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network when calling estimateTransactionSmartFee'\n );\n }\n\n $resourcePath = '/blockchain-data/{blockchain}/{network}/estimate-transaction-smart-fee';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($context !== null) {\n if('form' === 'form' && is_array($context)) {\n foreach($context as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['context'] = $context;\n }\n }\n // query params\n if ($confirmation_target !== null) {\n if('form' === 'form' && is_array($confirmation_target)) {\n foreach($confirmation_target as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['confirmationTarget'] = $confirmation_target;\n }\n }\n // query params\n if ($estimate_mode !== null) {\n if('form' === 'form' && is_array($estimate_mode)) {\n foreach($estimate_mode as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['estimateMode'] = $estimate_mode;\n }\n }\n\n\n // path params\n if ($blockchain !== null) {\n $resourcePath = str_replace(\n '{' . 'blockchain' . '}',\n ObjectSerializer::toPathValue($blockchain),\n $resourcePath\n );\n }\n // path params\n if ($network !== null) {\n $resourcePath = str_replace(\n '{' . 'network' . '}',\n ObjectSerializer::toPathValue($network),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-api-key');\n if ($apiKey !== null) {\n $headers['x-api-key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function calcServiceFee(): float\n\t{\n\t\treturn $this->price * $this->rental_period->service_percent_fee + $this->rental_period->service_flat_fee;\n\t}", "public function sendToAddress($bitcoinaddress, $amount, $comment = '', $commentTo = '');", "public static function lockFunds($from, $amount, $fee=0){\n\t\t$fromuser = \\CouchDB::getDoc($from, \"users\");\n\t\t$frombalance = Dogecoin::getBalance($from);\n\t\tif ($frombalance['available'] < ($amount + $fee)){\n\t\t\t//they don't have the funds\n\t\t\treturn \\Shared\\Error::handleError(\"nofunds\");\n\t\t}else{\n\t\t\tif ($fee != 0){\n\t\t\t\t$response = Dogecoin::payMe($from, $fee);\n\t\t\t}\n\t\t\t$response = Dogecoin::move($from, \"LOCKED-FEE\", $amount);\n\t\t\t$fromuser->wallet->locked += $amount;\n\t\t\t$response = \\CouchDB::setDoc($fromuser, \"users\");\n\t\t\treturn $amount;\n\t\t}\n\t\t//something went wrong, but i have no idea what that might be.\n\t\treturn 0;\n\t}", "public function validatePayment()\n\t{\n\t\t$array_result = array();\n\t\t$array_result['verified'] = 0;\n\t\t$array_result['tot_paid'] = 0.0;\n\t\t$array_result['log'] = '';\n\t\t\n\t\t//cURL Method HTTP1.1 October 2013\n\t\t$raw_post_data \t= file_get_contents('php://input');\n\t\t$raw_post_array = explode('&', $raw_post_data);\n\t\t\n\t\t$myPost = array();\n\t\tforeach ($raw_post_array as $keyval)\n\t\t{\n\t\t\t$keyval = explode('=', $keyval);\n\t\t\tif (count($keyval) == 2)\n\t\t\t{\n\t\t\t\t$myPost[$keyval[0]] = urldecode($keyval[1]);\n\t\t\t}\n\t\t}\n\n\t\t// check if the form has been spoofed\n\t\t$against = array(\n\t\t\t'business' \t => $this->account,\n\t\t\t'mc_gross' \t => number_format($this->order_info['total_net_price'], 2, '.', ''),\n\t\t\t'mc_currency' => $this->order_info['transaction_currency'],\n\t\t\t'tax'\t\t => number_format($this->order_info['total_tax'], 2, '.', ''),\n\t\t);\n\n\t\t/**\n\t\t * If the account name contains the merchant code instead\n\t\t * of the e-mail related to the account, the spoofing check will fail\n\t\t * as the merchant code is always converted into the account e-mail.\n\t\t *\n\t\t * For example, if we specify 835383648, PayPal will return the related\n\t\t * account: dev@e4j.com\n\t\t * Then, 2 different values will be compared:\n\t\t * \"835383648\" ($this->account) againt \"dev@e4j.com\" ($myPost['business'])\n\t\t */\n\n\t\t// inject the original values within the payment data\n\t\tforeach ($against as $k => $v)\n\t\t{\n\t\t\tif (isset($myPost[$k]))\n\t\t\t{\n\t\t\t\t$myPost[$k] = $v;\n\t\t\t}\n\t\t}\n\t\t//\n\n\t\t$req = 'cmd=_notify-validate';\n\t\tif (function_exists('get_magic_quotes_gpc'))\n\t\t{\n\t\t\t$get_magic_quotes_exists = true;\n\t\t}\n\n\t\tforeach ($myPost as $key => $value)\n\t\t{\n\t\t\tif ($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1)\n\t\t\t{\n\t\t\t\t$value = urlencode(stripslashes($value));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$value = urlencode($value);\n\t\t\t}\n\n\t\t\t$req .= \"&$key=$value\";\n\t\t\t$array_result['log'] .= \"&$key=$value\\n\";\n\t\t}\n\t\t\n\t\tif (!function_exists('curl_init'))\n\t\t{\n\t\t\t$array_result['log'] = \"FATAL ERROR: cURL is not installed on the server\\n\\n\" . $array_result['log'];\n\n\t\t\treturn $array_result;\n\t\t}\n\t\t\n\t\tif ($this->sandbox == 1)\n\t\t{\n\t\t\t$paypal_url = \"https://www.sandbox.paypal.com/cgi-bin/webscr\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$paypal_url = \"https://www.paypal.com/cgi-bin/webscr\";\n\t\t}\n\t\t\n\t\t$ch = curl_init($paypal_url);\n\t\tif ($ch == false)\n\t\t{\n\t\t\t$array_result['log'] = \"Curl error: \" . curl_error($ch) . \"\\n\\n\" . $array_result['log'];\n\n\t\t\treturn $array_result;\n\t\t}\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $req);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\t\t\n\t\t/**\n\t\t * Turn on TLS 1.2 protocol in case of safe mode or sandbox enabled.\n\t\t *\n\t\t * @since 1.6.2\n\t\t */\n\t\tif (defined('CURLOPT_SSLVERSION') && ($this->sandbox || $this->safemode))\n\t\t{\n\t\t\tcurl_setopt($ch, CURLOPT_SSLVERSION, 6);\n\t\t}\n\n\t\tcurl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\n\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\n\t\t\n\t\t// CONFIG: Please download 'cacert.pem' from \"http://curl.haxx.se/docs/caextract.html\" and copy it in the same folder as this php file\n\t\t// This is mandatory for some environments.\n\t\t// $cert = dirname(__FILE__) . \"/cacert.pem\";\n\t\t// curl_setopt($ch, CURLOPT_CAINFO, $cert);\n\t\t\n\t\t$res = curl_exec($ch);\n\n\t\tif (curl_errno($ch) != 0)\n\t\t{\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e] ') . \" Can't connect to PayPal to validate IPN message: \" . curl_error($ch) . PHP_EOL;\n\n\t\t\tcurl_close($ch);\n\n\t\t\treturn $array_result;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e]') . \" HTTP request of validation request:\". curl_getinfo($ch, CURLINFO_HEADER_OUT) .\" for IPN payload: $req\" . PHP_EOL;\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e]') . \" HTTP response of validation request: $res\" . PHP_EOL;\n\t\t\t\n\t\t\tcurl_close($ch);\n\t\t}\n\t\t\n\t\tif (strcmp(trim($res), 'VERIFIED') == 0)\n\t\t{\n\t\t\t$array_result['tot_paid'] = $_POST['mc_gross'];\n\t\t\t$array_result['verified'] = 1;\n\t\t\t$array_result['log'] = '';\n\t\t}\n\t\telse if (strcmp(trim($res), 'INVALID') == 0)\n\t\t{\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e]'). \" Invalid IPN: $req\\n\\nResponse: [$res]\" . PHP_EOL;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e]'). \" Unknown Error: $req\\n\\nResponse: [$res]\" . PHP_EOL;\n\t\t}\n\t\t\n\t\t//END cURL Method HTTP1.1 October 2013\n\t\t\n\t\treturn $array_result;\n\t}", "public function chargeFee($amount = false) {\n $this->checkFee($amount);\n\n if(!$amount) {\n $fee = config('games.under_over.entry_fee');\n } else {\n $fee = $amount;\n }\n \n // deduct from the gold of current user\n $this->gold = $this->gold - $fee;\n try {\n $this->saveOrFail();\n } catch(QueryException $ex) {\n throw new PersonalRuntimeException(__('common.errors.invalid_query'));\n }\n }", "public function balanceOf($address)\n {\n\t\t// Remove 0x from address\n\t\tif(strlen($address) == 42 && substr($address, 0, 2) == '0x') {\n\t\t\t$address = substr($address, 2);\n\t\t}\n\n\t\t// Params\n\t\t$c = new \\stdClass();\n\t\t$c->from = '0x7ee760b17ce5cd95b9752f261bfb9b91c2babdba';\n\t\t$c->to = $this->sc_address;\n\t\t$c->data = '0x70a08231000000000000000000000000' . $address;\n\t\t\t\t\n\t\t$params = [$c, \"latest\"];\n\t\t\n\t\t// Perform request (request->request->... ugly!)\n\t\t$data = $this->request->request('eth_call', $params);\n\t\t\t\t\n\t\treturn $data;\n }", "private function saveAddresses() {\n\t\t\t$billingSaved = false;\n\t\t\t$shippingSaved = false;\n\t\t\tif ($this->memberID && $this->billingAddress->validAddress() && $this->shippingAddress->validAddress()) {\n\t\t\t\t// compare billing and shipping addresses\n\t\t\t\t$billingIsShipping = true;\n\t\t\t\tforeach ($this->billingAddress->get('addressForm') as $key => $val) {\n\t\t\t\t\tif ($val != $this->shippingAddress->getArrayData('addressForm', $key)) {\n\t\t\t\t\t\t$billingIsShipping = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($billingIsShipping) {\n\t\t\t\t\t// if the billing address is the same as the shipping address\n\t\t\t\t\t// address record will retain the shipping address name\n\t\t\t\t\t// billing address does not have a name\n\t\t\t\t\t// (payment method name will be in the payment record)\n\t\t\t\t\t$this->shippingAddress->addType('billing');\n\t\t\t\t\tif ($this->shippingAddress->get('saveAddress') || systemSettings::get('FORCESAVESHIPPING')) {\n\t\t\t\t\t\tif (!$this->shippingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->shippingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->shippingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->shippingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `shippingID` = '\".$this->shippingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$billingIsDefault = false;\n\t\t\t\t\t\tif ($this->billingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$billingIsDefault = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->billingAddress->loadAddress($this->shippingAddress->get('addressID'))) {\n\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($this->billingAddress->get('saveAddress') || systemSettings::get('FORCESAVEBILLING')) {\n\t\t\t\t\t\tif (!$this->billingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->billingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->billingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->billingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `billingID` = '\".$this->billingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ($this->shippingAddress->get('saveAddress') || systemSettings::get('FORCESAVESHIPPING')) {\n\t\t\t\t\t\tif (!$this->shippingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->shippingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->shippingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->shippingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `shippingID` = '\".$this->shippingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ($billingSaved && $shippingSaved);\n\t\t}", "public function processPCTWalletTransfer($payload)\n\t{\n\t # Load user model\n\t $this->load->model('user');\n\t \n\t $result = $this->user->sign_in($this->input->post('user-name'), $this->input->post('user-password'));\n\t \n\t if(!$result)\n\t {\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_FAILED_LOGIN_ERROR);\n\t return $response;\n\t }\n\t \n\t $txnId = \"PCTINT\".time();\n\t $fromUser = $result;\n\t $toUser = $this->input->post('to-account');\n\t $txnType = 'User To User Transfer';\n\t $txnPoints = $this->input->post('pct-transfer-points');\n\t $txnTopic = $this->input->post('pct-topic');\n\t $txnMessage = $this->input->post('pct-message');\n\t \n\t # Now before actually making the transaction store, we need to add points to users account\n\t \n\t $profile = $this->user->getUserProfile($result);\n\t \n\t $walletAmount = $profile->{User::_PCT_WALLET_AMOUNT};\n\t \n\t if($txnPoints > $walletAmount){\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_TRANSFER_FAILURE_INSUFFICIENT_FUND);\n\t return $response;\n\t }\n\t \n\t $toUserProfile = $this->user->getUserProfile($toUser);\n\t \n\t $this->db->where(User::_ID, $toUser)->update(User::_TABLE, array(User::_PCT_WALLET_AMOUNT => $toUserProfile->{User::_PCT_WALLET_AMOUNT} + $txnPoints));\n\t $this->db->where(User::_ID, $fromUser)->update(User::_TABLE, array(User::_PCT_WALLET_AMOUNT => ($walletAmount- $txnPoints)));\n\t \n\t \n\t # Load pct-transaction model\n\t $this->load->model('pct_transaction');\n\t $result = $this->pct_transaction->create_transaction($fromUser, $toUser, $txnId, $txnType, $txnPoints, $txnTopic, $txnMessage);\n\t \n\t # Now once the payment is successfull, we should get the balance once again and pass this\n\t \n\t $profile = $this->user->getUserProfile($fromUser);\t \n\t $walletAmount = $profile->{User::_PCT_WALLET_AMOUNT};\n\t \n\t \n\t if($result) $response = array('flag'=>1, 'message'=>Message::PCT_PAYMENT_TRANSFER_SUCCESS, 'walletAmount'=>$walletAmount);\n\t else $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_TRANSFER_FAILURE);\n\t \n\t return $response;\n\t}", "function openstack_change_funds($invoiceid, $substract=False) {\n $items = Capsule::table('tblinvoiceitems')->where('invoiceid', '=', $invoiceid)->get();\n\n // Retrieve the invoice total paid.\n // If this invoice was not fully paid, we do not substract from Fleio.\n // There is no other way to prevent subtracting from Fleio when cancelling an invoice and marking it unpaid afterwards\n try {\n $balance = Capsule::table('tblaccounts as ta')\n ->where('ta.invoiceid', '=', $invoiceid)\n ->join('tblinvoices as ti', 'ta.invoiceid', '=', 'ti.id')\n ->select(Capsule::raw('SUM(ta.amountin)-SUM(ta.amountout)-ti.total as balance'))\n ->value('balance');\n } catch (Exception $e) {\n logActivity($e->getMessage());\n $balance = false;\n } \n $cost_by_service = array();\n $promo_by_service = array();\n foreach($items as $item) {\n # NOTE(tomo): Check if relid is set and not an empty string\n if (($item->relid == '') || !isset($item->relid)) {\n continue;\n }\n if ($item->type == 'PromoHosting') {\n # NOTE(tomo): Do nothing with $promo_by_service. Just don't add it\n # to the final amount to avoid incorrect credit addition in Fleio\n if (isset($promo_by_service[$item->relid])) {\n $promo_by_service[$item->relid] += $item->amount;\n } else {\n $promo_by_service[$item->relid] = $item->amount;\n }\n } else {\n if (isset($cost_by_service[$item->relid])) {\n $cost_by_service[$item->relid] += $item->amount;\n } else {\n $cost_by_service[$item->relid] = $item->amount;\n }\n }\n }\n\n foreach($items as $item) {\n if (($item->type != 'Hosting') || !isset($cost_by_service[$item->relid])) {\n continue;\n }\n # We now know that relid is a Hosting package (not a Domain for example)\n $service = FleioUtils::getServiceById($item->relid);\n if ($service->servertype == 'fleio') {\n # NOTE(tomo): Make sure the service is active. If it's not active and we don't handle this, the credit is lost.\n # NOTE(tomo): We currently handle this in the add/remove credit methods.\n $clientCurrency = getCurrency($item->userid);\n $defaultCurrency = getCurrency();\n $clientAmount = $cost_by_service[$item->relid]; // Amount + Setup and/or other related prices in client's currency\n # NOTE(tomo): Fleio needs to use the WHMCS default currency\n $amount = convertCurrency($clientAmount, 1, $clientCurrency['id']); // Amount in default currency.\n if ($amount == 0) {\n logActivity('Fleio: ignoring Service ID: '. $item->relid . ' with cost equal to 0 from Invoice ID: ' . $invoiceid);\n continue;\n }\n if ($substract && $balance != false && $balance >= 0) {\n logActivity('Fleio: ignoring Service ID: '. $item->relid .' from Invoice ID: ' . $invoiceid . ' with status Unpaid but fully paid');\n continue;\n }\n $fl = Fleio::fromServiceId($item->relid);\n if ($substract) {\n $msg_format = \"Fleio: removing credit for WHMCS User ID: %s with %.02f %s (%.02f %s from Invoice ID: %s)\";\n } else {\n $msg_format = \"Fleio: adding credit for WHMCS User ID: %s with %.02f %s (%.02f %s from Invoice ID: %s)\";\n }\n $msg = sprintf($msg_format, $item->userid, $amount, $defaultCurrency[\"code\"], $clientAmount, $clientCurrency[\"code\"], $invoiceid);\n logActivity($msg);\n # TODO(tomo): We use the userid which can be a contact ?\n try {\n $addCredit = (!$subtract); // Add credit or subtract, boolean\n $response = $fl->clientChangeCredit($addCredit, $amount, $defaultCurrency[\"code\"], $clientCurrency[\"rate\"], $clientAmount, $clientCurrency[\"code\"], $invoiceid);\n } catch (FlApiException $e) {\n logActivity(\"Unable to update the client credit in Fleio: \" . $e->getMessage()); \n return;\n }\n logActivity(\"Fleio: successfully changed client credit with \".$amount.\" \".$defaultCurrency[\"code\"]. \" for Fleio client id: \".$response['client'].\". New Fleio balance: \".$response['credit_balance'].\" \".$defaultCurrency[\"code\"]); \n }\n }\n}", "function getPayments(){\n $earlyPayment = 0;\n $regularPayment = 0;\n $latePayment = 0;\n \n // Separate fee payments into early, regular, late deadlines\n $this->totalFinAid = 0;\n $payments = payment::getSchoolPayments($this->schoolId);\n for($i = 0; $i < sizeof($payments); $i++){\n $payment = new payment($payments[$i]);\n if($payment->finaid == '1') $this->totalFinAid += $payment->amount;\n if($payment->startedTimeStamp<=generalInfoReader('earlyRegDeadline')){\n $earlyPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('earlyRegDeadline') && $payment->startedTimeStamp<=generalInfoReader('regularRegDeadline')){\n $regularPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('regularRegDeadline')){\n $latePayment += intval($payment->amount);\n }\n }\n // Check when school fee was paid\n if($earlyPayment>=generalInfoReader('earlySchoolFee') || $this->numStudents <= 5){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n\t } else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($earlyPayment+$regularPayment>=generalInfoReader('regularSchoolFee')){\n $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t$this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n\n\t}elseif($earlyPayment+$regularPayment+$latePayment>=generalInfoReader('lateSchoolFee')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }else{ // School fee was not paid\n $curTime = time();\n if($curTime<=generalInfoReader('earlyRegDeadline')){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n \t} else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('earlyRegDeadline') && $curTime<=generalInfoReader('regularRegDeadline')){\n\t $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t $this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('regularRegDeadline')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }\n }\n\t\n // Small delegations don't pay school fees\n if($this->numStudents <=5 && $this->numAdvisers){\n $this->schoolFee = 0;\n }\n\t\n\t//Chosun doesn't pay\n\tif(strpos(strtolower($this->schoolName),\"chosun\") !== False || strpos(strtolower($this->schoolName),\"worldview\") !== False){\n\t $this->schoolFee = 0;\n\t $this->delegateFee = 0;\n\t}\n\n // Calculating numbers\n $this->totalPaid = $earlyPayment + $regularPayment + $latePayment - $this->totalFinAid;\n $this->delegateFeeTotal = $this->numStudents*$this->delegateFee;\n $mealTicket = new mealTicket($this->schoolId);\n $this->mealTicketTotal = $mealTicket->totalCost;\n \n $this->schoolFeePaid = 0;\n $this->schoolFeeOwed = 0;\n $this->delegateFeePaid = 0;\n $this->delegateFeeOwed = 0;\n $this->mealTicketPaid = 0;\n $this->mealTicketOwed = 0;\n if($this->totalPaid < $this->schoolFee){\n // Haven't paid school fee\n $this->schoolFeePaid = $this->totalPaid;\n $this->schoolFeeOwed = $this->schoolFee - $this->totalPaid;\n $this->delegateFeeOwed = $this->delegateFeeTotal;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }elseif($this->totalPaid + $this->totalFinAid < $this->schoolFee + $this->delegateFeeTotal){\n // Have paid school fee but not delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->totalPaid + $this->totalFinAid - $this->schoolFee;\n $this->delegateFeeOwed = $this->delegateFeeTotal - $this->delegateFeePaid;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }else{\n // Have paid school and delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->delegateFeeTotal;\n $this->mealTicketPaid = min($this->mealTicketTotal, $this->totalPaid + $this->totalFinAid - $this->schoolFee - $this->delegateFeeTotal);\n $this->mealTicketOwed = $this->mealTicketTotal - $this->mealTicketPaid;\n }\n $this->totalFee = $this->schoolFee + $this->delegateFeeTotal + $this->mealTicketTotal;\n $this->totalOwed = $this->totalFee - $this->totalFinAid - $this->totalPaid;\n \n\t//Create formatted versions:\n\t$this->totalFeeFormatted = '$'.money_format('%.2n',$this->totalFee);\n\t$this->totalPaidFormatted = '$'.money_format('%.2n',$this->totalPaid);\n\t$this->totalOwedFormatted = '$'.money_format('%.2n',$this->totalOwed);\n\n\n\t$this->schoolFeeFormatted = '$'.money_format('%.2n',$this->schoolFee);\n\t$this->schoolFeePaidFormatted = '$'.money_format('%.2n',$this->schoolFeePaid);\n\t$this->schoolFeeOwedFormatted = '$'.money_format('%.2n',$this->schoolFeeOwed);\n\t\n\t$this->delegateFeeFormatted = '$'.money_format('%.2n',$this->delegateFee);\n\t$this->delegateFeeTotalFormatted = '$'.money_format('%.2n',$this->delegateFeeTotal);\n\t$this->delegateFeePaidFormatted = '$'.money_format('%.2n',$this->delegateFeePaid);\n\t$this->delegateFeeOwedFormatted = '$'.money_format('%.2n',$this->delegateFeeOwed);\n\n\t$this->totalFinAidFormatted = '$'.money_format('%.2n',$this->totalFinAid);\n\n\n // Calculate Payment Due Date\n if($this->delegateFee == generalInfoReader('earlyDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('earlyRegDeadline');\n if($this->delegateFee == generalInfoReader('regularDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('regularRegDeadline');\n if($this->delegateFee == generalInfoReader('lateDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('lateRegDeadline');\n $this->totalPaymentDue = generalInfoReader('paymentDueDate');\n\t\n }", "public function feeEstimate(int $numBlocks = null)\n {\n return $this->execute($this->getCoin() . '/tx/fee', 'GET', [\n 'numBlocks' => $numBlocks\n ]);\n }", "public static function payUser($from, $to, $amount, $fee){\n\t\t$frombalance = Dogecoin::getBalance($from);\n\t\tif ($frombalance['available'] < $amount){\n\t\t\t//they don't have the funds\n\t\t\treturn \\Shared\\Error::handleError(\"nofunds\");\n\t\t}\n\t\t//move the fee to the fee account\n\t\ttry{\n\t\t\t$response = Dogecoin::move($from, $to, $amount);\n\t\t\t$response = Dogecoin::move($to, \"CREATION-FEE\", $fee);\n\t\t\treturn $amount;\n\t\t}catch(Exception $e){\n\t\t\treturn 0;\n\t\t}\n\t}", "private function account(){\n\t\t\t// Cross validation if the request method is POST else it will return \"Not Acceptable\" status\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\t\t\t\n\t\t\t$first_name = $this->_request['first_name'];\t\t\n\t\t\t$last_name = $this->_request['last_name'];\n\t\t\t$address = $this->_request['address'];\t\t\n\t\t\t$member_number = $this->_request['member_number'];\t\n\t\t\t$email = $this->_request['email'];\n\t\t\t$phone_number = $this->_request['phone_number'];\n\t\t\t$mobile = $this->_request['mobile'];\t\n\t\t\t$signature = $this->_request['signature'];\n\t\t\t$current_datetime = new DateTime(); \n\t\t\t$birth_date = $this->_request['birth_date'];\t\n\t\t\t$birth_date_format = substr($birth_date, 6, 4).'-'.substr($birth_date, 3, 2).'-'.substr($birth_date, 0, 2);\n\t\t\t$name_of_fund_1 = $this->_request['name_of_fund_1'];\n\t\t\t$name_of_fund_2 = $this->_request['name_of_fund_2'];\n\t\t\t$name_of_fund_3 = $this->_request['name_of_fund_3'];\n\t\t\t$name_of_fund_4 = $this->_request['name_of_fund_4'];\n\t\t\t$name_of_fund_5 = $this->_request['name_of_fund_5'];\n\t\t\t$previous_name = $this->_request['previous_name'];\n\t\t\t$name_of_fund = $name_of_fund_1;\n\t\t\tif(trim($name_of_fund_2)!=''){\n\t\t\t\t$name_of_fund .= ', '.$name_of_fund_2;\n\t\t\t}\t\n\t\t\tif(trim($name_of_fund_3)!=''){\n\t\t\t\t$name_of_fund .= ', '.$name_of_fund_3;\n\t\t\t}\n\t\t\tif(trim($name_of_fund_4)!=''){\n\t\t\t\t$name_of_fund .= ', '.$name_of_fund_4;\n\t\t\t}\n\t\t\tif(trim($name_of_fund_5)!=''){\n\t\t\t\t$name_of_fund .= ', '.$name_of_fund_5;\n\t\t\t}\t\t\t\n\t\t\t$previous_address = $this->_request['previous_address'];\n\t\t\t$result = mysql_query(\"INSERT INTO accounts (member_number, first_name, last_name, address, email, phone_number, mobile, birth_date, signature, date_created, date_modified ) \n\t\t\tVALUES ('\".$member_number.\"', '\".mysql_real_escape_string($first_name).\"', '\".mysql_real_escape_string($last_name).\"', '\".$address.\"', '\".$email.\"', '\".$phone_number.\"', '\".$mobile.\"', '\".$birth_date_format.\"', '\".$signature.\"', NOW(), NOW())\", $this->db);\n\t\t\tif($result) {\n\t\t\t\t$account_id = mysql_insert_id();\n\t\t\t\tif(trim($name_of_fund_1)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_1).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\tif(trim($name_of_fund_2)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_2).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\tif(trim($name_of_fund_3)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_3).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(trim($name_of_fund_4)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_4).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\tif(trim($name_of_fund_5)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_5).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\t\t\t\t\n\t\t\tif($result){\n\t\t\t\t$to = \tEMAIL_TO;\n\t\t\t\t$subject = \t'\"Snap4m New Account';\n\t\t\t\t$mime_boundary=\"==Multipart_Boundary_x\".md5(mt_rand()).\"x\";\n\t\t\t\t \t \t\t\t /*\t*/\n\t\t\t\t$headers = \t\"From:\".EMAIL_FROM.\"\\r\\n\";\n\t\t\t\t$headers .= \t\"MIME-Version: 1.0\\r\\n\"\n\t\t\t\t \t.\"Content-Type: multipart/mixed; boundary=\\\"{$mime_boundary}\\\"\";\t\t\t\t\t \t \n\t $message = \"This is a multi-part message in MIME format.\\n\\n\".\n\t \"--{$mime_boundary}\\n\" .\n\t \"Content-Type: text/plain; charset=\\\"iso-8859-1\\\"\\n\" .\n\t \"Content-Transfer-Encoding: 7bit\\n\\n\";\n\t $message .= \"Name: \".htmlspecialchars($first_name).' '.htmlspecialchars($last_name).\"\\r\\n\"\n\t\t\t\t\t.\"Member No: \".$member_number.\"\\r\\n\"\n\t\t\t\t\t.\"Birthdate: \".$birth_date.\"\\r\\n\"\n\t\t\t\t\t.\"Address: \".$address.\"\\r\\n\"\n\t\t\t\t\t.\"Email: \".$email.\"\\r\\n\"\n\t\t\t\t\t.\"Phone No: \".$phone_number.\"\\r\\n\"\n\t\t\t\t\t.\"Mobile: \".$mobile.\"\\r\\n\"\n\t\t\t\t\t.\"Name of Fund: \".htmlspecialchars($name_of_fund).\"\\r\\n\"\n\t\t\t\t\t.\"Previous Name: \".htmlspecialchars($previous_name).\"\\r\\n\"\n\t\t\t\t\t.\"Previous Address: \".$previous_address.\"\\r\\n\\r\\n\".\"Signature:\\n\\n\";\n\t // attachment with mime babble\n\t $message .= \"--{$mime_boundary}\\n\";\t\t\t\t\t\t\t \t \n\t\t\t\t$file = \tfile_get_contents(\"http://snap4m.com/signatures/\".$signature);\t\t\t\t\t\t \t \n\t\t\t\t$message .= \t\"Content-Type: image/png; name=\\\"\".$signature.\"\\\"\\r\\n\"\n\t\t\t\t \t.\"Content-Transfer-Encoding: base64\\r\\n\"\n\t\t\t\t \t.\"Content-disposition: attachment; file=\\\"\".$signature.\"\\\"\\r\\n\"\n\t\t\t\t \t.\"\\r\\n\"\n\t\t\t\t \t.chunk_split(base64_encode($file))\n\t\t\t\t \t.\"--{$mime_boundary}--\\n\";\n\t\t\t\t\n\t\t\t\tif(mail($to, $subject, $message, $headers))\n\t\t\t\t{\n\t\t\t\t $this->response('success', 200);\n\t\t\t\t} else {\n\t\t\t\t $this->response('success', 200);\n\t\t\t\t} \t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t//$this->response('success', 200);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Add Failed\");\n\t\t\t\t$this->response($this->json($error), 400);\t\t\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}", "function transfer_money() {\n\t\t$user_id = $_REQUEST['user_id'];\n\t\t$mobile = $_REQUEST['mobile_no'];\n\t\t$amount = $_REQUEST['amount'];\n\t\t$mobile_no = $_REQUEST['mobile_no'];\n\n\t\t//$transaction_id= mt_rand( 10000000, 99999999);\n\t\t$wallet_type_main = 2;\n\t\t// amount debit in user self\n\t\t$wallet_type_frnd = 1;\n\t\t// amount credit in frnd\n\t\t$wallet_category_to = 5;\n\t\t// transfer money to\n\t\t$wallet_category_from = 10;\n\t\t// transfer money from\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\tif (!empty($mobile)) {\n\t\t\t$user_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif (!empty($user_records)) {\n\t\t\t\t$main_wallet = $user_records['0']['wallet_amount'];\n\t\t\t\t$contact_number_main = $user_records['0']['user_contact_no'];\n\t\t\t\t// main user mobile number\n\t\t\t\tif ($main_wallet >= $amount) {\n\t\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t\t\tif (!empty($records)) {\n\t\t\t\t\t\t$contact_number_frnd = $records['0']['user_contact_no'];\n\t\t\t\t\t\t// frnd mobile number\n\t\t\t\t\t\t$frnd_wallet = $records['0']['wallet_amount'];\n\t\t\t\t\t\t$frnd_id = $records['0']['user_id'];\n\t\t\t\t\t\tif ($frnd_id != $user_id) {\n\t\t\t\t\t\t\t// amount transfer to another\n\t\t\t\t\t\t\t$transaction_id1 = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t$w_to_desc = \"Amount transfer to \" . $contact_number_frnd;\n\t\t\t\t\t\t\t$wallet_to_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_to . '\",\"' . $transaction_id1 . '\",\"' . $w_to_desc . '\",\"' . $contact_number_frnd . '\"');\n\t\t\t\t\t\t\tif (!empty($wallet_to_transfer)) {\n\t\t\t\t\t\t\t\t//amount recieved by transfer\n\t\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t\t$w_by_desc = \"Amount transfer from \" . $contact_number_main;\n\t\t\t\t\t\t\t\t$wallet_by_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $frnd_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_from . '\",\"' . $transaction_id . '\",\"' . $w_by_desc . '\",\"' . $contact_number_main . '\"');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!empty($wallet_by_transfer)) {\n\t\t\t\t\t\t\t\t$main_wallet_money = $main_wallet - $amount;\n\t\t\t\t\t\t\t\t$frnd_wallet_money = $frnd_wallet + $amount;\n\t\t\t\t\t\t\t\t// update main user wallet\n\t\t\t\t\t\t\t\t$data['wallet_amount'] = $main_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data);\n\t\t\t\t\t\t\t\t// update frnd wallet//\n\t\t\t\t\t\t\t\t$data1['wallet_amount'] = $frnd_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $frnd_id, $data1);\n\t\t\t\t\t\t\t\t$post = array('status' => 'true', 'message' => 'Transfer money successfully', 'main_user_id' => $user_id, 'main_wallet' => $main_wallet_money, 'frnd_wallet' => $frnd_wallet_money, 'frnd_id' => $frnd_id, 'transfer_mobile' => $mobile_no, 'transfer_amount' => $amount, 'transaction_id' => $transaction_id1, 'transfer_date' => $current_date);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Error in transfering amount\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Please enter another user number\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"This user is not exist of given number\");\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Wallet amount is not sufficent to transfer money\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"invalid user\", 'user_id' => $user_id);\n\t\t\t}\n\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"missing parameter\", 'user_id' => $user_id, 'amount' => $amount, 'mobile' => $moble);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function getAddressCapayableFee(Mage_Sales_Model_Quote_Address $address,$value = NULL,$alreadyExclTax = FALSE){\n if($this->_logging) {\n Mage::log('In getAddressCapayableFee (Postpayment)', null, $this->_logfile);\n }\n if (is_null($value)){\n $value = floatval(Mage::helper('capayable')->getPaymentMethodCost($this->_code,$address));\n }\n if (Mage::helper('capayable')->capayableFeePriceIncludesTax()) {\n if (!$alreadyExclTax) {\n $value = Mage::helper('capayable')->getCapayableFeePrice($value, false, $address, $address->getQuote()->getCustomerTaxClassId());\n }\n }\n if($this->_logging) {\n Mage::log('getAddressCapayableFee (Postpayment) value '.$value, null, $this->_logfile);\n }\n return $value;\n }", "public function calculatePayment()\n {\n }", "function dosql_fee(){\n global $conn;\n $paid=$_SESSION['pay_not'];\n if($paid=='All'){\n $sql4=\"SELECT * FROM owner_fee\";\n $result4=mysqli_query($conn,$sql4);\n\n\n\n return $result4;\n \n }else if($paid=='N'){\n $sql5=\"SELECT * FROM owner_fee where paid='N' \";\n $result5=mysqli_query($conn,$sql5);\n return $result5;\n }else if($paid='Y'){\n $sql6=\"SELECT * FROM owner_fee where paid='Y' \";\n $result6=mysqli_query($conn,$sql6);\n return $result6;\n }\n }", "public function makeExamFeePayment($admin_id)\n {\n // Validation\n // $this->validate($request, [\n // 'user_id' => 'required',\n // 'student_index' => 'required',\n // 'student_name' => 'required'\n // ]);\n\n //Collecting data from html form\n // $user_id = trim($request->user_id);\n // $student_index = trim($request->student_index);\n // $student_name = trim($request->student_name);\n\n\n $merchant_order_id = rand(111112,888889);\n $merchant_ref_id = rand(334335,987415);\n\n $callback_url = \"https://smart-typing.com/examFeePaymentSuccess\";\n\n $general = DB::table('tbl_payment_gateway')->first();\n $feeQuery = DB::table('tbl_exam_fee')->first();\n $userQuery = DB::table('admin')->where('id',$admin_id)->first();\n $studentName = $userQuery->first_name.' '.$userQuery->last_name;\n $username = $userQuery->email;\n $user_id = $userQuery->id;\n $step_id = $userQuery->step_id;\n $sessionQuery = DB::table('tbl_step')->where('id',$step_id)->first();\n $product_desc = \"Exam Fee of Smart Typing. Session : \".$sessionQuery->step_name;\n $customer_add = \"Gazipur, Dhaka\";\n $mobile = $userQuery->mobile;\n\n $serverData = json_decode($this->getWMXServerData());\n $url = $serverData->url;\n $app_name = $general->wmx_app_name;\n $options = (base64_encode('s='.$app_name.',i='.\\request()->ip()));\n $wmx_id = $general->wmx_id;\n $access_app_key = $general->wmx_access_app_key;\n $access_username = $general->wmx_access_username;\n $access_password = $general->wmx_access_password;\n $authorization = 'Basic '.base64_encode($access_username.':'.$access_password);\n $cart_info = $wmx_id.','.$app_name.','.'flight';\n \n $data = [\n 'wmx_id' => $wmx_id,\n 'merchant_order_id' => $merchant_order_id,\n 'merchant_ref_id' => $merchant_ref_id,\n 'app_name' => $app_name,\n 'cart_info' => $cart_info,\n 'customer_name' => $studentName,\n 'customer_email' => $username,\n 'customer_add' => $customer_add,\n 'customer_phone' => $mobile,\n 'product_desc' => $product_desc,\n 'amount' => $sessionQuery->amount,\n 'currency' => 'BDT',\n 'options' => $options,\n 'callback_url' => $callback_url,\n 'access_app_key' => $access_app_key,\n 'authorization' => $authorization,\n ];\n \n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL => $url,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => http_build_query($data),\n ));\n \n $resp = curl_exec($curl);\n curl_close($curl);\n \n $json = json_decode($resp);\n $token = $json->token;\n \n Session::put($token.'_user_id',$user_id);\n Session::put($token.'_username',$username);\n \n return Redirect::to('http://sandbox.walletmix.com/bank-payment-process/'.$token.'/'.$username);\n }", "function handleChannelFees(&$trans, $use_erp) {\n debug_print(\"Entry: handlingChannelFees ( use_erp = \" . (($use_erp) ? \"yes\" : \"no\") . \" )\");\n\n $fees = loadManagementFees(\n tget($trans, 'params.amount'), tget($trans, 'work.paymentmethod_id'), tget($trans, 'work.meter.debtortype_id'), tget($trans, 'work.meter.country_id'), tget($trans, 'work.chargefee'), tget($trans, 'work.account_id'), 100, // tenantfeepercentage. Was hard coded to 100. Still is.\n tget($trans, 'work.vat_rate')\n );\n\n debug_print(\"Calculated fees: \" . (debug_flatten_array($fees)));\n\n // According to the tenantfeepercentage, we must now split the fees\n // between the tenant and the landlord.\n\n $amount = tget($trans, \"params.amount\");\n $vat = $fees['tax'];\n $exclusive = $fees['excl'];\n $landlord = $fees['landlord'];\n\n $tenantPercentage = tget($trans, \"work.account.tenantfeepercentage\");\n\n // Don't waste time if we have 100 or 0\n if ($tenantPercentage == 100) {\n $tid = handleChannelFeesForTenant($trans, $vat, $exclusive, $landlord, $use_erp);\n debug_print(\"Returning transaction ids ( $tid, 0 )\");\n return array($tid, 0);\n }\n\n if ($tenantPercentage == 0) {\n $tid = handleChannelFeesForLandlord($trans, $vat, $exclusive, $landlord, $use_erp);\n debug_print(\"Returning transaction ids ( 0, $tid )\");\n return array(0, $tid);\n }\n\n // We have to calculate percentages\n\n $ttid = 0;\n $ltid = 0;\n\n $newVat = round((($vat * $tenantPercentage) / 100), 2);\n $newExclusive = round((($exclusive * $tenantPercentage) / 100), 2);\n $newLandlord = round((($landlord * $tenantPercentage) / 100), 2);\n\n // Floating point errors can be stupid sometimes\n if ($newVat < 0.01)\n $newVat = 0.0;\n if ($newExclusive < 0.01)\n $newExclusive = 0.0;\n if ($newLandlord < 0.01)\n $newLandlord = 0.0;\n\n // In some cases, there's no point in doing this.\n if (($newVat != 0) || ($newExclusive != 0)) {\n $ttid = handleChannelFeesForTenant(\n $trans, $newVat, $newExclusive, $landlord, $use_erp\n );\n\n $ltid = handleChannelFeesForLandlord(\n $trans, ($vat - $newVat), ($exclusive - $newExclusive), ($landlord - $newLandlord), $use_erp\n );\n } else {\n // In this case, there's technically all for the landlord\n $ltid = handleChannelFeesForLandlord(\n $trans, $vat, $exclusive, $landlord, $use_erp\n );\n }\n\n\n $rc = array($ttid, $ltid);\n\n debug_print(\"Returning transaction ids ( $ttid, $ltid )\");\n return $rc;\n}", "function Is_Service_Charge_Payment($event)\n{\n\tif(in_array($event->context, array('generated', 'arrange_next')))\n\t{\n\t\tforeach($event->amounts as $ea)\n\t\t{\n\t\t\tif($ea->event_amount_type == 'service_charge' && $ea->amount < 0)\n\t\t\t\treturn TRUE;\n\t \t}\n\t}\n\treturn FALSE;\n}", "public function notify(TransferFundsNotification $notification)\n {\n $sender = $this->members->with($notification->senderId());\n $recipient = $this->members->with($notification->recipientId());\n\n $this->sender->sendFundsTransferredEmail(\n $sender->information(),\n $recipient->information(),\n $notification->amount(),\n $notification->occurredOn()\n );\n\n $this->sender->sendDepositReceivedEmail(\n $sender->information(),\n $recipient->information(),\n $notification->amount(),\n $notification->occurredOn()\n );\n }", "public function transferBalance($post)\n {\n $response = array();\n //Get user details By token\n $userData = $this->getUserModel()->getUserByToken($post['token']);\n \n $currentDate = $this->getAppService()->getDate();\n //Check Request\n if ($post['type'] == 'debit') {\n //Get Local user details By PhoneNo\n $localUserData = $this->getUserModel()->getLocalUserByPhoneNo($post['phoneNo']);\n \n if (count($localUserData)) {\n //check account status\n if ($localUserData['accountStatus'] == 'Active') {\n //check request Bal\n if (($localUserData['avaiPurchaseBal'] - $this->signupBal) >= $post['balance']) {\n //generate bal request code\n $transferCodeMatch = true;\n while ($transferCodeMatch == true) {\n \n $transferCode = rand('111111', '999999');\n $getUserInfo = $this->getUserModel()->passwordVerifyCodeExist($transferCode);\n if (count($getUserInfo) == 0) {\n $transferCodeMatch = false;\n }\n }\n try {\n //set transfer code\n $updateUserData = array (\n 'balReqCode' => $transferCode,\n 'balReq' => $post['balance']\n );\n $this->getUserModel()->updateUser($localUserData['Id'], $updateUserData);\n \n //set notification message\n $notificationData = array (\n 'reqFrom' => $userData['Id'],\n 'reqTo' => $localUserData['Id'],\n 'requestedName' => $userData['name'],\n 'message' => 'Reject chips : '.$post['balance'].'.Code :'.$transferCode,\n 'date' => $this->getAppService()->getDateTime()\n );\n $this->getNotificationModel()->createNotification($notificationData);\n \n $response['status'] = 'success';\n $response['message'] = 'Transfer code send successfully.';\n $response['bal'] = $userData['avaiTransBal'];\n \n } catch (\\Exception $e) {\n $response['status'] = 'error';\n $response['message'] = 'Something went wrong : Please try agaign.';\n }\n \n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User does not have efficient balance.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User account deactivated by Admin.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User not available.';\n }\n } else {\n //Get Local user details By PhoneNo\n $localUserData = $this->getUserModel()->getUserByPhoneNo($post['phoneNo']);\n //Transfer credit Balance\n if ($userData['avaiTransBal'] >= $post['balance']) {\n if (count($localUserData) > 0) {\n if ($localUserData['accountStatus'] == 'Active') {\n \n //START TRANSACTION\n $em = $this->getController()->getServiceLocator()->get('doctrine.entitymanager.orm_default');\n try {\n $em->getConnection()->beginTransaction();\n \n //check date records exist if not then create new if Yes then use Id\n $getTicketDate = $this->getTicketDateModel()->getTicketDate($userData['Id'],$currentDate);\n\n if (count($getTicketDate) == 0) {\n //create Date Records\n $dateData = array (\n 'userId' => $userData['Id'],\n 'drawDate' => $currentDate,\n 'openingBal' => $userData['avaiTransBal'],\n );\n\n $getDateEntity = $this->getTicketDateModel()->createTicketDate($dateData);\n $dateId = $getDateEntity->Id;\n } else {\n $dateId = $getTicketDate['Id'];\n }\n \n if ($localUserData['userRoll'] == 'local') {\n $localUser = array (\n 'avaiPurchaseBal' => $post['balance'],\n 'totalWinBal' => 0,\n );\n //Update Local user balance.\n $this->getUserModel()->updateUserBal($localUserData['Id'],$localUser);\n \n $notificationData = array (\n 'reqFrom' => $userData['Id'],\n 'reqTo' => $localUserData['Id'],\n 'requestedName' => $userData['name'],\n 'message' => 'Receive chips : '.$post['balance'],\n 'date' => $this->getAppService()->getDateTime()\n ); \n //set notification message\n $this->getNotificationModel()->createNotification($notificationData);\n } else {\n //check date records exist if not then create new if Yes then use Id\n $getLocalTicketDate = $this->getTicketDateModel()->getTicketDate($localUserData['Id'],$currentDate);\n \n if (count($getLocalTicketDate) == 0) {\n //create Date Records\n $dateData = array (\n 'userId' => $localUserData['Id'],\n 'drawDate' => $currentDate,\n 'openingBal' => $localUserData['avaiTransBal'],\n );\n\n $getLocalDateEntity = $this->getTicketDateModel()->createTicketDate($dateData);\n $localDateId = $getLocalDateEntity->Id;\n } else {\n $localDateId = $getLocalTicketDate['Id'];\n }\n $localUser = array (\n 'avaiTransBal' => $localUserData['avaiTransBal'] + $post['balance'],\n );\n //Update Local user balance.\n $this->getUserModel()->updateUser($localUserData['Id'],$localUser);\n \n $transactionData = array (\n 'dateId' => $localDateId,\n 'userId' => $userData['Id'],\n 'agentId' => $localUserData['Id'],\n 'transBalance' => $post['balance'],\n 'transType' => 'Debit',\n 'time' => $this->getAppService()->getTime()\n );\n //create Transaction report\n $this->getTransactionModel()->createTransaction($transactionData);\n }\n \n $agentUser = array (\n 'avaiTransBal' => $userData['avaiTransBal'] - $post['balance'],\n );\n //Update Agent user balance.\n $this->getUserModel()->updateUser($userData['Id'],$agentUser);\n \n $transactionData = array (\n 'dateId' => $dateId,\n 'userId' => $localUserData['Id'],\n 'agentId' => $userData['Id'],\n 'transBalance' => $post['balance'],\n 'transType' => 'Credit',\n 'time' => $this->getAppService()->getTime()\n );\n //create Transaction report\n $this->getTransactionModel()->createTransaction($transactionData);\n \n $response['status'] = 'success';\n $response['message'] = 'Chips transfer successfully.';\n $response['bal'] = $userData['avaiTransBal'] - $post['balance'];\n\n $em->getConnection()->commit();\n } catch (\\Exception $e) {\n $em->getConnection()->rollback();\n $response['status'] = 'error';\n $response['message'] = $e->getMessage();//'Internal Error. Please try agaign.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User account deactivated by Admin.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User not available.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = 'you do have not efficient balance.';\n }\n }\n return $response;\n }", "private function formFeeSuccessBmda ($irrigation_payment) {\n if ($irrigation_payment->payment_type_id == 1) {\n $FarSchApplication = FarmerSchemeApplication::find($irrigation_payment->far_application_id);\n $FarSchApplication->payment_status = 1;\n $FarSchApplication->save();\n }\n }", "function directPayment()\n\t{\n\t\tglobal $eWAYCustomerID,\n\t\t\t\t$eWayTotalAmount,\n\t\t\t\t$ewayCustomerFirstName,\n\t\t\t\t$ewayCustomerLastName,\n\t\t\t\t$ewayCustomerEmail,\n\t\t\t\t$ewayCustomerAddress,\n\t\t\t\t$ewayCustomerPostcode,\n\t\t\t\t$ewayCustomerInvoiceDescription,\n\t\t\t\t$ewayCustomerInvoiceRef,\n\t\t\t\t$ewayCardHoldersName,\n\t\t\t\t$ewayCardNumber,\n\t\t\t\t$ewayCardExpiryMonth,\n\t\t\t\t$ewayCardExpiryYear,\n\t\t\t\t$ewayCVN,\n\t\t\t\t$ewayTrxnNumber,\n\t\t\t\t$ewayOption1,\n\t\t\t\t$ewayOption2,\n\t\t\t\t$ewayOption3,\n\t\t\t\t$directPaymentUrl,\n\t\t\t\t$eWaySOAPActionURL;\n\t\t\t\t$testUrl = \"https://www.eway.com.au/gateway_cvn/xmltest/testpage.asp\";\n\t\t\t\t$liveUrl = \"https://www.eway.com.au/gateway_cvn/xmlpayment.asp\";\n\t\t\t\t$eWaySOAPActionURL = \"https://www.eway.com.au/gateway/managedpayment\";\n\t\t\t\t$eWayCustomerId = \"91901390\"; /* test account */\n\t\t\t\t$eWayTotalAmount = 100; /* 1$ = 100 cent */\n\t\t\t\t$directXML = \"<ewaygateway>\".\n\t\t\t\t\"<ewayCustomerID>\".$eWAYCustomerID.\"</ewayCustomerID>\".\n\t\t\t\t\"<ewayTotalAmount>\".$eWayTotalAmount.\"</ewayTotalAmount>\".\n\t\t\t\t\"<ewayCustomerFirstName>\".$ewayCustomerFirstName.\"</ewayCustomerFirstName>\".\n\t\t\t\t\"<ewayCustomerLastName>\".$ewayCustomerLastName.\"</ewayCustomerLastName>\".\n\t\t\t\t\"<ewayCustomerEmail>\".$ewayCustomerEmail.\"</ewayCustomerEmail>\".\n\t\t\t\t\"<ewayCustomerAddress>\".$ewayCustomerAddress.\"</ewayCustomerAddress>\".\n\t\t\t\t\"<ewayCustomerPostcode>\".$ewayCustomerPostcode.\"</ewayCustomerPostcode>\".\n\t\t\t\t\"<ewayCustomerInvoiceDescription>\".$ewayCustomerInvoiceDescription.\"</ewayCustomerInvoiceDescription>\".\n\t\t\t\t\"<ewayCustomerInvoiceRef>\".$ewayCustomerInvoiceRef.\"</ewayCustomerInvoiceRef>\".\n\t\t\t\t\"<ewayCardHoldersName>\".$ewayCardHoldersName.\"</ewayCardHoldersName>\".\n\t\t\t\t\"<ewayCardNumber>\".$ewayCardNumber.\"</ewayCardNumber>\".\n\t\t\t\t\"<ewayCardExpiryMonth>\".$ewayCardExpiryMonth.\"</ewayCardExpiryMonth>\".\n\t\t\t\t\"<ewayCardExpiryYear>\".$ewayCardExpiryYear.\"</ewayCardExpiryYear>\".\n\t\t\t\t\"<ewayCVN>\".$ewayCVN.\"</ewayCVN>\".\n\t\t\t\t\"<ewayTrxnNumber>\".$ewayTrxnNumber.\"</ewayTrxnNumber>\".\n\t\t\t\t\"<ewayOption1>\".$ewayOption1.\"</ewayOption1>\".\n\t\t\t\t\"<ewayOption2>\".$ewayOption2.\"</ewayOption2>\".\n\t\t\t\t\"<ewayOption3>\".$ewayOption3.\"</ewayOption3>\".\n\t\t\t\"</ewaygateway>\";\n\t\t\t //echo $directXML;\n\t\t\t //exit;\n\t\t\t\t$result = $this->makeCurlCall($testUrl, /* CURL URL */\"POST\", /* CURL CALL METHOD */\n\t\t\t\tarray( /* CURL HEADERS */\n\t\t\t\t\t\"Content-Type: text/xml; charset=utf-8\",\n\t\t\t\t\t\"Accept: text/xml\",\n\t\t\t\t\t\"Pragma: no-cache\",\n\t\t\t\t\t\"SOAPAction: \".$eWaySOAPActionURL,\n\t\t\t\t\t\"Content_length: \".strlen(trim($directXML))\n\t\t\t\t),\n\t\t\t\tnull, /* CURL GET PARAMETERS */\n\t\t\t\t$directXML /* CURL POST PARAMETERS AS XML */\n\t\t\t);\n\t\t\tif($result != null && isset($result[\"response\"])) {//$response = new SimpleXMLElement($result[\"response\"]);\n\t\t\t // $response = simpleXMLToArray($response);\n\t\t\t $result\t\t\t\t=\t$result[\"response\"];\n\t\t\t // exit;\n\t\t\t $ewayTrxnStatus\t\t=\t$this->getTextBetweenTags($result,'ewayTrxnStatus');\n\t\t\t if($ewayTrxnStatus)\n\t\t\t {\n\t\t\t\t\t$ewayTrxnNumber\t=\t $this->getTextBetweenTags($result,'ewayTrxnNumber');\n\t\t\t\t\t$ewayAuthCode\t=\t $this->getTextBetweenTags($result,'ewayAuthCode');\n\t\t\t\t\treturn array(\n\t\t\t\t\t\t\t\t\t\"ewayTrxnStatus\"=>$ewayTrxnStatus,\n\t\t\t\t\t\t\t\t\t\"ewayTrxnNumber\"=>$ewayTrxnNumber,\n\t\t\t\t\t\t\t\t\t\"ewayAuthCode\"=>$ewayAuthCode\n\t\t\t\t\t\t\t\t);\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t return 'error: Account creation fail';\n\t\t\t }\n\t\t\t}\n\t\t\tdie(\"\");\n\t}", "public function bluepay_oneoff_payment($params)\n\t{\n\t\t$this->_api_method = 'SALE';\n\t\t$this->_request = $this->_build_request($params);\t\t\t\n\t\treturn $this->_handle_query();\n\t}", "public function withdrawRequestProcess($balanceType, $requestAmount, $account)\n{\n\t// return $balanceType;\n\t$availableBalance = Account::where('user_id', Auth::id())->first();\n\t$wbBalance = $availableBalance->balance - ( $requestAmount * .05 ); // Balance after deduct charge 5% of withdrawal request amount\n\t$roiBalance = $availableBalance->roi_balance - ( $requestAmount * .05 );\n\t$deductBalance = ( $requestAmount + $requestAmount * .05 );\n\n\t\t\n\n\n\t\tif( $balanceType == 1 )\n\t\t{\n\t\t\tif( $requestAmount > $wbBalance )\n\t\t\t\t{\n\t\t\t\t\treturn redirect()->back()->with('message', 'Insufficient Balance');\n\t\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$tnx_id = 'wwr_'.rand(1,99999999);\n\t\t\t\tWithdrawal::insert([\n\t\t\t\t\t'amount' \t\t=> $requestAmount,\n\t\t\t\t\t'wdrl_chrg'\t\t=> ($requestAmount * .05),\n\t\t\t\t\t'amount_type' \t=> $balanceType,\n\t\t\t\t\t'request_date'\t=> Carbon::now(),\n\t\t\t\t\t'user_id'\t\t=> Auth::id(),\n\t\t\t\t\t'withdraw_to' => $account,\n\t\t\t\t\t'tnx_id'\t\t=> $tnx_id\n\t\t\t\t\t]);\n\n\t\t\t\t Account::where('user_id', Auth::id())\n\t\t\t\t ->decrement('balance', $deductBalance);\n\n\t\t\t\t Transaction::insert(\n\t\t\t\t\t[\n\t\t\t\t\t'tnx_id' => $tnx_id,\n\t\t\t\t\t'amount' => $requestAmount+($requestAmount*.05),\n\t\t\t\t\t'sign' => '-',\n\t\t\t\t\t'purpose' => 2,\n\t\t\t\t\t// 'proce_fee'=> ($requestAmount*.05),\n\t\t\t\t\t'date' => Carbon::now(), \n\t\t\t\t\t'user_id' => Auth::user()->id,\n\t\t\t\t\t// 'related_id' =>22\n\t\t\t\t\t]);\t\n\n\t\t\t\t\treturn redirect()->back()->with('smessage', 'Your withdrawal request submitted. Please allow us 24 hours to process your request.');\t\t\n\t\t\t};\n\t\t}\n\t\telse\n\t\t{\t\n\n\t\t\tif( $requestAmount > $roiBalance )\n\t\t\t\t{\n\t\t\t\t\treturn redirect()->back()->with('message', 'Insufficient balance.');\n\n\t\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$tnx_id = 'rwr_'.rand(1,99999999);\n\n\t\t\t\tWithdrawal::insert([\n\t\t\t\t\t'amount' \t\t=> $requestAmount,\n\t\t\t\t\t'wdrl_chrg'\t\t=> ($requestAmount * .05),\n\t\t\t\t\t'amount_type' \t=> $balanceType,\n\t\t\t\t\t'request_date'\t=> Carbon::now(),\n\t\t\t\t\t// 'response_date' => 0\n\t\t\t\t\t'user_id'\t\t=> Auth::id(),\n\t\t\t\t\t// 'status'\t\t=> 0\n\t\t\t\t\t'withdraw_to' => $account,\n\t\t\t\t\t'tnx_id'\t\t=> $tnx_id\n\t\t\t\t\t]);\n\n\t\t\t\t Account::where('user_id', Auth::id())\n\t\t\t\t ->decrement('roi_balance', $deductBalance);\n\n\t\t\t\t Transaction::insert(\n\t\t\t\t\t[\n\t\t\t\t\t'tnx_id' => $tnx_id,\n\t\t\t\t\t'amount' => $requestAmount+($requestAmount * .05),\n\t\t\t\t\t'sign' => '-',\n\t\t\t\t\t'purpose' => 15,\n\t\t\t\t\t// 'proce_fee'=> ($requestAmount*.05),\n\t\t\t\t\t'date' => Carbon::now(), \n\t\t\t\t\t'user_id' => Auth::user()->id,\n\t\t\t\t\t// 'related_id' =>22\n\t\t\t\t\t]);\n\n\t\t\t\t\treturn redirect()->back()->with('smessage', 'Your withdrawal request submitted. Please allow us 24 hours to process your request.');\t\t\t\t \n\t\t\t\t\t\n\t\t\t};\n\n\t\t}\n\n\n\n}", "public function makePayment(Request $request){\n //iniatilize constants\n $email = $request->p_email;\n $amount = $request->amount;\n $password = $request->p_password;\n $getter = User::where('email', 'awazoneinfo@gmail.com')->get();\n\n //check the users balance\n $check = User::where('email', $email)->where('password', $password)->get();\n if(count($check)< 1){\n\n return response( ['message' => 'User not found'], 404);\n\n }else{\n //subtract the amount from users balance\n //check balance\n if(($check[0]->balance) >= $amount){\n $subtract = $check[0]->balance - $amount;\n User::where('email', $email)->update(['balance'=> $subtract]);\n \n //input into transaction history\n $transaction = new TransactionsHistory;\n\n $transaction->amount = $amount;\n $transaction->description = \"Awazone.net Payment \";\n $transaction->time = now();\n $transaction->user_id = $check[0]->id;\n\n $saved = $transaction->save();\n\n if($saved){\n //add payment to awazone\n $add = $getter[0]->balance + $amount;\n User::where('email', 'awazoneinfo@gmail.com')->update(['balance' => $add]);\n $receiver = new TransactionsHistory;\n $receiver->amount = $amount;\n $receiver->description = $check[0]->username.\" Payment from Awazone\";\n $receiver->time = now();\n $receiver->user_id = $getter[0]->id;\n $save = $receiver -> save();\n if($save){\n return response(['message'=> 'Payment made Successfully', 'status'=> 'ok'], 200);\n }else{\n return response(['message' => 'An error occur'], 417);\n }\n \n }else{\n return response(['message' => 'An error occur'], 501);\n }\n\n\n }else{\n return response(['message'=> 'Insufficient Balance'], 402);\n }\n \n }\n }", "public function getFee(): float;", "public function postBankDeposit(Request $request) {\n $validator = \\Validator::make($request->all(), \\Solunes\\Payments\\App\\OnlineBankDeposit::$rules_send);\n $sale_payment_id = $request->input('sale_payment_id');\n if(!$validator->passes()){\n return redirect($this->prev)->with('message_error', 'Debe llenar todos los campos obligatorios.')->withErrors($validator)->withInput();\n } else {\n $sale_payment = \\Solunes\\Sales\\App\\SalePayment::find($sale_payment_id);\n $sale = $sale_payment->sale;\n if($sale_payment->status=='holding'&&$sale = \\Solunes\\Sales\\App\\Sale::findId($sale_payment->parent_id)->checkOwner()->first()){\n $cancel_url = url('');\n $transaction = \\BankDeposit::generateSalePayment($sale_payment->payment, $cancel_url);\n if($sale_payment->online_bank_deposit){\n $online_bank_deposit = $sale_payment->online_bank_deposit;\n } else {\n $online_bank_deposit = new \\Solunes\\Payments\\App\\OnlineBankDeposit;\n $online_bank_deposit->sale_payment_id = $sale_payment->id;\n $online_bank_deposit->status = 'holding';\n }\n $online_bank_deposit->parent_id = $request->input('online_bank_id');\n $online_bank_deposit->transaction_id = $transaction->id;\n $online_bank_deposit->file = \\Asset::upload_file($request->file('file'), 'online-bank-deposit-file');\n $online_bank_deposit->save();\n if(config('payments.cash_params.redirect')&&config('payments.cash_params.redirect_url')){\n if(config('payments.notify_agency_on_payment')&&$sale->agency){\n \\FuncNode::make_email('verify-payment', [$sale->agency->email], []);\n }\n return redirect(config('payments.cash_params.redirect_url'))->with('message_success', 'Su pago fue recibido, deberá ser confirmado en las próximas horas y le enviaremos un email confirmando la recepción del pago. ¡Muchas gracias!');\n } else {\n return redirect($this->prev)->with('message_success', 'Su pago fue recibido, deberá ser confirmado en las próximas horas y le enviaremos un email confirmando la recepción del pago. ¡Muchas gracias!');\n }\n } else {\n return redirect($this->prev)->with('message_error', 'Hubo un error al encontrar su pago.');\n }\n }\n }", "function charge_v1_vtdirect_payment( $order_id )\n {\n global $woocommerce;\n $order_items = array();\n\n // Check token id\n if( $_POST['veritrans_token_id'] == '' ) {\n throw new Exception( __('Invalid Token ID', 'woocommerce') );\n }\n\n $endpoint_url = 'https://payments.veritrans.co.id/vtdirect/v1/charges';\n $server_key = $this->server_key;\n $server_key = base64_encode($server_key . ':');\n $token_id = $_POST['veritrans_token_id'];\n\n $order = new WC_Order( $order_id );\n \n $shipping_address = array();\n $billing_address = array();\n\n // Order Items\n if( sizeof( $order->get_items() ) > 0 ) {\n foreach( $order->get_items() as $item ) {\n $order_items[] = array(\n 'id' => $item['product_id'],\n 'name' => substr($item['name'], 0, 20),\n 'qty' => $item['qty'] / 1,\n 'price' => ceil( $order->get_item_subtotal( $item, false ) )\n );\n }\n }\n\n // Shipping Fee\n if( $order->get_total_shipping() > 0 ) {\n $order_items[] = array(\n 'id' => 'shippingfee',\n 'name' => 'Shipping Fee',\n 'qty' => 1,\n 'price' => ceil( $order->get_total_shipping() )\n );\n }\n\n // Tax\n if( $order->get_total_tax() > 0 ) {\n $order_items[] = array(\n 'id' => 'taxfee',\n 'name' => 'Tax',\n 'qty' => 1,\n 'price' => ceil($order->get_total_tax())\n );\n }\n\n // Fees\n if ( sizeof( $order->get_fees() ) > 0 ) {\n $fee_counter = 0;\n foreach ( $order->get_fees() as $item ) {\n $fee_counter++;\n $order_items[] = array(\n 'id' => 'feeitem' . $fee_counter,\n 'name' => 'Fee Item ' . $fee_counter,\n 'qty' => 1,\n 'price' => ceil( $item['line_total'] )\n );\n }\n }\n\n // Shipping Address\n $shipping_address['first_name'] = $order->shipping_first_name;\n $shipping_address['last_name'] = $order->shipping_last_name;\n $shipping_address['address1'] = $order->shipping_address_1;\n $shipping_address['address2'] = $order->shipping_address_2;\n $shipping_address['city'] = $order->shipping_city;\n $shipping_address['postal_code'] = $order->shipping_postcode;\n $shipping_address['phone'] = $order->billing_phone;\n\n // Billing Address\n $billing_address['first_name'] = $order->billing_first_name;\n $billing_address['last_name'] = $order->billing_last_name;\n $billing_address['address1'] = $order->billing_address_1;\n $billing_address['address2'] = $order->billing_address_2;\n $billing_address['city'] = $order->billing_city;\n $billing_address['postal_code'] = $order->billing_postcode;\n $billing_address['phone'] = $order->billing_phone;\n\n // Body that will be send to Veritrans\n $body = array(\n 'token_id' => $token_id,\n 'order_id' => $order_id,\n 'order_items' => $order_items,\n 'gross_amount' => ceil( $order->order_total ),\n 'email' => $order->billing_email,\n 'shipping_address' => $shipping_address,\n 'billing_address' => $billing_address\n );\n\n $headers = array( \n 'Authorization' => 'Basic ' . $server_key,\n 'content-type' => 'application/json'\n ); \n\n $response = wp_remote_post( $endpoint_url, array(\n 'body' => json_encode($body),\n 'headers' => $headers,\n 'timeout' => 20,\n 'sslverify' => false\n ) );\n\n // If wp_remote_post failed\n if( is_wp_error( $response ) ) {\n throw new Exception( $response->get_error_message() );\n }\n\n $response_body = $response['body'];\n $response_body = json_decode( $response_body );\n\n // If response from Veritrans is failure\n if( $response_body->code != 'VD00' ) {\n throw new Exception( $response_body->message );\n }\n \n // Set order as complete\n $order->payment_complete();\n\n // Remove cart\n $woocommerce->cart->empty_cart();\n }", "public function testMessageFeeEmpty()\n {\n $message = new Message();\n // leave $message empty!\n\n $expectFee = 0;\n $actualFee = Fee::calculateForMessage($message);\n\n $this->assertEquals($expectFee, $actualFee);\n }", "function transfer_money(){\n\t\t$user_id=$_REQUEST['user_id'];\n\t\t$mobile=country_code.$_REQUEST['mobile_no'];\n\t\t$amount=$_REQUEST['amount'];\n\t\t$mobile_no=$_REQUEST['mobile_no'];\n\t \n\t\t\n\t\t//$transaction_id= mt_rand( 10000000, 99999999);\n\t\t$wallet_type_main=2;// amount debit in user self\n\t\t$wallet_type_frnd=1;// amount credit in frnd\n\t\t$wallet_category_to=5;// transfer money to\n\t\t$wallet_category_from=10;// transfer money from\n\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\tif(!empty($mobile)){\n\t\t\t$user_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif(!empty($user_records)){\n\t\t\t$main_wallet=$user_records['0']['wallet_amount'];\n\t\t\t$contact_number_main=substr($user_records['0']['user_contact_no'],4); // main user mobile number\n\t\t\tif($main_wallet>=$amount){\n\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t\tif(!empty($records)){\n\t\t\t\t$contact_number_frnd=substr($records['0']['user_contact_no'],4); // frnd mobile number\n\t\t\t\t$frnd_wallet=$records['0']['wallet_amount']; \n\t\t\t\t$frnd_id=$records['0']['user_id'];\n\t\t\t\tif($frnd_id !=$user_id){\n\t\t\t\t\t// amount transfer to another\n\t\t\t$transaction_id1= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t$w_to_desc=\"Amount transfer to \".$contact_number_frnd;\n\t\t\t\t\t\t$wallet_to_transfer = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_to . '\",\"' .$transaction_id1 . '\",\"' . $w_to_desc . '\",\"' . $contact_number_frnd . '\"');\n\t\t\t\t\t\tif(!empty($wallet_to_transfer)){\n\t\t\t\t\t\t\t//amount recieved by transfer\n\t\t\t\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t$w_by_desc=\"Amount transfer from \".$contact_number_main;\n\t\t\t\t\t\t$wallet_by_transfer = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $frnd_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_from . '\",\"' .$transaction_id . '\",\"' . $w_by_desc . '\",\"' . $contact_number_main . '\"');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!empty($wallet_by_transfer)){\n\t\t\t\t\t\t\t\t$main_wallet_money=$main_wallet-$amount;\n\t\t\t\t\t\t\t\t$frnd_wallet_money=$frnd_wallet+$amount;\n\t\t\t\t\t\t\t\t// update main user wallet\n\t\t\t\t\t\t\t\t$data['wallet_amount']=$main_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user_id, $data);\n\t\t\t\t\t\t\t\t// update frnd wallet//\n\t\t\t\t\t\t\t\t$data1['wallet_amount']=$frnd_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$frnd_id, $data1);\n\t\t\t\t\t\t\t\t\t$post=array('status'=>'true','message'=>'Transfer money successfully','main_user_id'=>$user_id,'main_wallet'=>$main_wallet_money,'frnd_wallet'=>$frnd_wallet_money,'frnd_id'=>$frnd_id,'transfer_mobile'=>$mobile_no,'transfer_amount'=>$amount,'transaction_id'=>$transaction_id1,'transfer_date'=>$current_date);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Error in transfering amount\");\n\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Please enter another user number\");\n\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"This user is not exist of given number\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Wallet amount is not sufficent to transfer money\");\n\t\t\t}\n\t\t\t}else{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"invalid user\",'user_id'=>$user_id);\n\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"missing parameter\",'user_id'=>$user_id,'amount'=>$amount,'mobile'=>$moble);\n\t\t}\necho $this -> json($post);\n\t}", "public function get_translation_fee()\n {\n $this->load->model('cases_model', 'cases');\n $this->load->model('currencies_model', 'currencies');\n $this->load->model('estimates_model', 'estimates');\n $case_number = $this->input->post('case_number');\n $number_words = $this->input->post('number_words');\n $country_id = $this->input->post('country_id');\n $translation_rate = $this->input->post('translation_rate');\n $estimate_fee_level = $this->input->post('estimate_fee_level');\n $estimate_currency = $this->input->post('estimate_currency');\n $translation_fee = 0;\n $currency_sign = '$';\n if (!is_null($case = $this->cases->find_case_by_number($case_number))) {\n $estimate_countries = $this->estimates->get_estimate_countries($case['id'], $case['user_id'], $estimate_fee_level);\n if (!is_null($customer_fees = $this->estimates->get_customer_fees_by_countries($case['user_id'], $case['case_type_id'], $case['case_number'], $estimate_countries, $case['entity']))) {\n $translation_fee = ceil($translation_rate * $number_words + $customer_fees[$country_id]['translation_rates_for_claims'] * $case['number_words_in_claims']);\n\n if ($estimate_currency == 'euro') {\n $currency_sign = '€';\n $euro_exchange_rate = $this->currencies->get_currency_rate_by_code('EUR');\n\n $translation_fee = ceil($translation_fee / $euro_exchange_rate);\n }\n }\n }\n echo $currency_sign . $translation_fee;\n }", "public function paidInFull()\n {\n $payment = $this->getPayment(1);\n\n return $payment && $payment->total == $this->getTotal();\n }", "public function markAsExpressShipping(Order $draftOrder): bool;", "function handleChannelFeesForTenantERP(\n $tid, $created, $serialnumber, $paymentmethod_id, $amount\n ) {\n debug_print(\"Entry: handleChannelFeesForTenantERP ( tid = $tid )\");\n\n debug_print(\"Creating debtor transaction record\");\n\n $paymentmethod = loadPaymentMethod($paymentmethod_id);\n if ($paymentmethod === false)\n return false;\n\n $meter = loadMeterInformation($serialnumber);\n if ($meter === false)\n return false;\n\n $account = loadAccount($meter['account_id']);\n if ($account === false)\n return false;\n\n $branch = loadCustomerBranch($account['customerbranch_id']);\n if ($branch === false)\n return false;\n\n $branchcode = $branch['code'];\n $new_date = date('Y-m-d', strtotime($created));\n $period_id = fgetPeriod_id($new_date, __FILE__, __LINE__);\n $reference = substr($paymentmethod['code'], 0, 7) . ' ' . $tid;\n $salesorder_id = 0;\n $gst = 0.00;\n $freight = 0.00;\n $rate = 1.00;\n $invtext = '';\n $settled = 0;\n $discount = 0;\n $invtext = 'ReceivedMeter:' . $serialnumber . '(' . $branchcode . ')';\n $invtextevent = 'Received';\n $invtextserialnumber = $serialnumber;\n $invtextbranchcode = $branchcode;\n $meter_id = $meter['meter_id'];\n $posted = 1;\n\n $dtid = insertDebtorTrans(\n $tid, $paymentmethod['transactiontype_id'], $account['customerbranch_id'], $created, $period_id, $reference, $salesorder_id, $amount, $gst, $freight, $rate, $invtext, $settled, $discount, $invtextevent, $invtextserialnumber, $invtextbranchcode, $meter_id\n );\n\n\n $dtid = insertDebtorTrans(\n $tid, $paymentmethod['transactiontype_id'], $paymentmethod['customerbranch_id'], $created, $period_id, $reference, $salesorder_id, (-$amount), $gst, $freight, $rate, $invtext, $settled, $discount, $invtextevent, $invtextserialnumber, $invtextbranchcode, $meter_id\n );\n\n // Line to be invoiced\n $dtid = insertDebtorTrans(\n $tid, 4, $paymentmethod['customerbranch_id'], $created, $period_id, $reference, $salesorder_id, $amount, $gst, $freight, $rate, $invtext, $settled, $discount, $invtextevent, $invtextserialnumber, $invtextbranchcode, $meter_id\n );\n\n\n debug_print(\"Creating GL transaction records\");\n\n $vatapplicable_id = 5;\n\n if (doesGlExist($paymentmethod['erpglaccountcredit']) &&\n doesGlExist($paymentmethod['erpglaccountdebit'])) {\n $rc = insertGLTrans(\n $paymentmethod['transactiontype_id'], $tid, $new_date, $period_id, $invtext, $posted, $vatapplicable_id, $postings = array(\n array($paymentmethod['erpglaccountcredit'] => $amount),\n array($paymentmethod['erpglaccountcredit'] => -$amount)\n )\n );\n }\n\n\n debug_print(\"Returning transaction id $tid\");\n debug_print(\"Exit: handleChannelFeesForTenantERP\");\n return $tid;\n }", "public function paystackCallbackURL(Request $request)\n {\n $reference = $request->get('reference');\n $paymentDetails = $this->paystackVerifyPayment($reference);\n if ($paymentDetails['status']===true) {\n $amount_paid= $paymentDetails['data']['amount'] / 100;\n\n try{\n\n DB::beginTransaction();\n //Create the record in the deposit table for the user\n $deposit = Deposit::create([\n 'amount'=> $amount_paid,\n 'user_id'=>auth()->id(),\n 'paystack_reference'=>$paymentDetails['data']['reference']\n ]);\n\n //Create the record on the transactions table with the Deposit Model\n $deposit->transactions()->create([\n 'user_id'=>auth()->id(),\n 'type'=>'+',\n 'amount'=>$amount_paid\n ]);\n\n //Check if the user already have a wallet, if yes update the balance column, if no, create a Wallet record for the user\n $user= auth()->user();\n $wallet= $user->wallet;\n $wallet==null ?\n $balance= $amount_paid : $balance= $wallet->balance + $amount_paid;\n Wallet::updateOrCreate(\n ['user_id' => auth()->user()->id],\n ['balance' =>$balance]\n );\n DB::commit();\n\n //Send Email to the user and queue it\n mail::to($user->email)->queue(new DepositWasSuccessful($deposit));\n return new DepositResource($deposit);\n\n }catch(\\Throwable $e){\n DB::rollBack();\n return response()->json([\n 'status'=>false,\n 'message'=> 'Ops, something went wrong, your balance will be updated very soon'.$e->getMessage()\n ], 400);\n\n }\n\n }else{\n\n return response()->json([\n 'status'=>false,\n 'message'=>'Fund deposit was not completed'\n ], 400);\n }\n\n\n }", "public function getReceivedByAddress($bitcoinaddress, $minconf = 1);", "public static function update_stripe_fee( $order = null, $amount = 0.0 ) {\n\t\tif ( is_null( $order ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();\n\n\t\tWC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, self::META_NAME_FEE, $amount ) : $order->update_meta_data( self::META_NAME_FEE, $amount );\n\t}", "function sendPaymentProof(Transaction $transaction,$payment_proof_url)\n {\n $transaction->payment_url = $payment_proof_url;\n $this->transactionRepo->save($transaction);\n //if the last status is not \"need checking\", change it\n $transactionStatus = $this->transactionStatusRepo->findByTransactionMostRecent($transaction);\n if (!$transactionStatus->isNeedChecking()){\n $transactionStatus = $this->addStatus($transaction,TransactionStatus::STATUS_NEED_CHECKING,null);\n }\n return $transactionStatus;\n }", "public function estimateFeeFromAccount($priority, $payment_address_id, $destination, $quantity, $asset, $account='default', $unconfirmed=false, $dust_size=null) {\n $body = [\n 'destination' => $destination,\n 'quantity' => $quantity,\n 'asset' => $asset,\n 'sweep' => false,\n 'unconfirmed' => $unconfirmed,\n 'account' => $account,\n ];\n if ($dust_size !== null) { $body['dust_size'] = $dust_size; }\n\n $result = $this->newAPIRequest('POST', '/estimatefee/'.$payment_address_id, $body);\n if (isset($result['fees'][$priority])) {\n return new Quantity($result['fees'][$priority.'Sat']);\n }\n\n return new Quantity(intval($priority) * $result['size']);\n }", "function payment($userid = 0, $invoiceid = 0, $invoicetype = 'subscription', $amount = 0, $method = 'account', $gateway = '', $gatewaytxn = '', $isrefund = false, $originalgatewaytxn = '', $silentmode = false)\n {\n global $ilance, $show, $phrase, $page_title, $area_title, $ilconfig, $ilpage;\n\t\t$selectextrafields = '';\n\n ($apihook = $ilance->api('process_debit_payment_start')) ? eval($apihook) : false;\n \n // #### INSTANT PAYMENT NOTIFICATION HANDLER ###########################\n if ($method == 'ipn')\n {\n $sql = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, isenhancementfee, transactionid, projectid\" . $selectextrafields. \"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"',\n paymethod = '\" . $ilance->db->escape_string($gateway) . \"',\n custommessage = '\" . $ilance->db->escape_string($gatewaytxn) . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n if ($res_invoice['isif'] == '1')\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '1' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '0' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" , featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n }\n else if ($res_invoice['isenhancementfee'] == '1')\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isifpaid', $res_invoice['projectid']) == '1' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isifpaid', $res_invoice['projectid']) == '0' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n } \n else if ($res_invoice['isfvf'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['isescrowfee'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n \n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_ipn_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND orderid = '\" . $res_invoice['buynowid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n $resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC);\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => fetch_user('username', intval($userid)),\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n $ilance->email->send();\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->send();\n return true;\n }\n return false;\n }\n // #### ONLINE ACCOUNT HANDLER #########################################\n else if ($method == 'account')\n {\n $sql_balance = $ilance->db->query(\"\n\t\t\t\tSELECT available_balance, total_balance\n\t\t\t\tFROM \" . DB_PREFIX . \"users\n\t\t\t\tWHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_balance) > 0)\n {\n $res_balance = $ilance->db->fetch_array($sql_balance, DB_ASSOC);\n if ($res_balance['available_balance'] >= $amount)\n {\n $avail_balance = $res_balance['available_balance'];\n $total_balance = $res_balance['total_balance'];\n $avail_balance_after = ($avail_balance - $amount);\n $total_balance_after = ($total_balance - $amount);\n $sql_invoice = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, transactionid, isenhancementfee\" . $selectextrafields .\"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_invoice) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql_invoice, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND invoicetype = '\" . $ilance->db->escape_string($invoicetype) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"users\n SET available_balance = '\" . $ilance->db->escape_string($avail_balance_after) . \"',\n total_balance = '\" . $ilance->db->escape_string($total_balance_after) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($res_invoice['isif'])\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isenhancementfeepaid, enhancementfeeinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isenhancementfeepaid'] == '1' AND $res['enhancementfeeinvoiceid'] != '0') OR ($res['isenhancementfeepaid'] == '0' AND $res['enhancementfeeinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isenhancementfee'])\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isifpaid, ifinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isifpaid'] == '1' AND $res['ifinvoiceid'] != '0') OR ($res['isifpaid'] == '0' AND $res['ifinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isfvf'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n if ($res_invoice['isescrowfee'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_account_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT orderid, escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n while ($resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC))\n {\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => $_SESSION['ilancedata']['user']['username'],\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n $ilance->email->mail = $_SESSION['ilancedata']['user']['email'];\n $ilance->email->slng = $_SESSION['ilancedata']['user']['slng'];\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n if ($silentmode)\n {\n return true;\n }\n $area_title = '{_invoice_payment_complete_menu}';\n $page_title = SITE_NAME . ' - {_invoice_payment_complete_menu}';\n print_notice('{_invoice_payment_complete}', '{_your_invoice_has_been_paid_in_full}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n $page_title = SITE_NAME . ' - {_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n print_notice('{_invoice_error}', '{_were_sorry_this_invoice_does_not_exist}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_funds_not_available}';\n $page_title = SITE_NAME . ' - {_funds_not_available}';\n print_notice('{_invoice_payment_warning_insufficient_funds}', '{_were_sorry_this_invoice_can_not_be_paid_due_to_insufficient_funds}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n }\n return false;\n }", "function withdrawal($account, $amount, $id_user) {\r\n\r\n //Crear la conexión\r\n $base = conection();\r\n\r\n //Verificar que el usuario tenga disponible ese dinero\r\n $sql = \"SELECT balance, pending FROM users WHERE id = :id_user\";\r\n\r\n //Preparar consulta\r\n $result = $base->prepare($sql);\r\n\r\n //Ejecutar consulta\r\n $result->execute(array(\":id_user\"=>$id_user));\r\n\r\n //Contar registros encontrados\r\n $count = $result->rowCount();\r\n \r\n //Verificar si se ingresó el registro\r\n if ($count > 0) {\r\n\r\n while ($row=$result->fetch(PDO::FETCH_ASSOC)) {\r\n $balance = $row[\"balance\"];\r\n $pending = $row[\"pending\"];\r\n }\r\n\r\n if ($balance >= $amount) {\r\n\r\n //Restamos el dienro al usuario\r\n $new_balance = $balance - $amount;\r\n $new_pending = $pending + $amount;\r\n \r\n //Actualizamos el balance del usuario y agregamos el dinero pendiente\r\n $sql_new_balance = \"UPDATE `users` SET `balance`= :balance, `pending`= :pending WHERE id = :id_user\";\r\n\r\n //Preparar consulta\r\n $result_new_balance = $base->prepare($sql_new_balance);\r\n\r\n //Ejecutar consulta\r\n $result_new_balance->execute(array(\":balance\"=>$new_balance, \":pending\"=>$new_pending, \":id_user\"=>$id_user));\r\n\r\n //Actualizamos el balance del usuario y agregamos el dinero pendiente\r\n $sql_withdrawal = \"INSERT INTO `withdrawal`(`account`, `amount`, `date`, `id_user`) VALUES (:account, :amount , NOW(), :id_user)\";\r\n\r\n //Preparar consulta\r\n $result_withdrawal = $base->prepare($sql_withdrawal);\r\n\r\n //Ejecutar consulta\r\n $result_withdrawal->execute(array(\":account\"=>$account, \":amount\"=>$amount, \":id_user\"=>$id_user));\r\n\r\n $count_withdrawal = $result_withdrawal->rowCount();\r\n\r\n if ($count_withdrawal > 0) {\r\n\r\n //Enviar email\r\n $msg = \"The user with the id $id_user has requested a withdrawal in the amount of $amount for their Payeer account $account\";\r\n \r\n mail(\"medinahildegar1@gmail.com\", \"New Withdrawal request - $id_user\", $msg);\r\n\r\n return \"<b>Your withdrawal request has been sent</b>\\nIn less than 24 hours your order will be processed\";\r\n }\r\n\r\n }else {\r\n return \"You don't have enough funds\";\r\n }\r\n \r\n }else {\r\n return \"fatal error 3\";\r\n }\r\n\r\n}", "public static function get_stripe_fee( $order = null ) {\n\t\tif ( is_null( $order ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();\n\n\t\t$amount = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, self::META_NAME_FEE, true ) : $order->get_meta( self::META_NAME_FEE, true );\n\n\t\t// If not found let's check for legacy name.\n\t\tif ( empty( $amount ) ) {\n\t\t\t$amount = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, self::LEGACY_META_NAME_FEE, true ) : $order->get_meta( self::LEGACY_META_NAME_FEE, true );\n\n\t\t\t// If found update to new name.\n\t\t\tif ( $amount ) {\n\t\t\t\tself::update_stripe_fee( $order, $amount );\n\t\t\t}\n\t\t}\n\n\t\treturn $amount;\n\t}", "protected function makePayment(){\n\t \n $receiver = Input::get('number');\n $amounttosend = Input::get('amount');\n $currency = Input::get('currency');\n $destinationProvider = Input::get('target');\n $charges = new PlatformCharges($amounttosend, $currency, $destinationProvider);\n $desc = $charges->getReceiverType($destinationProvider);\n $user = User::find(Auth::user()->id);\n \n $transaction = [\n 'Customer' => [\n 'FirstName' => Auth::user()->name,\n 'Street1' => 'Level 5',\n 'Country' => 'US',\n 'Mobile' => Auth::user()->number,\n 'Email' => Auth::user()->email\n ],\n 'Items' => [\n [\n 'SKU' => mt_rand(),\n 'Description' => 'Hybrid Transfer from EWAY to '.$desc.' user',\n 'Quantity' => 1,\n 'UnitCost' => $charges->convertCurrency($currency, 'AUD',$charges->getDueAmount('ew', $destinationProvider)),\n 'Tax' => 100, //$1 applied as charge to every transaction irrespective of the amount transfered\n // Total is calculated automatically\n ]\n ],\n 'Options' => [\n [\n 'Value' => $desc,//Receipient's payement system\n ],\n [\n 'Value' => $receiver, //receiver's details to which to make the due transfer\n ],\n [\n 'Value' => 'AUD', // currency used to make the transfer when sending to the receipient\n ],\n [\n 'Value' =>(0.01 * $amounttosend)\n ]\n ],\n 'Payment' => [\n 'TotalAmount' => $charges->convertCurrency($currency, 'AUD',$charges->getDueAmount('ew', $destinationProvider)) * 100, //$amounttosend,\n 'CurrencyCode' => 'AUD'\n ],\n 'Method' => 'ProcessPayment',\n 'RedirectUrl' => URL::route('dashboard').'/ewayconfirm',\n 'CancelUrl' => URL::route('dashboard').'/ewaycancel',\n 'PartnerID' => EwayController::$_EWAY_CUSTOMER_ID,\n 'TransactionType' => \\Eway\\Rapid\\Enum\\TransactionType::PURCHASE, //normally would be PURCHASE. Modes are MOTO, Recurring\n 'Capture' => true,\n 'LogoUrl' => 'https://izepay.iceteck.com/public/images/logo.png',\n 'HeaderText' => 'Izepay Money Transfer',\n 'Language' => 'EN',\n 'CustomView' => 'BootstrapCerulean', //Bootstrap, BootstrapAmelia, BootstrapCerulean, BootstrapCosmo, BootstrapCyborg, BootstrapFlatly, BootstrapJournal, BootstrapReadable, BootstrapSimplex, BootstrapSlate, BootstrapSpacelab, BootstrapUnited\n 'VerifyCustomerEmail' => true,\n 'Capture' => true,\n 'CustomerReadOnly' => false\n ];\n try{\n $response = $this->client->createTransaction(\\Eway\\Rapid\\Enum\\ApiMethod::RESPONSIVE_SHARED, $transaction);\n //var_dump($response);\n// echo $response->SharedPaymentUrl;\n //sleep(20);\n }catch(Exception $ex){\n return Redirect::route('dashboard')\n\t\t\t \t->with('alertError', 'Debug Error: '.$ex->getMessage());\n }\n //manage response\n \n if (!$response->getErrors()) {\n // Redirect to the Responsive Shared Page\n header('Location: '.$response->SharedPaymentUrl);\n //die();\n } else {\n foreach ($response->getErrors() as $error) {\n //echo \"Response Error: \".\\Eway\\Rapid::getMessage($error).\"<br>\";\n return Redirect::route('dashboard')\n\t\t\t \t ->with('alertError', 'Error! '.\\Eway\\Rapid::getMessage($error));\n }\n }\n\t}", "function sendsms_franchise_shipments($invoices='',$d_total=0)\r\n\t{\r\n\t\t\r\n\t\t$sql_trans = \"select inv.invoice_no,a.id,e.franchise_id,a.itemid,group_concat(b.name) as itemname,concat(b.print_name,'-',b.pnh_id) as print_name,i_orgprice,login_mobile1,i_price,i_coup_discount,i_discount,group_concat(a.quantity) as qty,c.menuid,a.transid,f.franchise_id,f.franchise_name\r\n\t\t\t\t\t\t\tfrom king_invoice inv\r\n\t\t\t\t\t\t\tjoin king_orders a on a.id=inv.order_id\r\n\t\t\t\t\t\t\tjoin king_dealitems b on a.itemid = b.id\r\n\t\t\t\t\t\t\tjoin king_deals c on b.dealid = c.dealid \r\n\t\t\t\t\t\t\tjoin pnh_menu d on d.id = c.menuid \r\n\t\t\t\t\t\t\tjoin king_transactions e on e.transid = a.transid\r\n\t\t\t\t\t\t\tjoin pnh_m_franchise_info f on f.franchise_id = e.franchise_id \r\n\t\t\t\t\t\t\twhere inv.invoice_no in ($invoices)\r\n\t\t\t\t\t\t\tgroup by inv.invoice_no\";\r\n\t\t\r\n\t\t$res_trans = $this->db->query($sql_trans);\r\n\t\r\n\t\t$sms_msg = '';\r\n\t\t$datetime = new DateTime('tomorrow');\r\n\t\t\r\n\t\tif($res_trans->num_rows())\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$fran_shipment_sms = array();\r\n\t\t\t$fran_det = array();\r\n\t\t\t\r\n\t\t\tforeach($res_trans->result_array() as $row_trans)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tif(!isset($fran_shipment_sms[$row_trans['franchise_id']]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$fran_shipment_sms[$row_trans['franchise_id']] = array();\r\n\t\t\t\t\t$fran_det[$row_trans['franchise_id']] = array($row_trans['franchise_name'],$row_trans['login_mobile1']);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t$fran_shipment_sms[$row_trans['franchise_id']][] = \" invoice no(\".$row_trans['invoice_no'].\") with \".$row_trans['print_name'].\" products and \".$row_trans['qty'].\" qty \";\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tforeach($fran_shipment_sms as $fr_id=>$fr_sms_list)\r\n\t\t\t{\r\n\t\t\t\t$sms_msg=\"Dear \".$row_trans['franchise_name'].\", your \".implode(',',$fr_sms_list).\" is shipped successfully, please expect delivery on \".$datetime->format('d/m/Y');\r\n\t\t\t\t$this->erpm->pnh_sendsms($fran_det[$fr_id][1],$sms_msg,$fr_id,0,12);\t\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// Send Notification to TM about Shipment.\r\n\t\t\r\n\t\t$sql = \"select d.employee_id,e.name,d.territory_id,b.franchise_id,franchise_name,contact_no,group_concat(distinct a.invoice_no order by a.invoice_no) as invoices \r\n\t\t\t\t\t\t\tfrom king_invoice a\r\n\t\t\t\t\t\t\tjoin king_transactions b on a.transid = b.transid \r\n\t\t\t\t\t\t\tjoin pnh_m_franchise_info c on c.franchise_id = b.franchise_id \r\n\t\t\t\t\t\t\tjoin m_town_territory_link d on d.territory_id = c.territory_id and d.town_id = 0\r\n\t\t\t\t\t\t\tjoin m_employee_info e on e.employee_id = d.employee_id and job_title = 4 \r\n\t\t\t\t\t\t\twhere invoice_no in ($invoices) \r\n\t\t\t\t\t\tgroup by employee_id,franchise_id \";\r\n\t\t \r\n\t\t\r\n\t\t$res = $this->db->query($sql);\r\n\t\tif($res->num_rows())\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$emp_sms_det = array();\r\n\t\t\t\r\n\t\t\tforeach($res->result_array() as $row)\r\n\t\t\t{\r\n\t\t\t\t//tm employee id \r\n\t\t\t\t\r\n\t\t\t\tlist($emp_mobno,$emp_mobno2) = explode(',',$row['contact_no']); \r\n\t\t\t\t$invlist = explode(',',$row['invoices']);\r\n\t\t\t\t\r\n\t\t\t\t$invlist = array_filter($invlist);\r\n\t\t\t\t$franid = $row['franchise_id'];\r\n\t\t\t\t\r\n\t\t\t\tif(!count($invlist))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(!isset($emp_sms_det[$row['employee_id']]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']] = array();\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']]['employee_id'] = $row['employee_id'];\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']]['name'] = $row['name'];\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']]['contact_no'] = $emp_mobno;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'] = array();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid] = array();\r\n\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid]['fname'] = $row['franchise_name'];\r\n\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid]['trans'] = array();\r\n\t\t\t\t\r\n\t\t\t\tforeach($invlist as $inv)\r\n\t\t\t\t{\r\n\t\t\t\t\t$transid = $this->db->query(\"select transid from king_invoice where invoice_no = ? \",$inv)->row()->transid;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$unshipped_items = @$this->db->query(\"select group_concat(trim(item),' x ',qty) as items from (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tselect a.transid,f.franchise_id,franchise_name,concat(c.print_name,'-',pnh_id) as item,sum(a.quantity) as qty \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfrom king_orders a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tselect distinct transid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfrom shipment_batch_process_invoice_link a \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin proforma_invoices b on a.p_invoice_no = b.p_invoice_no \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere invoice_no in (\".$inv.\") \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) as b on a.transid = b.transid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin king_dealitems c on c.id = a.itemid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin king_deals d on d.dealid = c.dealid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin king_transactions e on e.transid = a.transid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin pnh_m_franchise_info f on f.franchise_id = e.franchise_id \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere a.status = 0 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgroup by a.transid,a.itemid ) as g\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgroup by franchise_id\")->row()->items;\r\n\t\t\t\t\tif(!isset($emp_sms_det[$row['employee_id']]['fran'][$franid]['trans'][$transid]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid]['trans'][$transid] = array('inv_list'=>array(),'unshipped'=>'');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid]['trans'][$transid]['inv_list'][] = $inv;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($unshipped_items)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid]['trans'][$transid]['unshipped'] = $unshipped_items;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tforeach($emp_sms_det as $emp_id=>$emp_ship_det)\r\n\t\t\t{\r\n\t\t\t\t$emp_id = $emp_ship_det['employee_id'];\r\n\t\t\t\t$emp_name = $emp_ship_det['name'];\r\n\t\t\t\t$emp_mob_no = $emp_ship_det['contact_no'];\r\n\t\t\t\t$emp_territory_id = $emp_ship_det['territory_id'];\r\n\t\t\t\t\r\n\t\t\t\t$sms_msg = array();\r\n\t\t\t\t\r\n\t\t\t\tforeach($emp_ship_det['fran'] as $fid=>$fran_trans_det)\r\n\t\t\t\t{\r\n\t\t\t\t\t$total_invoices = 0;\r\n\t\t\t\t\t$fran_inv_list = array();\r\n\t\t\t\t\tforeach($fran_trans_det['trans'] as $transid => $trans_ship_det)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$t_inv_list = array_values($trans_ship_det['inv_list']);\r\n\t\t\t\t\t\t$total_invoices += count($t_inv_list);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$inv_sms = implode(',',$t_inv_list);\r\n\t\t\t\t\t\tif($trans_ship_det['unshipped'])\r\n\t\t\t\t\t\t\t$inv_sms .= ':'.$trans_ship_det['unshipped'];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$fran_inv_list[] = $inv_sms;\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\t$sms_msg[] = \"Shipped \".$total_invoices.\" Invoices for \".($fran_trans_det['fname']).\" (\".implode(',',$fran_inv_list).\")\";\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(count($sms_msg))\r\n\t\t\t\t{\r\n\t\t\t\t\t$sms_text .= implode(',',$sms_msg).\",Storeking\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t//echo $sms_text;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->erpm->pnh_sendsms($emp_mob_no,$sms_text,0,$emp_id);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t//\techo $emp_mob_no,$sms_msg;\r\n\t\t\t\t\t$log_prm=array();\r\n\t\t\t\t\t$log_prm['emp_id']=$emp_id;\r\n\t\t\t\t\t$log_prm['contact_no']=$emp_mob_no;\r\n\t\t\t\t\t$log_prm['type']=4;\r\n\t\t\t\t\t$log_prm['territory_id']=$emp_territory_id;\r\n\t\t\t\t\t$log_prm['town_id']=0;\r\n\t\t\t\t\t$log_prm['grp_msg']=$sms_text;\r\n\t\t\t\t\t$log_prm['created_on']=cur_datetime();\r\n\t\t\t\t\t$this->erpm->insert_pnh_employee_grpsms_log($log_prm);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function testDepositFund($accNumber, $amount, $expected)\n {\n return $this->_testMethod(\n 'depositFund',\n [$amount],\n $expected,\n $accNumber,\n ['balance']\n );\n }", "public function callbackhostedpaymentAction()\n {\n $boError = false;\n $formVariables = array();\n $model = Mage::getModel('paymentsensegateway/direct');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $session = Mage::getSingleton('checkout/session');\n $szPaymentProcessorResponse = '';\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n $boCartIsEmpty = false;\n \n try\n {\n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $formVariables['HashDigest'] = $this->getRequest()->getPost('HashDigest');\n $formVariables['MerchantID'] = $this->getRequest()->getPost('MerchantID');\n $formVariables['StatusCode'] = $this->getRequest()->getPost('StatusCode');\n $formVariables['Message'] = $this->getRequest()->getPost('Message');\n $formVariables['PreviousStatusCode'] = $this->getRequest()->getPost('PreviousStatusCode');\n $formVariables['PreviousMessage'] = $this->getRequest()->getPost('PreviousMessage');\n $formVariables['CrossReference'] = $this->getRequest()->getPost('CrossReference');\n $formVariables['Amount'] = $this->getRequest()->getPost('Amount');\n $formVariables['CurrencyCode'] = $this->getRequest()->getPost('CurrencyCode');\n $formVariables['OrderID'] = $this->getRequest()->getPost('OrderID');\n $formVariables['TransactionType'] = $this->getRequest()->getPost('TransactionType');\n $formVariables['TransactionDateTime'] = $this->getRequest()->getPost('TransactionDateTime');\n $formVariables['OrderDescription'] = $this->getRequest()->getPost('OrderDescription');\n $formVariables['CustomerName'] = $this->getRequest()->getPost('CustomerName');\n $formVariables['Address1'] = $this->getRequest()->getPost('Address1');\n $formVariables['Address2'] = $this->getRequest()->getPost('Address2');\n $formVariables['Address3'] = $this->getRequest()->getPost('Address3');\n $formVariables['Address4'] = $this->getRequest()->getPost('Address4');\n $formVariables['City'] = $this->getRequest()->getPost('City');\n $formVariables['State'] = $this->getRequest()->getPost('State');\n $formVariables['PostCode'] = $this->getRequest()->getPost('PostCode');\n $formVariables['CountryCode'] = $this->getRequest()->getPost('CountryCode');\n \n if(!PYS_PaymentFormHelper::compareHostedPaymentFormHashDigest($formVariables, $szPassword, $hmHashMethod, $szPreSharedKey))\n {\n $boError = true;\n $szNotificationMessage = \"The payment was rejected for a SECURITY reason: the incoming payment data was tampered with.\";\n Mage::log(\"The Hosted Payment Form transaction couldn't be completed for the following reason: [\".$szNotificationMessage. \"]. Form variables: \".print_r($formVariables, 1));\n }\n else\n {\n $paymentsenseOrderId = Mage::getSingleton('checkout/session')->getPaymentsensegatewayOrderId();\n $szOrderStatus = $order->getStatus();\n $szStatusCode = $this->getRequest()->getPost('StatusCode');\n $szMessage = $this->getRequest()->getPost('Message');\n $szPreviousStatusCode = $this->getRequest()->getPost('PreviousStatusCode');\n $szPreviousMessage = $this->getRequest()->getPost('PreviousMessage');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n \n if($szOrderStatus != 'pys_paid' &&\n $szOrderStatus != 'pys_preauth')\n {\n $checkout->saveOrderAfterRedirectedPaymentAction(true,\n $this->getRequest()->getPost('StatusCode'),\n $this->getRequest()->getPost('Message'),\n $this->getRequest()->getPost('PreviousStatusCode'),\n $this->getRequest()->getPost('PreviousMessage'),\n $this->getRequest()->getPost('OrderID'),\n $this->getRequest()->getPost('CrossReference'));\n }\n else \n {\n // cart is empty\n $boCartIsEmpty = true;\n $szPaymentProcessorResponse = null;\n \n // chek the StatusCode as the customer might have just clicked the BACK button and re-submitted the card details\n // which can cause a charge back to the merchant\n $this->_fixBackButtonBug($szOrderID, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage);\n }\n }\n }\n catch (Exception $exc)\n {\n $boError = true;\n $szNotificationMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_183;\n Mage::logException($exc);\n }\n \n $szPaymentProcessorResponse = $session->getPaymentprocessorresponse();\n if($boError)\n {\n if($szPaymentProcessorResponse != null &&\n $szPaymentProcessorResponse != '')\n {\n $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;\n }\n \n $model->setPaymentAdditionalInformation($order->getPayment(), $this->getRequest()->getPost('CrossReference'));\n //$order->getPayment()->setTransactionId($this->getRequest()->getPost('CrossReference'));\n \n if($nVersion >= 1410)\n {\n if($order)\n {\n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Hosted Payment Failed'));\n $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);\n $order->save();\n }\n }\n if($nVersion == 1324 || $nVersion == 1330)\n {\n Mage::getSingleton('checkout/session')->addError($szNotificationMessage);\n }\n else \n {\n Mage::getSingleton('core/session')->addError($szNotificationMessage);\n }\n $order->save();\n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n else\n {\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\n if($boCartIsEmpty == false)\n {\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n if($nVersion >= 1410)\n {\n // TODO : no need to remove stock item as the system will do it in 1.6 version\n if($nVersion < 1600)\n {\n $model->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szPaymentProcessorResponse);\n }\n \n if($nVersion != 1324 && $nVersion != 1330)\n {\n if($szPaymentProcessorResponse != '')\n {\n Mage::getSingleton('core/session')->addSuccess($szPaymentProcessorResponse);\n }\n }\n }\n \n $this->_redirect('checkout/onepage/success', array('_secure' => true));\n }\n }", "function user_update_wallent_balance_confirmation_mail($send_data)\n {\n $to_email_address = $send_data['sender_email'];\n $subject = \"Update Wallet Balance Confirmation E-mail\";\n $message = 'Hi, '.ucfirst($send_data['sender_name']).' <span style=\"font-size:24px\"><b>$'.$send_data['amount'].'</b></span> '.$send_data['message'];\n $data['msg'] = $message;\n $mess = $this->load->view('mailer/email_template', $data, true);\n $result_dfee = $this->common_model->sendEmails($to_email_address, $subject, $mess);\n\n if ($result_dfee) {\n return true;\n } else {\n return false;\n }\n }", "public function processPayment();", "function handleFuturePayPayment(&$input, &$ids, &$objects) {\r\n $recur =& $objects['contributionRecur'];\r\n \r\n // make sure the invoice ids match\r\n // make sure the invoice is valid and matches what we have in the contribution record\r\n if ( $recur->invoice_id != $input['invoice'] ) {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Failure : Invoice values dont match between database and IPN request\");\r\n return false;\r\n }\r\n\r\n $now = date( 'YmdHis' );\r\n \r\n // fix dates that already exist\r\n $dates = array( 'create', 'start', 'end', 'cancel', 'modified' );\r\n foreach ( $dates as $date ) {\r\n $name = \"{$date}_date\";\r\n if ( $recur->$name ) {\r\n $recur->$name = CRM_Utils_Date::isoToMysql( $recur->$name );\r\n }\r\n }\r\n\r\n //contribution_status_id:\r\n //0=Completed,1=Pending,2=Cancelled,3=Overdue,4=Failed,5=InProgress\r\n if ($input['transStatus']=='Y') {//rawAuthMessage=Authorised\r\n // futurepay payment accepted\r\n if ($input['rawAuthMessage']!='Authorised') {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Warning futurepay transStatus=\".$input['transStatus'].\" but rawAuthMessage=\".$input['rawAuthMessage']);\r\n }\r\n if (_getContributionCount($recur)>=$recur->installments) {\r\n // final installement\r\n $recur->contribution_status_id=0;//0=Completed\r\n $recur->end_date=$now;\r\n }\r\n else {\r\n $recur->contribution_status_id=5;//5=In Progress\r\n $recur->modified_date = $now;\r\n }\r\n }\r\n else if ($input['transStatus']=='N') {//rawAuthMessage=Declined\r\n // futurepay payment declined\r\n $recur->contribution_status_id=4;//4=Failed\r\n $recur->end_date = $now;\r\n if ($input['rawAuthMessage']!='Declined') {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Warning futurepay transStatus=\".$input['transStatus'].\" but rawAuthMessage=\".$input['rawAuthMessage']);\r\n }\r\n $checkForEndOfAgreement=false;\r\n }\r\n else if ($input['futurePayStatusChange']=='Merchant Cancelled') {\r\n $recur->contribution_status_id=3;//3= cancelled\r\n $recur->cancel_date = $now;\r\n $input['reasonCode']='FuturePay cancelled by Merchant';\r\n }\r\n else if ($input['futurePayStatusChange']=='Customer Cancelled') {\r\n $recur->contribution_status_id=3;//3= cancelled\r\n $recur->cancel_date = $now;\r\n $input['reasonCode']='FuturePay cancelled by Donor';\r\n }\r\n else {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Unrecognized FuturePay operation. input=\".print_r($input,true));\r\n return false;\r\n }\r\n $recur->save();\r\n \r\n if ($input['transStatus']=='Y') {\r\n // create a new contribution for this recurring contribution\r\n $contributionType = $objects['contributionType'];\r\n $contribution = new CRM_Contribute_DAO_Contribution();\r\n $contribution->domain_id = CRM_Core_Config::domainID( );\r\n $contribution->contact_id = $ids[\"contact\"];\r\n $contribution->contribution_type_id = $contributionType->id;\r\n $contribution->contribution_page_id = $ids['contributionPage'];\r\n $contribution->contribution_recur_id = $ids['contributionRecur'];\r\n $contribution->receive_date = $now;\r\n $contribution->invoice_id = md5( uniqid( rand( ), true ) );\r\n $contribution->total_amount = $input[\"amount\"];\r\n $objects['contribution'] =& $contribution;\r\n \r\n require_once 'CRM/Core/Transaction.php';\r\n $transaction = new CRM_Core_Transaciton();\r\n $this->completeTransaction($input,$ids,$objects,$transaction,true);//true=recurring\r\n // completeTransaction handles the transaction commit\r\n return true;\r\n }\r\n }", "public function hasBoothfee(){\n return $this->_has(6);\n }", "public function testTransactionRequestRejectedByPayerFsp()\n {\n $precondition = Factory::instance(\n 'TransactionRequestRejectedByPayerFsp'\n );\n\n $testdata = $precondition->getData();\n\n $this->assertTrue($testdata['amount'] == 10.1);\n }", "public function verify()\n {\n /**\n * Make a signature temporary\n * Note: each paid has it's own specific signature\n */\n $signature = $this->generate_signature(\n $this->merchant_id,\n $this->bank_receipt,\n $this->invoice_number\n );\n \n // Make proper array of token params\n $params = [\n 'SaleConf_req' => [\n 'MID' => $this->enc($this->merchant_id),\n 'CRN' => $this->enc($this->invoice_number),\n 'TRN' => $this->enc($this->bank_receipt),\n 'SIGNATURE' => base64_encode($signature),\n ],\n ];\n \n // Send params to bank to get token\n $result = $this->call($this->transaction_reference_wsdl, 'sendConfirmation', $params);\n\n if ($result['RESCODE'] == -1)\n throw new BankException('امضا دیچیتال نا معتبر است', -1);\n elseif ($result['RESCODE'] == -2)\n throw new BankException('آدرس IP پذیرنده نا معتبر است', -2);\n elseif (!in_array($result['RESCODE'], [0, 101]))\n throw new BankException(null, $result['RESCODE']); // خطاهای تعریف شده دیگر\n\n\n $data = $result['RESCODE'] . $result['REPETETIVE'] . $result['AMOUNT'] . $result['DATE'] . $result['TIME'] . $result['TRN'] . $result['STAN'];\n\n // State whether signature is okay or not\n $verify_result = openssl_verify($data, base64_decode($result['SIGNATURE']), $this->key_resource);\n\n if ($verify_result == 0)\n throw new BankException('خطای امضای دیجیتال');\n elseif ($verify_result != 1)\n throw new BankException('عدم تطبیق امضا دیجیتال بانک');\n\n /**\n * Result Webservice Array\n * if you need special design for your website, please modify following codes\n */\n if (!empty($result['RESCODE'])) {\n // success\n if (($result['RESCODE'] == '00') && ($result['successful'] == true)) {\n return new SaderatResult(\n true, // success\n $this->getInvoiceNumber(),\n $this->getBankReceiptNumber(),\n false // repetitive\n );\n } // cancel\n elseif ($result['RESCODE'] == 101) {\n throw new RepetitiveException(\n $this->getInvoiceNumber(),\n $this->getBankReceiptNumber()\n );\n } // cancel\n elseif ($result['RESCODE'] == 200) {\n throw new BankException('تراکنش توسط کاربر کنسل شده است');\n } // cancel\n elseif ($result['RESCODE'] == 107) {\n throw new BankException(null, 107);\n } // other problem\n elseif (!empty($result['description']))\n throw new BankException($result['description']);\n\n } else\n throw new BankException('درخواست نامعتبر است');\n\n }", "function cf_order_valid_amount($params)\n\t{\n\t\t/* Insert: (grand_total - plan_total) < new_amount => error */\n\t\t/* Update: (grand_total - sum(plan_amount except current id)) < new_amount => error */\n\t\t$params = is_array($params) ? (object) $params : $params;\n\t\tif (! isset($params->order_id) && !$params->order_id)\n\t\t\treturn false;\n\t\t\n\t\t$id = isset($params->id) && $params->id ? 'and t2.id <> '.$params->id : '';\n\t\t$order_id = $params->order_id;\n\t\tif (isset($params->is_plan) && $params->is_plan) {\n\t\t\t// $str = \"SELECT grand_total,\n\t\t\t\t// (\n\t\t\t\t\t// select coalesce(sum(amount),0) from cf_order_plan t2 where t2.is_active = '1' and t2.is_deleted = '0' and t2.order_id = t1.id $id\n\t\t\t\t// ) as plan_total \n\t\t\t\t// from cf_order t1 where t1.id = $order_id\";\n\t\t\t$str = \"SELECT (grand_total - (select coalesce(sum(amount),0) from cf_order_plan t2 where t2.is_active = '1' and t2.is_deleted = '0' and t2.order_id = t1.id $id)) as amount \n\t\t\t\tfrom cf_order t1 where t1.id = $order_id\";\n\t\t}\n\t\t$row = $this->db->query($str)->row();\n\t\t// if ($row->grand_total - $row->plan_total - $params->amount < 0) {\n\t\tif ($row->amount - $params->amount < 0) {\n\t\t\t// $this->session->set_flashdata('message', $row->grand_total - $row->plan_total);\n\t\t\t$this->session->set_flashdata('message', $row->amount);\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t\t// if ($row->grand_total - $row->plan_total < $params->amount)\n\t}", "public function createExtern(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'receiver.account' => ['required', 'regex:/^[A-Z]{3}[0-9]{6}(DZD|EUR|USD)$/'],\n 'receiver.name' => 'required|max:255',\n 'receiver.bank' => 'required|regex:/^[A-Z]{3}$/|exists:banks,code',\n 'amount' => 'required|numeric|min:0',\n 'reason' => 'required|max:255',\n ]);\n $validator->sometimes('justification', 'required', function ($input) {//todo\n return $input->amount > 200000; // Amount \"Depasse\" 200 000\n });\n if ($validator->fails()) {\n return response($validator->errors(), config('code.BAD_REQUEST'));\n }\n\n\n $amount = $request->input('amount');\n $hasEnoughMoney = false;\n /**start transaction**/\n DB::beginTransaction();\n\n try {\n\n $senderAccount = $this->client()->accounts()\n ->courant()->first();//todo check methode first()\n\n\n //check the amount\n if (!$senderAccount->hasEnoughMoney($amount)) throw new \\Exception;\n $hasEnoughMoney = true;\n\n\n //create the transfer\n $commission = config('commission.SENDEXTBANK') * $amount;\n $now = \\Carbon\\Carbon::now();\n $virement_code = $senderAccount->number . $request->input('receiver.account') . $now->format('YmdHi');\n if ($amount > 200000) {\n $transferDate = null;\n $creationDate = $now->format('Y-m-d H:i:s');\n $status = 'traitement';\n } else {\n //generate the XML file that will be treated later equivalent to send money\n $xmlBody = View::make('xml_transfer_template', [\n \"code\" => $virement_code,\n \"date\" => $now->format('YmdHis'),\n \"senderName\" => $this->client()->firstname . ' ' . $this->client()->lastname,\n \"senderAccount\" => $senderAccount->number,\n \"receiverName\" => $request->input('receiver.name'),\n \"receiverBank\" => $request->input('receiver.bank'),\n \"receiverAccount\" => $request->input('receiver.account'),\n \"amount\" => $amount,\n \"reason\" => $request->input('reason'),\n ])->render();\n $xmlBody = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . $xmlBody;\n\n Storage::disk('xml_out')->put($virement_code . '.xml', $xmlBody);\n\n $status = 'valide';\n $transferDate = $creationDate = $now->format('Y-m-d H:i:s');\n }\n ExternTransfer::create([\n 'code' => $virement_code,\n 'amount' => $amount,\n 'justification' => $request->input('justification'),\n 'reason' => $request->input('reason'),\n 'transferDate' => $transferDate,\n 'creationDate' => $creationDate,\n 'status' => $status,\n 'commission' => $commission,\n 'intern_account_id' => $senderAccount->number,\n 'direction' => 'out',\n 'extern_account_name' => $request->input('receiver.name'),\n 'extern_account_number' => $request->input('receiver.account'),\n 'extern_bank' => $request->input('receiver.bank'),\n ]);\n\n\n //todo send commission to Tharwa account\n //we retrieve the amount from the sender account\n $senderAccount->balance = $senderAccount->balance - $commission - $amount;\n $senderAccount->save();\n\n $nb = BalanceHistory::count();//todo fix this !all sol tested! re-migrate DB\n //sender history\n BalanceHistory::create([\n 'id' => $nb + 1,\n 'amount' => $amount + $commission,\n 'transaction_type' => 'transf',\n 'transaction_direction' => 'out',\n 'account_id' => $senderAccount->number,\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n\n// Mail::to($request->input('email'))\n// ->queue(new ClientRequestValidatedMail($acceptedClient->firstname.' '.$acceptedClient->lastname\n// , $request->input('code')));\n\n // all good\n /**commit - no problems **/\n DB::commit();\n return response([\"saved\" => true], config('code.CREATED'));\n\n } catch (\\Exception $e) {\n\n // something went wrong\n /**rollback every thing - problems **/\n DB::rollback();\n\n if (!$hasEnoughMoney)\n return response([\"amount\" => false], config('code.NOT_FOUND'));\n\n return response([\"saved\" => false], config('code.UNKNOWN_ERROR'));\n }\n\n }", "public function calculFrais()\n {\n $frais = $this->compteModel->calculTaxe($this->utils->securite_xss($_POST['montant']), $this->utils->securite_xss($_POST['service']));\n if ($frais > 0) echo $frais;\n else if ($frais == 0) echo 0;\n else echo -2;\n }", "public function confirm() {\r\n\r\n\t\t$json = array();\r\n\t\tif ($this->session->data['payment_method'] == 'coinremitter') {\r\n\t\t\t\r\n\t\t\tif($this->request->post['coin'] != ''){\r\n\r\n\t\t\t\t$this->load->model('extension/coinremitter/payment/coinremitter');\r\n\r\n\t\t\t\t/*** Get wallet data from 'oc_coinremitter_wallet' with use of `coin` ***/\r\n\t\t\t\t$coin = $this->request->post['coin'];\r\n\t\t\t\t$wallet_info = $this->model_extension_coinremitter_payment_coinremitter->getWallet($coin);\r\n\r\n\t\t\t\tif($wallet_info){\r\n\r\n\t\t\t\t\t$api_key = $wallet_info['api_key'];\r\n\t\t\t\t\t$api_password = $wallet_info['password'];\r\n\t\t\t\t\t$exchange_rate = $wallet_info['exchange_rate_multiplier'];\r\n\r\n\t\t\t\t\t$address_data =[\r\n\t\t\t\t\t\t'url' => 'get-new-address',\r\n\t\t\t\t\t\t'coin' => $coin,\r\n 'api_key' =>$api_key,\r\n 'password' => $api_password\r\n ];\r\n\t\t\t\t\t// print_r($this->obj_curl);\r\n\t\t\t\t\t// die;\r\n // die($this->obj_curl);\r\n $address_res = $this->obj_curl->commonApiCall($address_data);\r\n \r\n if(!empty($address_res) && isset($address_res['flag']) && $address_res['flag'] == 1){\r\n\r\n \t$this->load->model('checkout/order');\r\n\t\t\t\t\t\t$orderId = $this->session->data['order_id'];\r\n\t\t\t\t\t\t$order_cart = $this->model_checkout_order->getOrder($orderId);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Convert amount format in actual currency.\r\n\t\t\t\t\t\t/*** Opencart saves amount in USD only. So you need to covert amount for other currency. Below function converts amount in selected(base) currency. It also work for USD, so no need any other condition for USD ***/\r\n\t\t\t\t\t\t$order_total = $this->currency->format($order_cart['total'], $order_cart['currency_code'], $order_cart['currency_value'],false);\r\n\r\n\t\t\t\t\t\tif ($exchange_rate == 0 || $exchange_rate == '') {\r\n\t\t\t\t\t\t\t$exchange_rate = 1;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$amount = $order_total * $exchange_rate;\r\n\t\t\t\t\t\t$currency_type = $order_cart['currency_code'];\r\n\r\n \t//now convert order's fiat amount to crypto amount with use of get-fiat-to-crypto-rate api in coinremitter \r\n\r\n \t$fiat_amount_arr = [\r\n \t\t'url' => 'get-fiat-to-crypto-rate',\r\n \t\t'coin' => $coin,\r\n \t\t'api_key' =>$api_key,\r\n \t'password' => $api_password,\r\n \t'fiat_symbol' => $currency_type,\r\n \t'fiat_amount' => $amount\r\n \t];\r\n\r\n \t$fiat_to_crypto_res = $this->obj_curl->commonApiCall($fiat_amount_arr);\r\n\r\n \tif(!empty($fiat_to_crypto_res) && isset($fiat_to_crypto_res['flag']) && $fiat_to_crypto_res['flag'] == 1){\r\n\r\n \t\t\t$address_data = $address_res['data'];\r\n \t\t\t$fiat_to_crypto_res = $fiat_to_crypto_res['data'];\r\n\t\t \t$amountusd = $order_cart['total'];\r\n\t\t \t$crp_amount = $fiat_to_crypto_res['crypto_amount'];\r\n\t\t \t$address = $address_data['address'];\r\n\t\t \t$qr_code = $address_data['qr_code'];\r\n\r\n\t\t $order_data = array(\r\n\t\t \t'order_id' \t\t=> $orderId,\r\n\t\t \t'invoice_id' \t=> '' ,\r\n\t\t \t'amountusd' \t=> $amountusd,\r\n\t\t \t'crp_amount' \t=> $crp_amount,\r\n\t\t \t'payment_status'=> 'pending',\r\n\t\t \t'address' \t\t=> $address,\r\n\t\t \t'qr_code'\t\t=> $qr_code\r\n\t\t );\r\n\r\n\t\t \t/*** Now, insert detail in `oc_coinremitter_order` ***/\r\n\t\t \t$this->model_extension_coinremitter_payment_coinremitter->addOrder($order_data);\r\n\r\n\t\t \t/*** Now, insert detail in `oc_coinremitter_payment` ***/\r\n\t\t \t$invoice_expiry = (int)$this->config->get('payment_coinremitter_invoice_expiry');\r\n\r\n\t\t\t\t\t\t\t\tif($invoice_expiry == 0){\r\n\t\t\t\t\t\t\t\t\t$expire_on = '';\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t$newtimestamp = strtotime(date('Y-m-d H:i:s').' + '.$invoice_expiry.' minute');\r\n\t\t\t\t\t\t\t\t\t$expire_on = date('Y-m-d H:i:s', $newtimestamp);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$total_amount = array(\r\n\t\t\t\t\t\t\t\t\t$coin => $crp_amount,\r\n\t\t\t\t\t\t\t\t\t'USD' => $amountusd,\r\n\t\t\t\t\t\t\t\t\t$order_cart['currency_code'] => $order_total\r\n\t\t\t\t\t\t\t\t);\r\n\t\t $payment_data = array(\r\n\t\t \t'order_id' \t\t=> \t$orderId,\r\n\t\t 'invoice_id'\t=>\t'',\r\n\t\t 'address'\t\t=> \t$address,\r\n\t\t 'invoice_name'\t=>\t'',\r\n\t\t 'marchant_name'\t=>\t'',\r\n\t\t 'total_amount'\t=>\tjson_encode($total_amount),\r\n\t\t 'paid_amount'\t=>\t'',\r\n\t\t 'base_currancy'\t=>\t$currency_type,\r\n\t\t 'description'\t=>\t'Order Id #'.$orderId,\r\n\t\t 'coin'\t\t\t=>\t$coin,\r\n\t\t 'payment_history'=> '',\r\n\t\t 'conversion_rate'=> '',\r\n\t\t 'invoice_url'\t=>\t'',\r\n\t\t 'status'\t\t=>\t'Pending',\r\n\t\t 'expire_on'\t\t=>\t$expire_on,\r\n\t\t 'created_at'\t=>\tdate('Y-m-d H:i:s')\r\n\t\t );\r\n\r\n\t\t $this->model_extension_coinremitter_payment_coinremitter->addPayment($payment_data);\r\n\r\n\t\t $enc_order_id = urlencode($this->obj_curl->encrypt($orderId)); // order id in encryption format\r\n\t\t $invoice_url = $this->url->link('extension/coinremitter/module/coinremitter_invoice|detail&order_id='.$enc_order_id,'',true);\r\n\r\n\t\t \t/*** Update order history status to pending, add comment ***/\r\n\t\t $comments = 'View order <a href=\"'.$invoice_url.'\">#' . $orderId . '</a> ';\r\n\t\t $is_customer_notified = true;\r\n\t\t $this->model_checkout_order->addHistory($orderId, 1, $comments, $is_customer_notified); \r\n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t// 1 = Pending\r\n\r\n\t\t\t\t\t\t\t\t$json = array();\r\n\t\t\t\t\t\t\t\t$json['flag'] = 1; \r\n\t\t\t\t\t\t\t\t$json['redirect'] = $invoice_url;\r\n\r\n \t}else{\r\n \t\t$msg = 'Something went wrong while converting fiat to crypto. Please try again later';\r\n\t \tif(isset($fiat_to_crypto_res['msg']) && $fiat_to_crypto_res['msg'] != ''){\r\n\t \t\t$msg = $fiat_to_crypto_res['msg'];\r\n\t \t}\r\n\t \t$json['flag'] = 0;\r\n\t\t\t\t\t\t\t$json['msg'] = $msg;\r\n \t}\r\n\r\n }else{\r\n \t$msg = 'Something went wrong while creating address. Please try again later';\r\n \tif(isset($address_res['msg']) && $address_res['msg'] != ''){\r\n \t\t$msg = $address_res['msg'];\r\n \t}\r\n \t$json['flag'] = 0;\r\n\t\t\t\t\t\t$json['msg'] = $msg;\r\n }\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t$json['msg'] = 'Selected wallet not found. Please try again later';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t$json['msg'] = 'Selected coin not found. Please try again later';\t\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$json['flag'] = 0;\r\n\t\t\t$json['msg'] = 'Please select Coinremitter as payment method';\r\n\t\t}\r\n\t\t$this->response->addHeader('Content-Type: application/json');\r\n\t\t$this->response->setOutput(json_encode($json));\t\t\r\n\t}", "public function actionSendToHub()\n {\n $paymentAddresses = PaymentAddressQueryLibrary::getWithFunds();\n\n $paymentAddressService = new PaymentAddressService();\n foreach ($paymentAddresses as $paymentAddress) {\n try {\n if ($paymentAddressService->sendToHub($paymentAddress)) {\n $this->stdout('Funds transferred from temporary address to hub address. | ID: ' . $paymentAddress->id . \" | Hex: \" . $paymentAddressService->getTransactionHex() . \" |\\n\" . PHP_EOL, Console::FG_YELLOW);\n }\n }\n catch (Exception $exception) {\n $this->stdout('Error occurred. | ID: ' . $paymentAddress->id . \" |\\n\" . PHP_EOL, Console::FG_RED);\n }\n }\n return true;\n }", "function process_payment($order_number, $order_total, &$d) {\n return true;\n }", "function cf_cashbank_valid_amount($params)\n\t{\n\t\t/* Update: (grand_total - sum(plan_amount except current id)) < new_amount => error */\n\t\t$params = is_array($params) ? (object) $params : $params;\n\t\t// debug($params);\n\t\t\n\t\t$id = isset($params->id) && $params->id ? 'and t2.id <> '.$params->id : '';\n\t\t$invoice_id = $params->invoice_id;\n\t\t$str = \"SELECT (net_amount - (select coalesce(sum(amount),0) from cf_cashbank_line t2 where t2.is_active = '1' and t2.is_deleted = '0' and t2.invoice_id = t1.id $id)) as amount \n\t\t\tfrom cf_invoice t1 where t1.id = $invoice_id\";\n\t\t$row = $this->db->query($str)->row();\n\t\tif ($row->amount - $params->amount < 0) {\n\t\t\t$this->session->set_flashdata('message', $row->amount);\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "public function get_restaurant_list_fees () {\n\t\t\n\t\t$restaurantIDString = $this->get_param('post.restaurant_id_list');\n\t\t$deliveryRegionID = $this->get_param('post.delivery_region_id');\n\t\t\n\t\t$extraFee = M('restaurant')\n\t\t\t->where('`id` in (' . $restaurantIDString . ')')\n\t\t\t->field('sum(`extra_fee`) as extra_fee')\n\t\t\t->find();\n\t\t\n\t\tif (!$extraFee) {\n\t\t\t$extraFee = \"0\";\n\t\t} else {\n\t\t\t$extraFee = $extraFee['extra_fee'];\n\t\t}\n\t\t\n\t\t\n\t\t$deliveryFee = M('restaurant_deliver_fee')\n\t\t\t->where(\"`region_id` = $deliveryRegionID and `restaurant_id` in ( $restaurantIDString ) \")\n\t\t\t->select();\n\t\t\n\t\t$this->return_data(['extra_fee' => $extraFee, 'delivery_fee' => $deliveryFee]);\n\t}", "public function testXEMFeeComputation()\n {\n // sending 250000 XEM reaches the maximum fee\n $amount = new Amount([\"amount\" => 260*1000]);\n\n $expectFee = Fee::MAX_AMOUNT_FEE;\n $actualFee = Fee::calculateForXEM($amount->toMicro());\n\n $this->assertEquals(260000, $amount->toMicro());\n $this->assertEquals($expectFee, $actualFee);\n }", "public function testGetContractFees(): void\n {\n $apiManager = $this->createApiManager(\n [\n 'action' => 'debit',\n 'created_at' => '2019-02-25T05:43:31Z',\n 'currency' => 'AUD',\n 'ewallet' => [\n 'created_at' => '2019-02-24T23:34:11Z',\n 'currency' => 'AUD',\n 'id' => '6e967a8e9971aab24d2db4e932ca1a06',\n 'pan' => 'Y...K8Y7',\n 'primary' => true,\n 'reference' => 'YNGANFK8Y7',\n 'type' => 'ewallet',\n 'updated_at' => '2019-02-24T23:34:11Z',\n 'user' => [\n 'created_at' => '2019-02-24T23:34:11Z',\n 'email' => 'examples@user.test',\n 'id' => '3T93F7TXCVGX4ZV7AFW2',\n 'updated_at' => '2019-02-24T23:34:11Z',\n ],\n ],\n 'fixed_fee' => '0.02',\n 'group' => 'Mastercard',\n 'type' => 'contract',\n 'updated_at' => '2019-02-26T03:19:03Z',\n 'user' => [\n 'created_at' => '2019-02-24T23:34:11Z',\n 'email' => 'examples@user.test',\n 'id' => '3T93F7TXCVGX4ZV7AFW2',\n 'updated_at' => '2019-02-24T23:34:11Z',\n ],\n 'variable_rate' => '0.10',\n ],\n 201\n );\n\n /** @var \\EoneoPay\\PhpSdk\\Endpoints\\Users\\Contract $contract */\n $contract = $apiManager->findOneBy(\n Contract::class,\n (string)\\getenv('PAYMENTS_API_KEY'),\n ['userId' => '3T93F7TXCVGX4ZV7AFW2']\n );\n\n self::assertSame('0.10', $contract->getVariableRate());\n self::assertSame('Mastercard', $contract->getGroup());\n self::assertSame('AUD', $contract->getCurrency());\n self::assertSame('0.02', $contract->getFixedFee());\n self::assertSame('debit', $contract->getAction());\n self::assertInstanceOf(User::class, $contract->getUser());\n self::assertInstanceOf(Ewallet::class, $contract->getEwallet());\n }", "public function pay($moneyBookersTransactionId, $toEmail, $amount){\n if($this->prepearePayment($moneyBookersTransactionId, $toEmail, $amount)){\n return $this->transfer();\n }else {\n return false;\n }\n }", "public function sendConfirmed($payment_address_id, $destination, $quantity, $asset, $fee=null, $dust_size=null, $request_id=null) {\n return $this->sendFromAccount($payment_address_id, $destination, $quantity, $asset, 'default', false, $fee, $dust_size, $request_id);\n }", "private function depositToWallet() {\n # there is not api_limited_quota/cashier_quota msg\n # transfer function has to return error_code and error_msg\n }", "public function calculateshipping(Request $request)\n {\n $pickUp = $request->pickup;\n $pickupState = $request->pickupState;\n $dropOff = $request->dropoff;\n $dropoffState = $request->dropoffState;\n $totalShipping = 0;\n $finalShipping = 0;\n if (!empty($pickUp)) {\n $PickUpresult = DB::table($this->DBTables['Shipping'].' as shp')\n ->join($this->DBTables['Regions'].' as reg', 'reg.id', '=', 'shp.region_id')\n ->where([['reg.stateid', '=', $pickupState],['shp.postcode', '=', $pickUp]])\n ->select('shp.id', 'shp.postcode', 'shp.shipping_cost', 'shp.suburb', 'reg.region')\n ->get();\n if (count($PickUpresult) > 0) {\n $totalShipping = $totalShipping + $PickUpresult[0]->shipping_cost;\n }else{\n $totalShipping = $totalShipping + 50;\n }\n }\n if (!empty($dropOff)) {\n $DropOffresult = DB::table($this->DBTables['Shipping'].' as shp')\n ->join($this->DBTables['Regions'].' as reg', 'reg.id', '=', 'shp.region_id')\n ->where([['reg.stateid', '=', $dropoffState],['shp.postcode', '=', $dropOff]])\n ->select('shp.id', 'shp.postcode', 'shp.shipping_cost', 'shp.suburb', 'reg.region')\n ->get();\n if (count($DropOffresult) > 0) {\n $totalShipping = $totalShipping + $DropOffresult[0]->shipping_cost;\n }else{\n $totalShipping = $totalShipping + 50;\n }\n }\n $freightPrice = Config::get('constants.FreightPrice');\n if ($totalShipping > $freightPrice) {\n $finalShipping = $totalShipping - $freightPrice;\n }\n return $finalShipping;\n }", "public function order_paid_callback()\n {\n\n $query = $this->db->get('paid_orders_cache');\n if ($query->num_rows() == 0)\n return FALSE;\n\n $paid = $query->result_array();\n $coin = $this->bw_config->currencies[0];\n\n $this->load->model('transaction_cache_model');\n $this->load->model('accounts_model');\n\n foreach ($paid as $record) {\n $order = $this->get($record['order_id']);\n $vendor_address = $order['vendor_payout'];\n $admin_address = BitcoinLib::public_key_to_address($order['public_keys']['admin']['public_key'], $coin['crypto_magic_byte']);\n\n // Create the transaction outputs\n $tx_outs = array($admin_address => (string)number_format(($order['fees'] + $order['extra_fees'] - 0.0001), 8),\n $vendor_address => (string)number_format(($order['price'] + $order['shipping_costs'] - $order['extra_fees']), 8));\n\n $create_spend_transaction = $this->create_spend_transaction($order['address'], $tx_outs, $order['redeemScript']);\n if ($create_spend_transaction == TRUE) {\n $next_progress = ($order['vendor_selected_escrow'] == '1') ? '4' : '3';\n $this->progress_order($order['id'], '2', $next_progress, array('paid_time' => time()));\n } else {\n //$this->log_model->\n }\n $this->transaction_cache_model->delete_finalized_record($order['id']);\n }\n }" ]
[ "0.65619224", "0.58337325", "0.5732411", "0.5706129", "0.56630474", "0.5661716", "0.55193466", "0.55151665", "0.5508935", "0.5507551", "0.5475383", "0.5453625", "0.5445204", "0.54421234", "0.5417786", "0.5413777", "0.53509694", "0.53378785", "0.53270173", "0.52974886", "0.5289545", "0.5271566", "0.5270758", "0.5266104", "0.5255273", "0.5255252", "0.5251392", "0.5244892", "0.5240555", "0.52262527", "0.5170676", "0.51697785", "0.516693", "0.5166417", "0.5160156", "0.51518345", "0.5135143", "0.51344186", "0.51338464", "0.5123816", "0.5119409", "0.510575", "0.5096167", "0.5095858", "0.50957376", "0.5094301", "0.5090973", "0.50846815", "0.50760025", "0.5062447", "0.5053018", "0.5051438", "0.50500625", "0.5046514", "0.5043767", "0.50432926", "0.5043205", "0.5036277", "0.50357413", "0.50281054", "0.50194633", "0.50093675", "0.50071204", "0.500357", "0.49954712", "0.49863458", "0.49829555", "0.49827075", "0.49787217", "0.49764156", "0.49714327", "0.49682972", "0.49666095", "0.49633145", "0.49628237", "0.49606174", "0.49595684", "0.4957142", "0.49511212", "0.49506837", "0.49482265", "0.49470606", "0.49446306", "0.49443746", "0.49435973", "0.49426675", "0.49352384", "0.4934831", "0.49341622", "0.49309054", "0.49270248", "0.49235237", "0.49227968", "0.49226025", "0.49195883", "0.49185094", "0.49083537", "0.48998502", "0.4896732", "0.48944145", "0.48941785" ]
0.0
-1
estimates the fee for sending funds from the given payment address confirmed funds are sent first if they are available
public function estimateFeeFromAccount($priority, $payment_address_id, $destination, $quantity, $asset, $account='default', $unconfirmed=false, $dust_size=null) { $body = [ 'destination' => $destination, 'quantity' => $quantity, 'asset' => $asset, 'sweep' => false, 'unconfirmed' => $unconfirmed, 'account' => $account, ]; if ($dust_size !== null) { $body['dust_size'] = $dust_size; } $result = $this->newAPIRequest('POST', '/estimatefee/'.$payment_address_id, $body); if (isset($result['fees'][$priority])) { return new Quantity($result['fees'][$priority.'Sat']); } return new Quantity(intval($priority) * $result['size']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function calculate_fee() {\n // Only delivery incurs a fee\n if ($this->type == 'delivery') {\n if ($this->distance > $this->Seller->Delivery->free_distance) {\n if ($this->Seller->Delivery->pricing_rate == 'per-mile') {\n $fee = number_format($this->Seller->Delivery->fee * ($this->distance - $this->Seller->Delivery->free_distance), 0);\n } else {\n $fee = number_format($this->Seller->Delivery->fee, 0);\n }\n } \n }\n \n // For everything else, charge $0 (and check for non-chargeable values)\n $this->fee = ((isset($fee) && $fee >= 1) ? $fee : 0);\n\n $this->update([\n 'fee' => $this->fee\n ]);\n }", "protected function _addPaymentFeeLine()\n {\n if (Mage::helper('core')->isModuleEnabled('Afterpay_Afterpayfee'))\n {\n $paymentFee = (float) $this->_order->getAfterpayfeeAmount();\n \n if (!empty($paymentFee)) {\n $paymentFeeLine = array(\n 'articleDescription' => Mage::getStoreConfig('afterpay/afterpay_afterpayfee/afterpayfee_label', $this->_order->getStoreId()),\n 'articleId' => 'FEE',\n 'unitPrice' => round($paymentFee * 100, 0),\n 'vatCategory' => 1,\n 'quantity' => 1,\n );\n \n return $paymentFeeLine;\n }\n }\n \n // Check if Fooman Surcharge is used for service fee\n if (Mage::helper('core')->isModuleEnabled('Fooman_Surcharge'))\n {\n $paymentFee = $this->_order->getFoomanSurchargeAmount() + $this->_order->getFoomanSurchargeTaxAmount();\n \n if (!empty($paymentFee)) {\n $paymentFeeLine = array(\n 'articleDescription' => $this->_order->getFoomanSurchargeDescription(),\n 'articleId' => 'FEE',\n 'unitPrice' => round($paymentFee * 100, 0),\n 'vatCategory' => 1,\n 'quantity' => 1,\n );\n \n return $paymentFeeLine;\n }\n }\n \n // Check if Mageworx Multifees is used for service fee\n if (Mage::helper('core')->isModuleEnabled('MageWorx_MultiFees'))\n {\n $paymentFee = (float) ($this->_order->getMultifeesAmount());\n \n if (!empty($paymentFee)) {\n $paymentFeeLine = array(\n 'articleDescription' => 'Extra kosten',\n 'articleId' => 'FEE',\n 'unitPrice' => round($paymentFee * 100, 0),\n 'vatCategory' => 1,\n 'quantity' => 1,\n );\n \n return $paymentFeeLine;\n }\n }\n \n return false;\n }", "function dsf_send_sagepay_mail($savedorder, $address_confirmations=''){\nglobal $basket, $customer_id, $payment, $currencies;\n\n\t\t\t\t\t$good_mail_id = '3';\n\t\t\t\t\t$bad_mail_id = '6';\n\n\n\t\t\t\t\tif ($address_confirmations == 'OK'){ // status OK and addresses OK\n\t\t\t\t\t\t\n\t\t\t\t\t\t$email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $good_mail_id .\"'\");\n\t\t\t\t\t }elseif (MODULE_PAYMENT_PROTXCC_CHECK_ADDRESS == 'false'){\n\t\t\t\t\t\t$email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $good_mail_id .\"'\");\n\t\t\t\t\t}elseif ($address_confirmations == 'ALLOW'){ // status OK Adress failed under threshold.\n\t\t\t\t\t\t$email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $good_mail_id .\"'\");\n\t\t\t\t\t }else{\n\t\t\t\t\t $email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $bad_mail_id .\"'\");\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\n// lets start with the email confirmation\n\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t$email_details = dsf_db_fetch_array($email_query);\n\t\t\t\t\t\t\t\t\t\t$signature_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='1'\");\n\t\t\t\t\t\t\t\t\t $signature_details = dsf_db_fetch_array($signature_query);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_subject = $email_details['subject'];\n\t\t\t\t\t\t\t\t\t $email_footer = $signature_details['details'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// overwrite subject as per Christian emails 2011-09-28\n\t\t\t\t\t\t\t\t\t $email_subject = TRANSLATION_EMAIL_YOUR_ORDER . ' ' . SAP_ORDER_PREFIX . $savedorder->info['id'];\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// plain text;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order = TRANSLATION_WORD_DEAR . ' ' . $savedorder->customer['name'] . \"\\n\\n\" . $email_details['details'] . \"\\n\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t// get products ordered by doing email function.\n\t\t\t\t\t\t\t\t\t $products_ordered = dsf_order_email_items($savedorder, 'true');\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order .= $products_ordered['plain'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order .= \"\\n\" .EMAIL_SEPARATOR .\"\\n\" . $email_footer;\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \t\t// html\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $html_order = TRANSLATION_WORD_DEAR . ' ' . $savedorder->customer['name'] . \"<br /><br />\";\n\t\t\t\t\t\t\t\t\t $html_order .= $email_details['details'] . \"<br /><br />\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $html_order .= $products_ordered['html'] . '<br /><br />';\n\t\t\t\t\t\t\t\t\t $html_order .= $email_footer;\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order = str_replace(\"[ORDER_NUMBER]\" , SAP_ORDER_PREFIX . $savedorder->info['id'], $email_order);\n\t\t\t\t\t\t\t\t\t $html_order = str_replace(\"[ORDER_NUMBER]\" , SAP_ORDER_PREFIX . $savedorder->info['id'], $html_order);\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t // end of email.\n\t\t\t\t\t\t \n\n\n \n\t\t\t\t\t dsf_send_email($savedorder->customer['name'], $savedorder->customer['email_address'], $email_subject, $email_order, STORE_OWNER, EMAIL_FROM,$html_order);\n\t\t\t\t\t\n\t\t\t\t\t// send emails to other people\n\t\t\t\t\t if (SEND_EXTRA_ORDER_EMAILS_TO != '') {\n\t\t\t\t\t\tdsf_send_email(STORE_OWNER, SEND_EXTRA_ORDER_EMAILS_TO, $email_subject, $email_order, STORE_OWNER, EMAIL_FROM,$html_order);\n\t\t\t\t\t }\n\n\n\t\t\t\t\t// send emails to other people\n\t\t\t\t\t if (SEND_EXTRA_ORDER_EMAILS_DUPLICATE != '') {\n\t\t\t\t\t\tdsf_send_email(STORE_OWNER, SEND_EXTRA_ORDER_EMAILS_DUPLICATE, $email_subject, $email_order, STORE_OWNER, EMAIL_FROM,$html_order);\n\t\t\t\t\t }\n\n\n\n\n\n// just for consistancy.\n\nreturn true;\n\n\n\n\n}", "public function askForFeeConfirmation()\n {\n }", "function compute_withdrawing_fee($amount)\n{\n $fee = 0;\n if (!is_null($amount) && $amount > 0)\n {\n if ($amount < 20000)\n {\n $fee = 1;\n }\n else if ($amount < 50000)\n {\n $fee = 3;\n }\n else\n {\n $fee = 5;\n }\n }\n return $fee;\n}", "function edd_wallet_add_funds( $payment_id ) {\n\t$fees = edd_get_payment_fees( $payment_id );\n\n\tif( $fees && count( $fees ) == 1 ) {\n\t\tif( $fees[0]['id'] == 'edd-wallet-deposit' ) {\n\n\t\t\t// Disable purchase receipts... we send our own emails\n\t\t\tremove_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999 );\n\n\t\t\t// Send our custom emails\n\t\t\tedd_wallet_send_email( 'user', $payment_id );\n\n\t\t\t// Get the ID of the purchaser\n\t\t\t$user_id = edd_get_payment_user_id( $payment_id );\n\n\t\t\t// Deposit the funds\n\t\t\tedd_wallet()->wallet->deposit( $user_id, $fees[0]['amount'], 'deposit', $payment_id );\n\n\t\t\t// Tag the payment so we can find it later\n\t\t\tedd_update_payment_meta( $payment_id, '_edd_wallet_deposit', $user_id );\n\t\t}\n\t}\n}", "function tranferFounds($project_id, $returnTotal=false, $adaptivepayments_pay = true) {\n\n App::import('Vendor', 'paypal');\n $this->Paypal = new Paypal();\n\n\n $this->recursive = -1;\n $sponsorships = $this->find('all', array('conditions' => array('Sponsorship.project_id' => $project_id)));\n\n $tranferredSponsorships = array();\n $total = 0;\n foreach ($sponsorships as $sponsorship) {\n $sponsorship_id = $sponsorship[$this->alias]['id'];\n if ($this->getPaymentType($sponsorship) == EXPRESSCHECKOUT) { // all of these payments are already on our paypal account, no tenemos que hacer nada.\n if ($this->isTransferred($sponsorship, EXPRESSCHECKOUT)) { // se marco como trasferido ? \n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } else {\n $transactionId = $sponsorship[$this->alias]['expresscheckout_transaction_id'];\n if (!empty($transactionId)) {\n $response = $this->Paypal->hashCall('GetTransactionDetails', array('TRANSACTIONID' => $transactionId));\n if ($this->updateExpressCheckoutStatus($sponsorship_id, $transactionId)) {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n }\n }\n }\n } elseif ($this->getPaymentType($sponsorship) == PREAPPROVAL) {\n if ($this->isTransferred($sponsorship, PREAPPROVAL)) { // se marco como trasferido ? \n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } else {\n $preapproval_key = $sponsorship[$this->alias]['preapproval_key'];\n if ($this->updatePreApprovalStatus($sponsorship_id, $preapproval_key)) { // actualizamos el pago | si esta activo ....\n $transferred = true;\n $sponsorship = $this->read(null, $sponsorship_id);\n if (!$this->isTransferred($sponsorship, PREAPPROVAL)) {\n // transferimos el pago a groofi $transferred = true ;\n if ($adaptivepayments_pay == true && $this->adaptivepayments_pay($sponsorship)) { //\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } elseif ($adaptivepayments_pay == false) {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n }\n } else {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n $sponsorship[$this->alias]['internal_status'] = SPONSORSHIP_TRANSFERRED;\n $sponsorship[$this->alias]['transferred'] = 1;\n $this->save($sponsorship);\n }\n }\n }\n }\n }\n return $returnTotal ? $total : $tranferredSponsorships;\n }", "function deliveryFee($rID, $subtotal, $tip, $date_time, $addr) {\n $_errors = array();\n \n if (!preg_match('/^\\d+/$', $rID)) {\n $_errors[] = \"Restaurant DeliveryFee - Validation - Restaurant ID (invalid, must be integer) (\" . $rID . \")\";\n }\n \n if(!preg_match('/^\\d*(\\.\\d{2})?$/', $subtotal) && $subtotal != '') {\n $_errors[] = \"Restaurant DeliveryFee - Validation - Subtotal (invalid, must be numeric) (\" . $subtotal . \")\";\n }\n \n if(empty($tip)) {\n $tip = 0;\n }\n elseif(!preg_match('/^\\d*\\.\\d{2}$/', $tip) && $tip != '') {\n $_errors[] = \"Restaurant DeliveryFee - Validation - Tip (invalid, must be numeric) (\" . $tip . \")\";\n }\n \n try {\n $addr->validate();\n } catch (OrdrinExceptionBadValue $ex) {\n $_errors[] = $ex.__toString();\n }\n \n if(!empty($_errors)) {\n throw new OrdrinExceptionBadValue($_errors);\n }\n \n $dt = $this->format_datetime($date_time);\n\n return $this->_call_api(\"GET\",\n array(\n \"fee\",\n $rID,\n $subtotal,\n $tip,\n $dt,\n $addr->zip,\n $addr->city,\n $addr->street\n )\n );\n }", "public static function confirmPayment() {\n $url = self::$username.':'.self::$password.'@'.self::$address.':'.self::$port.'/';\n self::$rpcClient = new jsonRPCClient($url, self::$debug);\n \n self::$emercoin_info = self::$rpcClient->getinfo();\n \n if(!is_callable(self::$get_order_id)) {\n throw new Exception('Property self::$get_order_id must be callable');\n }\n $account = self::$account_prefix.'_'.call_user_func(self::$get_order_id);\n \n if(!is_callable(self::$get_order_ammount)) {\n throw new Exception('Property self::$get_order_ammount must be callable');\n }\n $order_ammount = call_user_func(self::$get_order_ammount);\n \n \n\t\ttry {\n $received_amount = self::$rpcClient->getreceivedbyaccount($account,0);\n\t\t} catch (Exception $e) {\n\t\t\techo false;\n\t\t}\n \n\t\t//if((float)$received_amount >= (float)$order_ammount) {\n \n //Comparing two floats with epsilon (http://php.net/manual/en/language.types.float.php)\n $epsilon = 0.0000001; // 1 Satoshi\n if((float)$order_ammount - (float)$received_amount < $epsilon) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n }", "function get_transaction_fee($amount)\n\t{\n\t\treturn round(0.25+0.034*$amount,2);\n\t}", "public static function chargeFees($price=1)\n {\n\n }", "public function testSendWithRequestAddressBalance()\n {\n $service = $this->getStubForTest(file_get_contents(__DIR__ . '/TestAsset/Response/address_balance.txt'));\n\n $request = new Request\\AddressBalance();\n $request->setAddress('efjsdkfjkwefkwejfkesf');\n\n /* @var $response Response\\AddressBalance */\n $response = $service->send($request);\n\n $this->assertEquals(0, $response->getBalance());\n\n $this->assertEquals(\n $this->getLastRawRequestExpected(__DIR__ . '/TestAsset/Request/address_balance.txt'),\n $this->getLastRawRequest($service),\n 'Requests does not match'\n );\n }", "public function getMyFeesEstimate($request);", "private function _calculatePaymentFee(): int\n {\n $paymentFee = 0;\n if ($this->paymentMethod === 'paypal' && $_COOKIE['currency'] == 'EUR') {\n $paymentFee = 45;\n }\n\n return $paymentFee;\n }", "public function assess_late_fees() {\n // Setup finance_charge record.\n $late_charge = ORM::factory('finance_charge');\n $data = array(\n 'title' => sprintf('Late Fee: %s', $this->title),\n 'due' => date::to_db(),\n 'site_id' => $this->site_id,\n 'user_id' => $this->user_id,\n 'amount' => $this->late_fee_type == 'percent' ? number_format($this->amount * $this->late_fee / 100, 2) : $this->late_fee, // Fix to use percentage as well.\n 'budget_id' => $this->budget_id,\n 'deposit_account_id' => $this->deposit_account_id\n );\n $late_charge->validate($data, TRUE);\n \n // Assess charge to the individual members.\n foreach ($this->finance_charge_members as $member_charge) {\n $charge = ORM::factory('finance_charge_member');\n $data = array(\n 'finance_charge_id' => $late_charge->id,\n 'site_id' => $this->site_id,\n 'user_id' => $member_charge->user_id,\n 'amount' => $this->late_fee_type == 'percent' ? number_format($member_charge->balance() * $this->late_fee / 100, 2) : $this->late_fee, \n );\n $charge->validate($data, TRUE);\n }\n \n // Send out emails to all members who have received the late fee.\n $late_charge->notify_members();\n \n // Update late_fee_assessed record so we don't assess this late fee again.\n $this->late_fee_assessed = TRUE;\n $this->save();\n }", "public function sendWithFeeRate($payment_address_id, $destination, $quantity, $asset, $fee_rate='medium', $request_id=null) {\n return $this->sendFromAccount($payment_address_id, $destination, $quantity, $asset, 'default', $_unconfirmed=true, $_fee=null, $_dust_size=null, $request_id, $_custom_inputs=null, $fee_rate);\n }", "public function processShippingAmount($address, $total)\n {\n if ($this->amount->getBaseBalanceForShipping() <= 0) {\n return false;\n }\n\n $shippingAmount = $this->amount->getShippingPrice();\n $baseShippingAmount = $this->amount->getBaseShippingPrice();\n\n if ($baseShippingAmount <= 0) {\n return $this;\n }\n\n $discountAmount = min(\n $shippingAmount,\n $this->amount->getBalanceForShipping()\n );\n $baseDiscountAmount = min(\n $baseShippingAmount,\n $this->amount->getBaseBalanceForShipping()\n );\n\n $address->setGiftcardShippingAmount($discountAmount<0?$discountAmount:-$discountAmount); //negative\n $address->setBaseGiftcardShippingAmount($baseDiscountAmount<0?$baseDiscountAmount:-$baseDiscountAmount); //negative\n\n $total->setShippingGiftcardAmount($discountAmount<0?$discountAmount:-$discountAmount); //negative\n $total->setBaseShippingGiftcardAmount($baseDiscountAmount<0?$baseDiscountAmount:-$baseDiscountAmount); //negative\n\n return $this;\n }", "function paid_sendEmail_customer($details) {\n\t\t\t\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\n\t\t\t\t$total_amount = $details->checkoutTotal;\n\t\t\t\t $abc = $details->Extra_data->normal_price - $total_amount;\n if($abc < 0){\n $save = '0';\n\n }else{\n $save = number_format($details->Extra_data->normal_price - $total_amount,0);\n\t\t\t\t\t}\n\n\t\t\t\t$id = $details->id;\n\t\t\t\t$itemid = $details->itemid;\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$stars = $details->stars;\n\t\t\t\t$code = $details->code;\n\t\t\t\t$booking_adults = $details->Extra_data->adults;\n\t\t\t\t$child = $details->Extra_data->child;\n\t\t\t\t\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$deposit = $details->subItem->price;\n\t\t\t\t$quantity = $details->subItem->quantity;\n\t\t\t\t$hotel_title = $details->subItem->title;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$sendto = $details->accountEmail;\n\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$HOTEL_NAME = $details->title;\n\t\t\t\t$location = $details->location;\n\t\t\t\t$room_name = $details->subItem->title;\n\t\t\t\t$booking_adults = $details->subItem->booking_adults;\n\t\t\t\t$room_price = $details->subItem->price;\n\t\t\t\t\n\t\t\t\t$checkin = $details->checkin;\n\t\t\t\t\n\t\t\t\t$checkout = $details->checkout;\n\t\t\t\t$couponRate = $details->couponRate;\n\t\t\t\t\n\t\t\t\t$date = date ( \"m/d/Y\" , strtotime ( \"-1 day\" , strtotime ( $details->checkin ) ) );\n\t\t\t\t$no_of_room = $details->subItem->quantity;\n\t\t\t\t$thumbnail = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$details->thumbnail);\n\t\t\t\t$hotel_id = $details->itemid;\n\n\t\t\t\t$guest_name = $details->Extra_data->guest_name;\n\t\t\t\t$guest_age = $details->Extra_data->guest_age;\n\t\t\t\t$chil = $details->Extra_data->child;\n\t\t\t\t$child_name = isset($details->Extra_data->child_name) ? $details->Extra_data->child_name : 0;\n\t\t\t\t$child_age = isset($details->Extra_data->child_age) ? $details->Extra_data->child_age : 0;\n\t\t\t\t\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"\";\n\t\t\t\t\n\t\t\t\t$sendto = $details->accountEmail;\n\t\t\t\t\n\t\t\t\t $ptheme = pt_default_theme();\n\t\t\t\t\t$this->_config = config_item('theme');\n\t\t\t\t\t$uu = $this->_config['url'];\n\t\t\t\t$email_temp_img = $uu.$ptheme.'/email_temp_img/gb_email_temp_img/';\n\t\t\t\t/*$template = $this->shortcode_variables(\"bookingpaidcustomer\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidcustomer\");*/\n\n\t\t\t\t $book_room = $no_of_room;\n \n $room_per_guest = $booking_adults / $book_room;\n \n for ($r_i=0; $r_i < $book_room ; $r_i++) {\n \t$cc = $r_i+1;\n \t$no_top_hotel .= '<li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px;\">\n <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;margin-left: -30px;\">ROOM '.$cc.'</p>\n </li>';\n\t for($g_d_a=0; $g_d_a < $room_per_guest; $g_d_a++){\n\n\t $jj = $g_d_a + $r_i;\n\t $dd = $guest_name[$jj];\n\t $age = $guest_age[$jj];\n\t \n\n\t \t$no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 100%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px; \">\n\t\t <h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$dd.'</h5>\n \t\t<h5 class=\"right\" style=\"float:right;font-size: 16px;color: #0c134f;margin-right: 5px;\">'.$age.' Years</h5>\n\t\t </li>';\n\t }\n }\n\n if($chil > 0){\n\t $no_top_hotel .= ' <li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px; \">\n \t\t\t\t <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;\">CHILD DETAILS</p>\n \t\t\t\t </li>';\n \t for($c_i=0;$c_i<$chil;$c_i++){\n \t \t $ii = $c_i;\n\t \t\t $child_name1 = $child_name[$ii];\n\t \t\t $child_age1= $child_age[$ii];\n \t \t\n \t \t $no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 96%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px;\">\n \t\t\t<h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$child_name1.'</h5>\n \t\t<h5 class=\"right\" style=\"font-size: 16px;color: #0c134f;float: right;margin-right: 5px;\"><img src=\"'.$email_temp_img.'paynow_icon8.png\"> '.$child_age1.' Years</h5>\n \t\t\t</li>';\n \t}\n }\n\n \t$this->db->select('hotel_latitude,hotel_longitude,hotel_desc,hotel_map_city,hotel_stars');\n\t\t \t$this->db->where('hotel_id', $itemid);\n\t\t \t$query = $this->db->get('pt_hotels');\t\n\t\t \t$hotel_data = $query->result();\n\n\t\t \t$star_temp_img = $uu.$ptheme.'/images/';\n\n\t\t\t\t\t/*echo $hotel_data[0]->hotel_stars;*/\n\n\t\t\t\t\t$aaa = '';\n\t\t\t\t\tfor ($st_i=0; $st_i < 5 ; $st_i++) { \n \tif($st_i < $hotel_data[0]->hotel_stars){\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-on.png\">';\n \t}else{\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-off.png\">';\n \t}\n }\n\n\t\t \t$arrayInfo['checkIn'] = date(\"m/d/Y\", strtotime(\"+1 days\"));\n\t\t \t$arrayInfo['checkOut'] = date(\"m/d/Y\", strtotime(\"+2 days\"));\n\t\t \t$arrayInfo['adults'] = '1';\n\t\t \t$arrayInfo['child'] = '';\n\t\t \t$arrayInfo['room'] = '1';\n\t\t \t/*error_reporting(E_ALL);*/\n\t\t \t\t//$this->ci = & get_instance();\n\t\t\t\t\t\t// $this->db = $this->ci->db;\n\t\t\t\t\t$this->load->model('hotels/hotels_model');\n\t\t \t\n\t\t \t$local_hotels = $this->hotels_model->search_hotels_by_lat_lang($hotel_data[0]->hotel_latitude, $hotel_data[0]->hotel_longitude,$arrayInfo);\n\n\t\t \t$top_hotel = '<div class=\"col-sm-12 hotels\">';\n\n\t\t \tfor ($i=0; $i < count($local_hotels['hotels']) ; $i++) { \n\t\t \t\tif($i < 3){\n\t\t \t\t $image = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$bb[$i]->thumbnail);\n\t\t \t\t$bb = $local_hotels['hotels'];\n\t\t \t\t $bb[$i]->title;\n\t\t \t\t$top_hotel .= '<a class=\"col-sm-4\" href=\"'.$bb[$i]->slug.'\" style=\"margin-left: 2%;padding:10px;text-decoration: none; width:27.3333%;float: left; box-sizing: border-box;position: relative;\">';\n\t\t \t\t\t\t\t\tif($image == \"\"){\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$uu.$ptheme.'/email_temp_img/gb_email_temp_img/email-d-lasvegas.png\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$image.'\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<p style=\"text-align:center;margin:0px;color: rgb(12, 19, 79);font-size: 14px;margin: 20px 0 10px;font-family: \\'Roboto\\',sans-serif;\">'.$this->custom_echo($bb[$i]->title, 25).'</p>\n\t\t\t\t\t\t\t\t\t\t\t<h4 style=\" text-align:center;margin:0px; color: rgb(28, 192, 251);font-size: 20px;font-weight: 600;font-family: \\'Roboto\\',sans-serif;\">'.$bb[$i]->currCode.$bb[$i]->price.'</h4>\n\t\t\t\t\t\t\t\t\t\t</a>';\n\t\t \t} \n\t\t }\n\n\t\t \t$map = '<div class=\"col-sm-12 map\" style=\"width: 100%;padding-left: 0;float: left; box-sizing: border-box;min-height: 1px; padding-right:0px; position: relative;\">\n\t\t\t\t\t\t\t\t <a href=\"http://maps.google.com/?daddr={hotel_name}\" target=\"_blank\"> \n <img style=\"width:100%\" border=\"0\" src=\"https://maps.googleapis.com/maps/api/staticmap?center='.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&zoom=14&size=620x260&markers=size:mid%7Ccolor:red%7C'.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&key=AIzaSyAH65sTGsDsP4mMpmbHC8zqRiM1Qh07iL8\" alt=\"Google map\"></a>\n\t\t\t\t\t\t\t</div>';\n\n\t\t\t\t$res = $this->settings_model->get_contact_page_details();\n\t\t\t\t$contact_phone = $res[0]->contact_phone;\n\t\t\t\t$contact_email = $res[0]->contact_email;\n\t\t\t\t$contact_address = $res[0]->contact_address;\n\n\t\t\t\t\n\n\t\t\t\t$template = array(\"{invoice_id}\", \"{hotel_name}\", \"{stars}\", \"{location}\", \"{code}\",\"{invoice_code}\", \"{deposit_amount}\", \"{total_amount}\", \"{customer_email}\", \"{customer_id}\", \"{country}\", \"{phone}\", \"{currency_code}\", \"{currency_sign}\", \"{invoice_link}\", \"{site_title}\", \"{remaining_amount}\", \"{fullname}\",\"{room_name}\",\"{date}\",\"{checkin}\",\"{checkout}\",\"{no_of_room}\",\"{thumbnail}\",\"{booking_adults}\",\"{room_price}\",\"{couponRate}\",\"{additionaNotes}\",\"{email_temp_img}\",\"{quantity}\",\"{hotel_title}\",\"{booking_adults}\",\"{child}\",\"{no_top_hotel}\",\"{top_hotel}\",\"{map}\",\"{aaa}\",\"{save}\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidcustomer\");\n\t\t\t\t$values = array($invoiceid, $HOTEL_NAME, $stars, $location, $code, $refno, $deposit, $total_amount, $sendto, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $remaining , $name, $room_name, $date, $checkin, $checkout, $no_of_room, $thumbnail,$booking_adults,$room_price,$couponRate,$additionaNotes,$email_temp_img, $quantity,$hotel_title,$booking_adults,$child,$no_top_hotel,$top_hotel,$map,$aaa,$save);\n\n\t\t\t\t$HTML_DATA = file_get_contents( $uu.$ptheme.'/invoice.html');\n\t\t\t\t$message = str_replace($template, $values, $HTML_DATA);\n\n\t\t\t\t\n\t\t\t\t/*$message = $this->mailHeader;*/\n\t\t\t\t/*echo '<pre>'.json_encode($message).'</pre>';\n\t\t\t\texit();*/\n\t\t\t\t/*$details = $this->html_template_booking($hotel_id,$invoiceid);\n\t\t\t\t$message .= str_replace($template, $values, $details);*/\n\t\t\t\t//$message .= $this->mailFooter;\n\t\t\t\t/*echo $message;\n\t\t\t\texit;*/\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $phone, \"bookingpaidcustomer\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Thanks for Booking at the '.$HOTEL_NAME);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t\n\t\t}", "function compute_saving_fee($amount)\n{\n $fee = 0;\n if (!is_null($amount) && $amount > 0)\n {\n $fee = $amount * 0.5;\n if ($fee > 10000)\n {\n $fee = 10000;\n }\n else \n {\n $fee = ceil($fee);\n }\n $fee = $fee * 0.01;\n }\n return $fee;\n}", "public function sendToAddress($bitcoinaddress, $amount, $comment = '', $commentTo = '');", "function submitCreditFee($user_id, $type, $comments, $total, $date = null) {\n global $BoL_enabled;\n\tif (is_null($date)) $date = time();\n\tif (!is_numeric($user_id)) die('submitCreditFee: Non-Numeric User-ID');\n\tif ($type != 'c' && $type != 'f') die('submitCreditFee: Invalid Type, For Orders use submitOrder');\n\tif (!is_numeric($total)) die('submitCreditFee: Non-Numeric Amount');\n\tif (!is_numeric($date)) die('submitCreditFee: Invalid Date Format, Use UNIX Epoch');\n\t$values = array();\n\t$values['ordered'] = date('Y-m-d G:i:s',$date);\n\t$values['user'] = $user_id;\n\t$values['type'] = $type;\n\t$sql = \"SELECT snapshot FROM users WHERE ID = '\".$user_id.\"'\";\n\t$query = mysql_query($sql);\n\tcheckDBError($sql);\n\tif($result = mysql_fetch_assoc($query)) {\n\t\t$values['snapshot_user'] = $result['snapshot'];\n\t}\n if ($type==\"c\" && $total>=0)\n $total = $total-$total-$total; // make negative\n if ($type==\"f\")\n $total = abs($total);\n\t$values['total'] = $total;\n\t$values['comments'] = $comments;\n\t$values['processed'] = 'Y';\n\t$values['process_time'] = date('Y-m-d G:i:s');\n\t$sql = buildInsertQuery(\"order_forms\", $values, true);\n\tmysql_query($sql);\n\tcheckDBError($sql);\n\t$po_id = mysql_insert_id();\n\t$po = $po_id + 1000;\n\tif ($values['type'] == 'f') { // If it's a fee\n\t\t$sql = \"SELECT email, email2, email3 FROM users WHERE ID=\".$user_id;\n\t\t$query = mysql_query($sql);\n\t\tcheckDBError($sql);\n\t\tif ($result = mysql_fetch_array($query)) {\n\t\t\t$email = $result[0];\n\t\t\t$email2 = $result[1];\n\t\t\t$email3 = $result[2];\n\t\t} else {\n\t\t\tunset($email);\n\t\t\tunset($email2);\n\t\t\tunset($email3);\n\t\t}\n\t\t$msg =\n\t\t\"This is a bill; please retain for your records.\\n\\n\".\n\n\t\t\"Do not reply to this e-mail, contact your Dealer Support Person for any issues associated with this Bill.\\n\\n\".\n\n\t\t\"-----------------------------------------------------------\\n\";\n\n\t\t$body = OrderForEmail($po,'D');\n\t\t$msg .= $body;\n\n\t\t$subject = date( \"m/d/Y\", $date).\" Bill\";\n\t\t$headers = \"From: RSS Orders <orders@retailservicesystems.com>\";\n\t\tif ($email2 <> \"\") $headers .= \"\\nCc: \".$email2;\n\t\tif ($email3 <> \"\") $headers .= \"\\nCc: \".$email3;\n\t\t$headers .= \"\\nBcc: orders@retailservicesystems.com\";\n\t\tsendmail($email, $subject, $msg, $headers);\n\t}\n\treturn $po;\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 }", "function pay_on_credit_apply_interest_fee() {\n\n $payment_method = WC()->session->get('chosen_payment_method');\n $payment_duration = WC()->session->get('chosen_payment_duration');\n \n \n\n if ( $payment_method === \"wcpg-pay-on-credit\" ) {\n $label = __( 'Interest Fee', 'wcpg-pay-on-credit' );\n $amount = 0;\n\n switch ($payment_duration) {\n case '4':\n $percentage = 0.05;\n $amount = ( WC()->cart->cart_contents_total + WC()->cart->shipping_total ) * $percentage;\n break;\n\n case '6':\n $percentage = 0.1;\n $amount = ( WC()->cart->cart_contents_total + WC()->cart->shipping_total ) * $percentage;\n break; \n \n default:\n # code...\n break;\n }\n\n WC()->cart->add_fee( $label, $amount, false, '' );\n }\n \n \n}", "public static function getConfirmedReceivedByAddress($address)\n\t{\n\t\t$amount = file_get_contents(\"https://blockchain.info/q/getreceivedbyaddress/$address?confirmations=\" . getenv(\"REQUIRED_CONFIRMATIONS\"));\n\n\t\treturn $amount;\n\t}", "public function markAsDomesticShipping(Order $draftOrder): bool;", "private function saveAddresses() {\n\t\t\t$billingSaved = false;\n\t\t\t$shippingSaved = false;\n\t\t\tif ($this->memberID && $this->billingAddress->validAddress() && $this->shippingAddress->validAddress()) {\n\t\t\t\t// compare billing and shipping addresses\n\t\t\t\t$billingIsShipping = true;\n\t\t\t\tforeach ($this->billingAddress->get('addressForm') as $key => $val) {\n\t\t\t\t\tif ($val != $this->shippingAddress->getArrayData('addressForm', $key)) {\n\t\t\t\t\t\t$billingIsShipping = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($billingIsShipping) {\n\t\t\t\t\t// if the billing address is the same as the shipping address\n\t\t\t\t\t// address record will retain the shipping address name\n\t\t\t\t\t// billing address does not have a name\n\t\t\t\t\t// (payment method name will be in the payment record)\n\t\t\t\t\t$this->shippingAddress->addType('billing');\n\t\t\t\t\tif ($this->shippingAddress->get('saveAddress') || systemSettings::get('FORCESAVESHIPPING')) {\n\t\t\t\t\t\tif (!$this->shippingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->shippingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->shippingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->shippingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `shippingID` = '\".$this->shippingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$billingIsDefault = false;\n\t\t\t\t\t\tif ($this->billingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$billingIsDefault = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->billingAddress->loadAddress($this->shippingAddress->get('addressID'))) {\n\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($this->billingAddress->get('saveAddress') || systemSettings::get('FORCESAVEBILLING')) {\n\t\t\t\t\t\tif (!$this->billingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->billingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->billingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->billingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `billingID` = '\".$this->billingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ($this->shippingAddress->get('saveAddress') || systemSettings::get('FORCESAVESHIPPING')) {\n\t\t\t\t\t\tif (!$this->shippingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->shippingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->shippingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->shippingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `shippingID` = '\".$this->shippingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ($billingSaved && $shippingSaved);\n\t\t}", "public function estimateTransactionFee(int $inputs, int $outputs, $amount = 0, int $minConf = null);", "public static function canApply($address)\n {\n // Put here your business logic to check if fee should be applied or not\n // Example of data retrieved :\n // $address->getShippingMethod(); > flatrate_flatrate\n // $address->getQuote()->getPayment()->getMethod(); > checkmo\n // $address->getCountryId(); > US\n // $address->getQuote()->getCouponCode(); > COUPONCODE\n return true;\n }", "public static function lockFunds($from, $amount, $fee=0){\n\t\t$fromuser = \\CouchDB::getDoc($from, \"users\");\n\t\t$frombalance = Dogecoin::getBalance($from);\n\t\tif ($frombalance['available'] < ($amount + $fee)){\n\t\t\t//they don't have the funds\n\t\t\treturn \\Shared\\Error::handleError(\"nofunds\");\n\t\t}else{\n\t\t\tif ($fee != 0){\n\t\t\t\t$response = Dogecoin::payMe($from, $fee);\n\t\t\t}\n\t\t\t$response = Dogecoin::move($from, \"LOCKED-FEE\", $amount);\n\t\t\t$fromuser->wallet->locked += $amount;\n\t\t\t$response = \\CouchDB::setDoc($fromuser, \"users\");\n\t\t\treturn $amount;\n\t\t}\n\t\t//something went wrong, but i have no idea what that might be.\n\t\treturn 0;\n\t}", "public function test_get_sbps_purchase_fee_and_payment_request($carriers, $codes, $from, $to)\n {\n /** @var \\CI_DB_result $query */\n $sql = sprintf(<<<EOF\nSELECT order_detail.id\nFROM order_detail JOIN\n order_settlement ON order_detail.id = order_settlement.order_detail_id JOIN\n contract_order ON contract_order.id = order_detail.contract_order_id JOIN\n contract ON contract.id = contract_order.contract_id\nWHERE contract.`disable` = %3\\$d AND\n contract_order.`disable` = %3\\$d AND\n order_detail.`disable` = %3\\$d AND\n order_settlement.`disable` = %3\\$d AND\n contract.contract_status_id <> %5\\$d AND\n contract_order.order_type_code %1\\$s AND\n order_settlement.settlement_type_id %2\\$s AND\n order_detail.authorize_status = %4\\$d\nEOF\n , $this->transformInEqual($codes)\n , $this->transformInEqual($carriers)\n , self::STATUS_ENABLE\n , Sbps::AUTHORIZE_STATUS_BEFORE_CHECK_CREDIT_LIMIT\n , $this->getContractStatus());\n\n $sql .= $this->transformDate('order_settlement.settlement_plan_date', ['from' => $from, 'to' => $to]);\n $query = $this->CI->db->query($sql);\n $collection = $query->row_array();\n $query->free_result();\n\n /** @var array $actual */\n $query = $this->CI->contract->get_sbps_purchase_fee_and_payment_request($carriers, $codes, $from, $to);\n $actual = $query->row_array();\n $query->free_result();\n\n $this->assertInstanceOf('CI_DB_result', $query);\n $this->assertEquals($collection, $actual);\n }", "public function calcServiceFee(): float\n\t{\n\t\treturn $this->price * $this->rental_period->service_percent_fee + $this->rental_period->service_flat_fee;\n\t}", "protected function calcStateFee(float $debt = 0)\n {\n $stateFee = $debt / 100 * 13;\n $stateFee = number_format($stateFee,2,'.','');\n return $stateFee;\n }", "function calculateReferralFee($user_id,$order_details,$transaction_id)\n\t\t{\n\t\t\t//get user details\n\t\t\t$user_details = $this->_BLL_obj->manage_content->getValue_where('user_info','*', 'user_id', $user_id);\n\t\t\tif($user_details[0]['member_level'] != 0)\n\t\t\t{\n\t\t\t\t//getting user rf\n\t\t\t\t$user_level = $this->_BLL_obj->manage_content->getValue_where('member_level_info','*', 'member_level', $user_details[0]['member_level']);\n\t\t\t\tif(!empty($user_level[0]['RF']))\n\t\t\t\t{\n\t\t\t\t\t$ref_fee = ((intval($user_level[0]['RF']) * $order_details[0]['amount']) / 100);\n\t\t\t\t\t//getting user money from money table\n\t\t\t\t\t$user_money = $this->_BLL_obj->manage_content->getLastValue('user_money_info', '*', 'user_id', $user_id, 'id');\n\t\t\t\t\tif(!empty($user_money[0]['total_money']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$user_total_money = $user_money[0]['total_money'] + $ref_fee;\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$user_total_money = $ref_fee;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//insert values to user money info table\n\t\t\t\t\t$column_name_money = array('user_id','specification','earn_money','total_money');\n\t\t\t\t\t$column_value_money = array($user_id,$transaction_id,$ref_fee,$user_total_money);\n\t\t\t\t\t$insert_money = $this->_BLL_obj->manage_content->insertValue('user_money_info', $column_name_money, $column_value_money);\n\t\t\t\t\t//insert values to user profile info\n\t\t\t\t\t$this->_BLL_obj->increaseGrossAmount($user_id, $ref_fee);\n\t\t\t\t\t\n\t\t\t\t\treturn $ref_fee;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 0;\t\n\t\t\t}\n\t\t}", "public function chargeFee($amount = false) {\n $this->checkFee($amount);\n\n if(!$amount) {\n $fee = config('games.under_over.entry_fee');\n } else {\n $fee = $amount;\n }\n \n // deduct from the gold of current user\n $this->gold = $this->gold - $fee;\n try {\n $this->saveOrFail();\n } catch(QueryException $ex) {\n throw new PersonalRuntimeException(__('common.errors.invalid_query'));\n }\n }", "public static function payUser($from, $to, $amount, $fee){\n\t\t$frombalance = Dogecoin::getBalance($from);\n\t\tif ($frombalance['available'] < $amount){\n\t\t\t//they don't have the funds\n\t\t\treturn \\Shared\\Error::handleError(\"nofunds\");\n\t\t}\n\t\t//move the fee to the fee account\n\t\ttry{\n\t\t\t$response = Dogecoin::move($from, $to, $amount);\n\t\t\t$response = Dogecoin::move($to, \"CREATION-FEE\", $fee);\n\t\t\treturn $amount;\n\t\t}catch(Exception $e){\n\t\t\treturn 0;\n\t\t}\n\t}", "public function paidInFull()\n {\n $payment = $this->getPayment(1);\n\n return $payment && $payment->total == $this->getTotal();\n }", "public function markAsExpressShipping(Order $draftOrder): bool;", "public function finance(int $value, int $paymentsRemaining, $paymentValue): float;", "public function balanceOf($address)\n {\n\t\t// Remove 0x from address\n\t\tif(strlen($address) == 42 && substr($address, 0, 2) == '0x') {\n\t\t\t$address = substr($address, 2);\n\t\t}\n\n\t\t// Params\n\t\t$c = new \\stdClass();\n\t\t$c->from = '0x7ee760b17ce5cd95b9752f261bfb9b91c2babdba';\n\t\t$c->to = $this->sc_address;\n\t\t$c->data = '0x70a08231000000000000000000000000' . $address;\n\t\t\t\t\n\t\t$params = [$c, \"latest\"];\n\t\t\n\t\t// Perform request (request->request->... ugly!)\n\t\t$data = $this->request->request('eth_call', $params);\n\t\t\t\t\n\t\treturn $data;\n }", "function funding_failed($parameters) \n\t{\n\t\t$status = $parameters->verified;\n\n\t\t// Gather the total of all unpaired fees/scs, and adjust for it.\n\t\t$total = 0.0;\n\t\t\n\t\t$fund_date = strtotime($parameters->info->date_fund_stored);\n\t\t$balance = Fetch_Balance_Information($parameters->application_id);\n\t\t$total = $balance->total_balance;\n\t\t\n\t\t$db = ECash::getMasterDb();\n\t\t\n\t\ttry \n\t\t{\n\t\t\t$db->beginTransaction();\n\t\t\t// Remove the schedule immediately\n\t\t\tRemove_Unregistered_Events_From_Schedule($parameters->application_id);\n\t\n\t\t\tif ($total > 0.0) \n\t\t\t{\n\t\t\t\t$today = date(\"Y-m-d\");\n\t\t\t\t$amounts = array();\n\n\t\t\t\tif($balance->fee_pending > 0)\n\t\t\t\t{\n\t\t\t\t\t$amounts[] = Event_Amount::MakeEventAmount('fee', -$balance->fee_pending);\n\t\t\t\t}\n\n\t\t\t\tif($balance->service_charge_pending > 0)\n\t\t\t\t{\n\t\t\t\t\t$amounts[] = Event_Amount::MakeEventAmount('service_charge', -$balance->service_charge_pending);\n\t\t\t\t}\n\n\t\t\t\t$e = Schedule_Event::MakeEvent($today, $today, $amounts, 'adjustment_internal',\n\t\t\t\t\t\t\t\t\t'Adjusting out all accrued fees due to failure.');\n\n\t\t\t\tPost_Event($parameters->application_id, $e);\n\t\t\t}\n\t\t\t\n\t\t\t$db->commit();\n\t\t\t\n\t\t} \n\t\tcatch (Exception $e) \n\t\t{\n\t\t\t$this->Log(__METHOD__.\": Unable to update transactions.\");\n\t\t\t$db->rollBack();\n\t\t\tthrow $e;\n\t\t}\n\t\t\n\t\t// update status\n\t\t\n\t\ttry \n\t\t{\n\t\t\tUpdate_Status(null, $parameters->application_id, array('funding_failed','servicing','customer','*root'));\n\t\t} \n\t\tcatch (Exception $e) \n\t\t{\n\t\t\t$this->Log(__METHOD__.\": Unable to update status.\");\n\t\t\tthrow $e;\n\t\t}\n\t\t// Finally send the email - are we supposed to do this?\n\t}", "public function getAddressCapayableFee(Mage_Sales_Model_Quote_Address $address,$value = NULL,$alreadyExclTax = FALSE){\n if($this->_logging) {\n Mage::log('In getAddressCapayableFee (Postpayment)', null, $this->_logfile);\n }\n if (is_null($value)){\n $value = floatval(Mage::helper('capayable')->getPaymentMethodCost($this->_code,$address));\n }\n if (Mage::helper('capayable')->capayableFeePriceIncludesTax()) {\n if (!$alreadyExclTax) {\n $value = Mage::helper('capayable')->getCapayableFeePrice($value, false, $address, $address->getQuote()->getCustomerTaxClassId());\n }\n }\n if($this->_logging) {\n Mage::log('getAddressCapayableFee (Postpayment) value '.$value, null, $this->_logfile);\n }\n return $value;\n }", "function transfer_money() {\n\t\t$user_id = $_REQUEST['user_id'];\n\t\t$mobile = $_REQUEST['mobile_no'];\n\t\t$amount = $_REQUEST['amount'];\n\t\t$mobile_no = $_REQUEST['mobile_no'];\n\n\t\t//$transaction_id= mt_rand( 10000000, 99999999);\n\t\t$wallet_type_main = 2;\n\t\t// amount debit in user self\n\t\t$wallet_type_frnd = 1;\n\t\t// amount credit in frnd\n\t\t$wallet_category_to = 5;\n\t\t// transfer money to\n\t\t$wallet_category_from = 10;\n\t\t// transfer money from\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\tif (!empty($mobile)) {\n\t\t\t$user_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif (!empty($user_records)) {\n\t\t\t\t$main_wallet = $user_records['0']['wallet_amount'];\n\t\t\t\t$contact_number_main = $user_records['0']['user_contact_no'];\n\t\t\t\t// main user mobile number\n\t\t\t\tif ($main_wallet >= $amount) {\n\t\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t\t\tif (!empty($records)) {\n\t\t\t\t\t\t$contact_number_frnd = $records['0']['user_contact_no'];\n\t\t\t\t\t\t// frnd mobile number\n\t\t\t\t\t\t$frnd_wallet = $records['0']['wallet_amount'];\n\t\t\t\t\t\t$frnd_id = $records['0']['user_id'];\n\t\t\t\t\t\tif ($frnd_id != $user_id) {\n\t\t\t\t\t\t\t// amount transfer to another\n\t\t\t\t\t\t\t$transaction_id1 = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t$w_to_desc = \"Amount transfer to \" . $contact_number_frnd;\n\t\t\t\t\t\t\t$wallet_to_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_to . '\",\"' . $transaction_id1 . '\",\"' . $w_to_desc . '\",\"' . $contact_number_frnd . '\"');\n\t\t\t\t\t\t\tif (!empty($wallet_to_transfer)) {\n\t\t\t\t\t\t\t\t//amount recieved by transfer\n\t\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t\t$w_by_desc = \"Amount transfer from \" . $contact_number_main;\n\t\t\t\t\t\t\t\t$wallet_by_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $frnd_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_from . '\",\"' . $transaction_id . '\",\"' . $w_by_desc . '\",\"' . $contact_number_main . '\"');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!empty($wallet_by_transfer)) {\n\t\t\t\t\t\t\t\t$main_wallet_money = $main_wallet - $amount;\n\t\t\t\t\t\t\t\t$frnd_wallet_money = $frnd_wallet + $amount;\n\t\t\t\t\t\t\t\t// update main user wallet\n\t\t\t\t\t\t\t\t$data['wallet_amount'] = $main_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data);\n\t\t\t\t\t\t\t\t// update frnd wallet//\n\t\t\t\t\t\t\t\t$data1['wallet_amount'] = $frnd_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $frnd_id, $data1);\n\t\t\t\t\t\t\t\t$post = array('status' => 'true', 'message' => 'Transfer money successfully', 'main_user_id' => $user_id, 'main_wallet' => $main_wallet_money, 'frnd_wallet' => $frnd_wallet_money, 'frnd_id' => $frnd_id, 'transfer_mobile' => $mobile_no, 'transfer_amount' => $amount, 'transaction_id' => $transaction_id1, 'transfer_date' => $current_date);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Error in transfering amount\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Please enter another user number\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"This user is not exist of given number\");\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Wallet amount is not sufficent to transfer money\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"invalid user\", 'user_id' => $user_id);\n\t\t\t}\n\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"missing parameter\", 'user_id' => $user_id, 'amount' => $amount, 'mobile' => $moble);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function processPCTWalletTransfer($payload)\n\t{\n\t # Load user model\n\t $this->load->model('user');\n\t \n\t $result = $this->user->sign_in($this->input->post('user-name'), $this->input->post('user-password'));\n\t \n\t if(!$result)\n\t {\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_FAILED_LOGIN_ERROR);\n\t return $response;\n\t }\n\t \n\t $txnId = \"PCTINT\".time();\n\t $fromUser = $result;\n\t $toUser = $this->input->post('to-account');\n\t $txnType = 'User To User Transfer';\n\t $txnPoints = $this->input->post('pct-transfer-points');\n\t $txnTopic = $this->input->post('pct-topic');\n\t $txnMessage = $this->input->post('pct-message');\n\t \n\t # Now before actually making the transaction store, we need to add points to users account\n\t \n\t $profile = $this->user->getUserProfile($result);\n\t \n\t $walletAmount = $profile->{User::_PCT_WALLET_AMOUNT};\n\t \n\t if($txnPoints > $walletAmount){\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_TRANSFER_FAILURE_INSUFFICIENT_FUND);\n\t return $response;\n\t }\n\t \n\t $toUserProfile = $this->user->getUserProfile($toUser);\n\t \n\t $this->db->where(User::_ID, $toUser)->update(User::_TABLE, array(User::_PCT_WALLET_AMOUNT => $toUserProfile->{User::_PCT_WALLET_AMOUNT} + $txnPoints));\n\t $this->db->where(User::_ID, $fromUser)->update(User::_TABLE, array(User::_PCT_WALLET_AMOUNT => ($walletAmount- $txnPoints)));\n\t \n\t \n\t # Load pct-transaction model\n\t $this->load->model('pct_transaction');\n\t $result = $this->pct_transaction->create_transaction($fromUser, $toUser, $txnId, $txnType, $txnPoints, $txnTopic, $txnMessage);\n\t \n\t # Now once the payment is successfull, we should get the balance once again and pass this\n\t \n\t $profile = $this->user->getUserProfile($fromUser);\t \n\t $walletAmount = $profile->{User::_PCT_WALLET_AMOUNT};\n\t \n\t \n\t if($result) $response = array('flag'=>1, 'message'=>Message::PCT_PAYMENT_TRANSFER_SUCCESS, 'walletAmount'=>$walletAmount);\n\t else $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_TRANSFER_FAILURE);\n\t \n\t return $response;\n\t}", "public function getFee(): float;", "public function testXEMFeeComputation()\n {\n // sending 250000 XEM reaches the maximum fee\n $amount = new Amount([\"amount\" => 260*1000]);\n\n $expectFee = Fee::MAX_AMOUNT_FEE;\n $actualFee = Fee::calculateForXEM($amount->toMicro());\n\n $this->assertEquals(260000, $amount->toMicro());\n $this->assertEquals($expectFee, $actualFee);\n }", "public function feeEstimate(int $numBlocks = null)\n {\n return $this->execute($this->getCoin() . '/tx/fee', 'GET', [\n 'numBlocks' => $numBlocks\n ]);\n }", "public function getReceivedByAddress($bitcoinaddress, $minconf = 1);", "public function calculatePayment()\n {\n }", "function directPayment()\n\t{\n\t\tglobal $eWAYCustomerID,\n\t\t\t\t$eWayTotalAmount,\n\t\t\t\t$ewayCustomerFirstName,\n\t\t\t\t$ewayCustomerLastName,\n\t\t\t\t$ewayCustomerEmail,\n\t\t\t\t$ewayCustomerAddress,\n\t\t\t\t$ewayCustomerPostcode,\n\t\t\t\t$ewayCustomerInvoiceDescription,\n\t\t\t\t$ewayCustomerInvoiceRef,\n\t\t\t\t$ewayCardHoldersName,\n\t\t\t\t$ewayCardNumber,\n\t\t\t\t$ewayCardExpiryMonth,\n\t\t\t\t$ewayCardExpiryYear,\n\t\t\t\t$ewayCVN,\n\t\t\t\t$ewayTrxnNumber,\n\t\t\t\t$ewayOption1,\n\t\t\t\t$ewayOption2,\n\t\t\t\t$ewayOption3,\n\t\t\t\t$directPaymentUrl,\n\t\t\t\t$eWaySOAPActionURL;\n\t\t\t\t$testUrl = \"https://www.eway.com.au/gateway_cvn/xmltest/testpage.asp\";\n\t\t\t\t$liveUrl = \"https://www.eway.com.au/gateway_cvn/xmlpayment.asp\";\n\t\t\t\t$eWaySOAPActionURL = \"https://www.eway.com.au/gateway/managedpayment\";\n\t\t\t\t$eWayCustomerId = \"91901390\"; /* test account */\n\t\t\t\t$eWayTotalAmount = 100; /* 1$ = 100 cent */\n\t\t\t\t$directXML = \"<ewaygateway>\".\n\t\t\t\t\"<ewayCustomerID>\".$eWAYCustomerID.\"</ewayCustomerID>\".\n\t\t\t\t\"<ewayTotalAmount>\".$eWayTotalAmount.\"</ewayTotalAmount>\".\n\t\t\t\t\"<ewayCustomerFirstName>\".$ewayCustomerFirstName.\"</ewayCustomerFirstName>\".\n\t\t\t\t\"<ewayCustomerLastName>\".$ewayCustomerLastName.\"</ewayCustomerLastName>\".\n\t\t\t\t\"<ewayCustomerEmail>\".$ewayCustomerEmail.\"</ewayCustomerEmail>\".\n\t\t\t\t\"<ewayCustomerAddress>\".$ewayCustomerAddress.\"</ewayCustomerAddress>\".\n\t\t\t\t\"<ewayCustomerPostcode>\".$ewayCustomerPostcode.\"</ewayCustomerPostcode>\".\n\t\t\t\t\"<ewayCustomerInvoiceDescription>\".$ewayCustomerInvoiceDescription.\"</ewayCustomerInvoiceDescription>\".\n\t\t\t\t\"<ewayCustomerInvoiceRef>\".$ewayCustomerInvoiceRef.\"</ewayCustomerInvoiceRef>\".\n\t\t\t\t\"<ewayCardHoldersName>\".$ewayCardHoldersName.\"</ewayCardHoldersName>\".\n\t\t\t\t\"<ewayCardNumber>\".$ewayCardNumber.\"</ewayCardNumber>\".\n\t\t\t\t\"<ewayCardExpiryMonth>\".$ewayCardExpiryMonth.\"</ewayCardExpiryMonth>\".\n\t\t\t\t\"<ewayCardExpiryYear>\".$ewayCardExpiryYear.\"</ewayCardExpiryYear>\".\n\t\t\t\t\"<ewayCVN>\".$ewayCVN.\"</ewayCVN>\".\n\t\t\t\t\"<ewayTrxnNumber>\".$ewayTrxnNumber.\"</ewayTrxnNumber>\".\n\t\t\t\t\"<ewayOption1>\".$ewayOption1.\"</ewayOption1>\".\n\t\t\t\t\"<ewayOption2>\".$ewayOption2.\"</ewayOption2>\".\n\t\t\t\t\"<ewayOption3>\".$ewayOption3.\"</ewayOption3>\".\n\t\t\t\"</ewaygateway>\";\n\t\t\t //echo $directXML;\n\t\t\t //exit;\n\t\t\t\t$result = $this->makeCurlCall($testUrl, /* CURL URL */\"POST\", /* CURL CALL METHOD */\n\t\t\t\tarray( /* CURL HEADERS */\n\t\t\t\t\t\"Content-Type: text/xml; charset=utf-8\",\n\t\t\t\t\t\"Accept: text/xml\",\n\t\t\t\t\t\"Pragma: no-cache\",\n\t\t\t\t\t\"SOAPAction: \".$eWaySOAPActionURL,\n\t\t\t\t\t\"Content_length: \".strlen(trim($directXML))\n\t\t\t\t),\n\t\t\t\tnull, /* CURL GET PARAMETERS */\n\t\t\t\t$directXML /* CURL POST PARAMETERS AS XML */\n\t\t\t);\n\t\t\tif($result != null && isset($result[\"response\"])) {//$response = new SimpleXMLElement($result[\"response\"]);\n\t\t\t // $response = simpleXMLToArray($response);\n\t\t\t $result\t\t\t\t=\t$result[\"response\"];\n\t\t\t // exit;\n\t\t\t $ewayTrxnStatus\t\t=\t$this->getTextBetweenTags($result,'ewayTrxnStatus');\n\t\t\t if($ewayTrxnStatus)\n\t\t\t {\n\t\t\t\t\t$ewayTrxnNumber\t=\t $this->getTextBetweenTags($result,'ewayTrxnNumber');\n\t\t\t\t\t$ewayAuthCode\t=\t $this->getTextBetweenTags($result,'ewayAuthCode');\n\t\t\t\t\treturn array(\n\t\t\t\t\t\t\t\t\t\"ewayTrxnStatus\"=>$ewayTrxnStatus,\n\t\t\t\t\t\t\t\t\t\"ewayTrxnNumber\"=>$ewayTrxnNumber,\n\t\t\t\t\t\t\t\t\t\"ewayAuthCode\"=>$ewayAuthCode\n\t\t\t\t\t\t\t\t);\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t return 'error: Account creation fail';\n\t\t\t }\n\t\t\t}\n\t\t\tdie(\"\");\n\t}", "function user_update_wallent_balance_confirmation_mail($send_data)\n {\n $to_email_address = $send_data['sender_email'];\n $subject = \"Update Wallet Balance Confirmation E-mail\";\n $message = 'Hi, '.ucfirst($send_data['sender_name']).' <span style=\"font-size:24px\"><b>$'.$send_data['amount'].'</b></span> '.$send_data['message'];\n $data['msg'] = $message;\n $mess = $this->load->view('mailer/email_template', $data, true);\n $result_dfee = $this->common_model->sendEmails($to_email_address, $subject, $mess);\n\n if ($result_dfee) {\n return true;\n } else {\n return false;\n }\n }", "function sendsms_franchise_shipments($invoices='',$d_total=0)\r\n\t{\r\n\t\t\r\n\t\t$sql_trans = \"select inv.invoice_no,a.id,e.franchise_id,a.itemid,group_concat(b.name) as itemname,concat(b.print_name,'-',b.pnh_id) as print_name,i_orgprice,login_mobile1,i_price,i_coup_discount,i_discount,group_concat(a.quantity) as qty,c.menuid,a.transid,f.franchise_id,f.franchise_name\r\n\t\t\t\t\t\t\tfrom king_invoice inv\r\n\t\t\t\t\t\t\tjoin king_orders a on a.id=inv.order_id\r\n\t\t\t\t\t\t\tjoin king_dealitems b on a.itemid = b.id\r\n\t\t\t\t\t\t\tjoin king_deals c on b.dealid = c.dealid \r\n\t\t\t\t\t\t\tjoin pnh_menu d on d.id = c.menuid \r\n\t\t\t\t\t\t\tjoin king_transactions e on e.transid = a.transid\r\n\t\t\t\t\t\t\tjoin pnh_m_franchise_info f on f.franchise_id = e.franchise_id \r\n\t\t\t\t\t\t\twhere inv.invoice_no in ($invoices)\r\n\t\t\t\t\t\t\tgroup by inv.invoice_no\";\r\n\t\t\r\n\t\t$res_trans = $this->db->query($sql_trans);\r\n\t\r\n\t\t$sms_msg = '';\r\n\t\t$datetime = new DateTime('tomorrow');\r\n\t\t\r\n\t\tif($res_trans->num_rows())\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$fran_shipment_sms = array();\r\n\t\t\t$fran_det = array();\r\n\t\t\t\r\n\t\t\tforeach($res_trans->result_array() as $row_trans)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tif(!isset($fran_shipment_sms[$row_trans['franchise_id']]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$fran_shipment_sms[$row_trans['franchise_id']] = array();\r\n\t\t\t\t\t$fran_det[$row_trans['franchise_id']] = array($row_trans['franchise_name'],$row_trans['login_mobile1']);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t$fran_shipment_sms[$row_trans['franchise_id']][] = \" invoice no(\".$row_trans['invoice_no'].\") with \".$row_trans['print_name'].\" products and \".$row_trans['qty'].\" qty \";\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tforeach($fran_shipment_sms as $fr_id=>$fr_sms_list)\r\n\t\t\t{\r\n\t\t\t\t$sms_msg=\"Dear \".$row_trans['franchise_name'].\", your \".implode(',',$fr_sms_list).\" is shipped successfully, please expect delivery on \".$datetime->format('d/m/Y');\r\n\t\t\t\t$this->erpm->pnh_sendsms($fran_det[$fr_id][1],$sms_msg,$fr_id,0,12);\t\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// Send Notification to TM about Shipment.\r\n\t\t\r\n\t\t$sql = \"select d.employee_id,e.name,d.territory_id,b.franchise_id,franchise_name,contact_no,group_concat(distinct a.invoice_no order by a.invoice_no) as invoices \r\n\t\t\t\t\t\t\tfrom king_invoice a\r\n\t\t\t\t\t\t\tjoin king_transactions b on a.transid = b.transid \r\n\t\t\t\t\t\t\tjoin pnh_m_franchise_info c on c.franchise_id = b.franchise_id \r\n\t\t\t\t\t\t\tjoin m_town_territory_link d on d.territory_id = c.territory_id and d.town_id = 0\r\n\t\t\t\t\t\t\tjoin m_employee_info e on e.employee_id = d.employee_id and job_title = 4 \r\n\t\t\t\t\t\t\twhere invoice_no in ($invoices) \r\n\t\t\t\t\t\tgroup by employee_id,franchise_id \";\r\n\t\t \r\n\t\t\r\n\t\t$res = $this->db->query($sql);\r\n\t\tif($res->num_rows())\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$emp_sms_det = array();\r\n\t\t\t\r\n\t\t\tforeach($res->result_array() as $row)\r\n\t\t\t{\r\n\t\t\t\t//tm employee id \r\n\t\t\t\t\r\n\t\t\t\tlist($emp_mobno,$emp_mobno2) = explode(',',$row['contact_no']); \r\n\t\t\t\t$invlist = explode(',',$row['invoices']);\r\n\t\t\t\t\r\n\t\t\t\t$invlist = array_filter($invlist);\r\n\t\t\t\t$franid = $row['franchise_id'];\r\n\t\t\t\t\r\n\t\t\t\tif(!count($invlist))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(!isset($emp_sms_det[$row['employee_id']]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']] = array();\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']]['employee_id'] = $row['employee_id'];\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']]['name'] = $row['name'];\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']]['contact_no'] = $emp_mobno;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'] = array();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid] = array();\r\n\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid]['fname'] = $row['franchise_name'];\r\n\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid]['trans'] = array();\r\n\t\t\t\t\r\n\t\t\t\tforeach($invlist as $inv)\r\n\t\t\t\t{\r\n\t\t\t\t\t$transid = $this->db->query(\"select transid from king_invoice where invoice_no = ? \",$inv)->row()->transid;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$unshipped_items = @$this->db->query(\"select group_concat(trim(item),' x ',qty) as items from (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tselect a.transid,f.franchise_id,franchise_name,concat(c.print_name,'-',pnh_id) as item,sum(a.quantity) as qty \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfrom king_orders a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tselect distinct transid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfrom shipment_batch_process_invoice_link a \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin proforma_invoices b on a.p_invoice_no = b.p_invoice_no \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere invoice_no in (\".$inv.\") \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) as b on a.transid = b.transid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin king_dealitems c on c.id = a.itemid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin king_deals d on d.dealid = c.dealid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin king_transactions e on e.transid = a.transid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin pnh_m_franchise_info f on f.franchise_id = e.franchise_id \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere a.status = 0 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgroup by a.transid,a.itemid ) as g\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgroup by franchise_id\")->row()->items;\r\n\t\t\t\t\tif(!isset($emp_sms_det[$row['employee_id']]['fran'][$franid]['trans'][$transid]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid]['trans'][$transid] = array('inv_list'=>array(),'unshipped'=>'');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid]['trans'][$transid]['inv_list'][] = $inv;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($unshipped_items)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid]['trans'][$transid]['unshipped'] = $unshipped_items;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tforeach($emp_sms_det as $emp_id=>$emp_ship_det)\r\n\t\t\t{\r\n\t\t\t\t$emp_id = $emp_ship_det['employee_id'];\r\n\t\t\t\t$emp_name = $emp_ship_det['name'];\r\n\t\t\t\t$emp_mob_no = $emp_ship_det['contact_no'];\r\n\t\t\t\t$emp_territory_id = $emp_ship_det['territory_id'];\r\n\t\t\t\t\r\n\t\t\t\t$sms_msg = array();\r\n\t\t\t\t\r\n\t\t\t\tforeach($emp_ship_det['fran'] as $fid=>$fran_trans_det)\r\n\t\t\t\t{\r\n\t\t\t\t\t$total_invoices = 0;\r\n\t\t\t\t\t$fran_inv_list = array();\r\n\t\t\t\t\tforeach($fran_trans_det['trans'] as $transid => $trans_ship_det)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$t_inv_list = array_values($trans_ship_det['inv_list']);\r\n\t\t\t\t\t\t$total_invoices += count($t_inv_list);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$inv_sms = implode(',',$t_inv_list);\r\n\t\t\t\t\t\tif($trans_ship_det['unshipped'])\r\n\t\t\t\t\t\t\t$inv_sms .= ':'.$trans_ship_det['unshipped'];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$fran_inv_list[] = $inv_sms;\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\t$sms_msg[] = \"Shipped \".$total_invoices.\" Invoices for \".($fran_trans_det['fname']).\" (\".implode(',',$fran_inv_list).\")\";\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(count($sms_msg))\r\n\t\t\t\t{\r\n\t\t\t\t\t$sms_text .= implode(',',$sms_msg).\",Storeking\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t//echo $sms_text;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->erpm->pnh_sendsms($emp_mob_no,$sms_text,0,$emp_id);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t//\techo $emp_mob_no,$sms_msg;\r\n\t\t\t\t\t$log_prm=array();\r\n\t\t\t\t\t$log_prm['emp_id']=$emp_id;\r\n\t\t\t\t\t$log_prm['contact_no']=$emp_mob_no;\r\n\t\t\t\t\t$log_prm['type']=4;\r\n\t\t\t\t\t$log_prm['territory_id']=$emp_territory_id;\r\n\t\t\t\t\t$log_prm['town_id']=0;\r\n\t\t\t\t\t$log_prm['grp_msg']=$sms_text;\r\n\t\t\t\t\t$log_prm['created_on']=cur_datetime();\r\n\t\t\t\t\t$this->erpm->insert_pnh_employee_grpsms_log($log_prm);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function testMessageFeeEmpty()\n {\n $message = new Message();\n // leave $message empty!\n\n $expectFee = 0;\n $actualFee = Fee::calculateForMessage($message);\n\n $this->assertEquals($expectFee, $actualFee);\n }", "function getPayments(){\n $earlyPayment = 0;\n $regularPayment = 0;\n $latePayment = 0;\n \n // Separate fee payments into early, regular, late deadlines\n $this->totalFinAid = 0;\n $payments = payment::getSchoolPayments($this->schoolId);\n for($i = 0; $i < sizeof($payments); $i++){\n $payment = new payment($payments[$i]);\n if($payment->finaid == '1') $this->totalFinAid += $payment->amount;\n if($payment->startedTimeStamp<=generalInfoReader('earlyRegDeadline')){\n $earlyPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('earlyRegDeadline') && $payment->startedTimeStamp<=generalInfoReader('regularRegDeadline')){\n $regularPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('regularRegDeadline')){\n $latePayment += intval($payment->amount);\n }\n }\n // Check when school fee was paid\n if($earlyPayment>=generalInfoReader('earlySchoolFee') || $this->numStudents <= 5){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n\t } else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($earlyPayment+$regularPayment>=generalInfoReader('regularSchoolFee')){\n $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t$this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n\n\t}elseif($earlyPayment+$regularPayment+$latePayment>=generalInfoReader('lateSchoolFee')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }else{ // School fee was not paid\n $curTime = time();\n if($curTime<=generalInfoReader('earlyRegDeadline')){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n \t} else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('earlyRegDeadline') && $curTime<=generalInfoReader('regularRegDeadline')){\n\t $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t $this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('regularRegDeadline')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }\n }\n\t\n // Small delegations don't pay school fees\n if($this->numStudents <=5 && $this->numAdvisers){\n $this->schoolFee = 0;\n }\n\t\n\t//Chosun doesn't pay\n\tif(strpos(strtolower($this->schoolName),\"chosun\") !== False || strpos(strtolower($this->schoolName),\"worldview\") !== False){\n\t $this->schoolFee = 0;\n\t $this->delegateFee = 0;\n\t}\n\n // Calculating numbers\n $this->totalPaid = $earlyPayment + $regularPayment + $latePayment - $this->totalFinAid;\n $this->delegateFeeTotal = $this->numStudents*$this->delegateFee;\n $mealTicket = new mealTicket($this->schoolId);\n $this->mealTicketTotal = $mealTicket->totalCost;\n \n $this->schoolFeePaid = 0;\n $this->schoolFeeOwed = 0;\n $this->delegateFeePaid = 0;\n $this->delegateFeeOwed = 0;\n $this->mealTicketPaid = 0;\n $this->mealTicketOwed = 0;\n if($this->totalPaid < $this->schoolFee){\n // Haven't paid school fee\n $this->schoolFeePaid = $this->totalPaid;\n $this->schoolFeeOwed = $this->schoolFee - $this->totalPaid;\n $this->delegateFeeOwed = $this->delegateFeeTotal;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }elseif($this->totalPaid + $this->totalFinAid < $this->schoolFee + $this->delegateFeeTotal){\n // Have paid school fee but not delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->totalPaid + $this->totalFinAid - $this->schoolFee;\n $this->delegateFeeOwed = $this->delegateFeeTotal - $this->delegateFeePaid;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }else{\n // Have paid school and delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->delegateFeeTotal;\n $this->mealTicketPaid = min($this->mealTicketTotal, $this->totalPaid + $this->totalFinAid - $this->schoolFee - $this->delegateFeeTotal);\n $this->mealTicketOwed = $this->mealTicketTotal - $this->mealTicketPaid;\n }\n $this->totalFee = $this->schoolFee + $this->delegateFeeTotal + $this->mealTicketTotal;\n $this->totalOwed = $this->totalFee - $this->totalFinAid - $this->totalPaid;\n \n\t//Create formatted versions:\n\t$this->totalFeeFormatted = '$'.money_format('%.2n',$this->totalFee);\n\t$this->totalPaidFormatted = '$'.money_format('%.2n',$this->totalPaid);\n\t$this->totalOwedFormatted = '$'.money_format('%.2n',$this->totalOwed);\n\n\n\t$this->schoolFeeFormatted = '$'.money_format('%.2n',$this->schoolFee);\n\t$this->schoolFeePaidFormatted = '$'.money_format('%.2n',$this->schoolFeePaid);\n\t$this->schoolFeeOwedFormatted = '$'.money_format('%.2n',$this->schoolFeeOwed);\n\t\n\t$this->delegateFeeFormatted = '$'.money_format('%.2n',$this->delegateFee);\n\t$this->delegateFeeTotalFormatted = '$'.money_format('%.2n',$this->delegateFeeTotal);\n\t$this->delegateFeePaidFormatted = '$'.money_format('%.2n',$this->delegateFeePaid);\n\t$this->delegateFeeOwedFormatted = '$'.money_format('%.2n',$this->delegateFeeOwed);\n\n\t$this->totalFinAidFormatted = '$'.money_format('%.2n',$this->totalFinAid);\n\n\n // Calculate Payment Due Date\n if($this->delegateFee == generalInfoReader('earlyDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('earlyRegDeadline');\n if($this->delegateFee == generalInfoReader('regularDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('regularRegDeadline');\n if($this->delegateFee == generalInfoReader('lateDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('lateRegDeadline');\n $this->totalPaymentDue = generalInfoReader('paymentDueDate');\n\t\n }", "public function hasBoothfee(){\n return $this->_has(6);\n }", "public function actionSendToHub()\n {\n $paymentAddresses = PaymentAddressQueryLibrary::getWithFunds();\n\n $paymentAddressService = new PaymentAddressService();\n foreach ($paymentAddresses as $paymentAddress) {\n try {\n if ($paymentAddressService->sendToHub($paymentAddress)) {\n $this->stdout('Funds transferred from temporary address to hub address. | ID: ' . $paymentAddress->id . \" | Hex: \" . $paymentAddressService->getTransactionHex() . \" |\\n\" . PHP_EOL, Console::FG_YELLOW);\n }\n }\n catch (Exception $exception) {\n $this->stdout('Error occurred. | ID: ' . $paymentAddress->id . \" |\\n\" . PHP_EOL, Console::FG_RED);\n }\n }\n return true;\n }", "public function makeExamFeePayment($admin_id)\n {\n // Validation\n // $this->validate($request, [\n // 'user_id' => 'required',\n // 'student_index' => 'required',\n // 'student_name' => 'required'\n // ]);\n\n //Collecting data from html form\n // $user_id = trim($request->user_id);\n // $student_index = trim($request->student_index);\n // $student_name = trim($request->student_name);\n\n\n $merchant_order_id = rand(111112,888889);\n $merchant_ref_id = rand(334335,987415);\n\n $callback_url = \"https://smart-typing.com/examFeePaymentSuccess\";\n\n $general = DB::table('tbl_payment_gateway')->first();\n $feeQuery = DB::table('tbl_exam_fee')->first();\n $userQuery = DB::table('admin')->where('id',$admin_id)->first();\n $studentName = $userQuery->first_name.' '.$userQuery->last_name;\n $username = $userQuery->email;\n $user_id = $userQuery->id;\n $step_id = $userQuery->step_id;\n $sessionQuery = DB::table('tbl_step')->where('id',$step_id)->first();\n $product_desc = \"Exam Fee of Smart Typing. Session : \".$sessionQuery->step_name;\n $customer_add = \"Gazipur, Dhaka\";\n $mobile = $userQuery->mobile;\n\n $serverData = json_decode($this->getWMXServerData());\n $url = $serverData->url;\n $app_name = $general->wmx_app_name;\n $options = (base64_encode('s='.$app_name.',i='.\\request()->ip()));\n $wmx_id = $general->wmx_id;\n $access_app_key = $general->wmx_access_app_key;\n $access_username = $general->wmx_access_username;\n $access_password = $general->wmx_access_password;\n $authorization = 'Basic '.base64_encode($access_username.':'.$access_password);\n $cart_info = $wmx_id.','.$app_name.','.'flight';\n \n $data = [\n 'wmx_id' => $wmx_id,\n 'merchant_order_id' => $merchant_order_id,\n 'merchant_ref_id' => $merchant_ref_id,\n 'app_name' => $app_name,\n 'cart_info' => $cart_info,\n 'customer_name' => $studentName,\n 'customer_email' => $username,\n 'customer_add' => $customer_add,\n 'customer_phone' => $mobile,\n 'product_desc' => $product_desc,\n 'amount' => $sessionQuery->amount,\n 'currency' => 'BDT',\n 'options' => $options,\n 'callback_url' => $callback_url,\n 'access_app_key' => $access_app_key,\n 'authorization' => $authorization,\n ];\n \n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL => $url,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => http_build_query($data),\n ));\n \n $resp = curl_exec($curl);\n curl_close($curl);\n \n $json = json_decode($resp);\n $token = $json->token;\n \n Session::put($token.'_user_id',$user_id);\n Session::put($token.'_username',$username);\n \n return Redirect::to('http://sandbox.walletmix.com/bank-payment-process/'.$token.'/'.$username);\n }", "public function estimateTransactionSmartFeeRequest($blockchain, $network, $context = null, $confirmation_target = null, $estimate_mode = null)\n {\n // verify the required parameter 'blockchain' is set\n if ($blockchain === null || (is_array($blockchain) && count($blockchain) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $blockchain when calling estimateTransactionSmartFee'\n );\n }\n // verify the required parameter 'network' is set\n if ($network === null || (is_array($network) && count($network) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network when calling estimateTransactionSmartFee'\n );\n }\n\n $resourcePath = '/blockchain-data/{blockchain}/{network}/estimate-transaction-smart-fee';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($context !== null) {\n if('form' === 'form' && is_array($context)) {\n foreach($context as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['context'] = $context;\n }\n }\n // query params\n if ($confirmation_target !== null) {\n if('form' === 'form' && is_array($confirmation_target)) {\n foreach($confirmation_target as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['confirmationTarget'] = $confirmation_target;\n }\n }\n // query params\n if ($estimate_mode !== null) {\n if('form' === 'form' && is_array($estimate_mode)) {\n foreach($estimate_mode as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['estimateMode'] = $estimate_mode;\n }\n }\n\n\n // path params\n if ($blockchain !== null) {\n $resourcePath = str_replace(\n '{' . 'blockchain' . '}',\n ObjectSerializer::toPathValue($blockchain),\n $resourcePath\n );\n }\n // path params\n if ($network !== null) {\n $resourcePath = str_replace(\n '{' . 'network' . '}',\n ObjectSerializer::toPathValue($network),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-api-key');\n if ($apiKey !== null) {\n $headers['x-api-key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function order_paid_callback()\n {\n\n $query = $this->db->get('paid_orders_cache');\n if ($query->num_rows() == 0)\n return FALSE;\n\n $paid = $query->result_array();\n $coin = $this->bw_config->currencies[0];\n\n $this->load->model('transaction_cache_model');\n $this->load->model('accounts_model');\n\n foreach ($paid as $record) {\n $order = $this->get($record['order_id']);\n $vendor_address = $order['vendor_payout'];\n $admin_address = BitcoinLib::public_key_to_address($order['public_keys']['admin']['public_key'], $coin['crypto_magic_byte']);\n\n // Create the transaction outputs\n $tx_outs = array($admin_address => (string)number_format(($order['fees'] + $order['extra_fees'] - 0.0001), 8),\n $vendor_address => (string)number_format(($order['price'] + $order['shipping_costs'] - $order['extra_fees']), 8));\n\n $create_spend_transaction = $this->create_spend_transaction($order['address'], $tx_outs, $order['redeemScript']);\n if ($create_spend_transaction == TRUE) {\n $next_progress = ($order['vendor_selected_escrow'] == '1') ? '4' : '3';\n $this->progress_order($order['id'], '2', $next_progress, array('paid_time' => time()));\n } else {\n //$this->log_model->\n }\n $this->transaction_cache_model->delete_finalized_record($order['id']);\n }\n }", "public function send(string $address, int $amount)\n {\n }", "public function bluepay_oneoff_payment($params)\n\t{\n\t\t$this->_api_method = 'SALE';\n\t\t$this->_request = $this->_build_request($params);\t\t\t\n\t\treturn $this->_handle_query();\n\t}", "function transfer_money(){\n\t\t$user_id=$_REQUEST['user_id'];\n\t\t$mobile=country_code.$_REQUEST['mobile_no'];\n\t\t$amount=$_REQUEST['amount'];\n\t\t$mobile_no=$_REQUEST['mobile_no'];\n\t \n\t\t\n\t\t//$transaction_id= mt_rand( 10000000, 99999999);\n\t\t$wallet_type_main=2;// amount debit in user self\n\t\t$wallet_type_frnd=1;// amount credit in frnd\n\t\t$wallet_category_to=5;// transfer money to\n\t\t$wallet_category_from=10;// transfer money from\n\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\tif(!empty($mobile)){\n\t\t\t$user_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif(!empty($user_records)){\n\t\t\t$main_wallet=$user_records['0']['wallet_amount'];\n\t\t\t$contact_number_main=substr($user_records['0']['user_contact_no'],4); // main user mobile number\n\t\t\tif($main_wallet>=$amount){\n\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t\tif(!empty($records)){\n\t\t\t\t$contact_number_frnd=substr($records['0']['user_contact_no'],4); // frnd mobile number\n\t\t\t\t$frnd_wallet=$records['0']['wallet_amount']; \n\t\t\t\t$frnd_id=$records['0']['user_id'];\n\t\t\t\tif($frnd_id !=$user_id){\n\t\t\t\t\t// amount transfer to another\n\t\t\t$transaction_id1= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t$w_to_desc=\"Amount transfer to \".$contact_number_frnd;\n\t\t\t\t\t\t$wallet_to_transfer = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_to . '\",\"' .$transaction_id1 . '\",\"' . $w_to_desc . '\",\"' . $contact_number_frnd . '\"');\n\t\t\t\t\t\tif(!empty($wallet_to_transfer)){\n\t\t\t\t\t\t\t//amount recieved by transfer\n\t\t\t\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t$w_by_desc=\"Amount transfer from \".$contact_number_main;\n\t\t\t\t\t\t$wallet_by_transfer = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $frnd_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_from . '\",\"' .$transaction_id . '\",\"' . $w_by_desc . '\",\"' . $contact_number_main . '\"');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!empty($wallet_by_transfer)){\n\t\t\t\t\t\t\t\t$main_wallet_money=$main_wallet-$amount;\n\t\t\t\t\t\t\t\t$frnd_wallet_money=$frnd_wallet+$amount;\n\t\t\t\t\t\t\t\t// update main user wallet\n\t\t\t\t\t\t\t\t$data['wallet_amount']=$main_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user_id, $data);\n\t\t\t\t\t\t\t\t// update frnd wallet//\n\t\t\t\t\t\t\t\t$data1['wallet_amount']=$frnd_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$frnd_id, $data1);\n\t\t\t\t\t\t\t\t\t$post=array('status'=>'true','message'=>'Transfer money successfully','main_user_id'=>$user_id,'main_wallet'=>$main_wallet_money,'frnd_wallet'=>$frnd_wallet_money,'frnd_id'=>$frnd_id,'transfer_mobile'=>$mobile_no,'transfer_amount'=>$amount,'transaction_id'=>$transaction_id1,'transfer_date'=>$current_date);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Error in transfering amount\");\n\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Please enter another user number\");\n\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"This user is not exist of given number\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Wallet amount is not sufficent to transfer money\");\n\t\t\t}\n\t\t\t}else{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"invalid user\",'user_id'=>$user_id);\n\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"missing parameter\",'user_id'=>$user_id,'amount'=>$amount,'mobile'=>$moble);\n\t\t}\necho $this -> json($post);\n\t}", "function getOverrideAddress()\n {\n global $customer_id, $sendto;\n\n if (!empty($_GET['markflow']) && tep_session_is_registered('customer_id')) {\n // From now on for this user we will edit addresses on the\n // osc install, not by going to PayPal.\n tep_session_register('paypal_ec_markflow');\n $_SESSION['paypal_ec_markflow'] = 1;\n\n // find the users default address id\n if (!empty($sendto)) {\n $address_id = $sendto;\n } else {\n $default_address_id_query = tep_db_query('SELECT customers_default_address_id\n FROM ' . TABLE_CUSTOMERS . '\n WHERE customers_id = \\'' . $customer_id . '\\'');\n if (tep_db_num_rows($default_address_id_query) > 0) {\n // grab the data\n $default_address_id_arr = tep_db_fetch_array($default_address_id_query);\n $address_id = $default_address_id_arr['customers_default_address_id'];\n } else {\n // couldn't find an address.\n return false;\n }\n }\n\n // now grab the address from the database and set it\n $address_query = tep_db_query('SELECT entry_firstname, entry_lastname,\n entry_street_address, entry_suburb, entry_city, entry_postcode,\n entry_country_id, entry_zone_id\n FROM ' . TABLE_ADDRESS_BOOK . '\n WHERE address_book_id = \\'' . $address_id . '\\' AND\n customers_id = \\'' . $customer_id . '\\'\n LIMIT 1');\n\n // see if we found a record, if not well we have nothing to override with\n if (tep_db_num_rows($address_query) > 0) {\n // grab the data\n $address_arr = tep_db_fetch_array($address_query);\n\n // get the state/prov code\n $state_query = tep_db_query('SELECT zone_code\n FROM ' . TABLE_ZONES . '\n WHERE zone_id = \\'' . $address_arr['entry_zone_id'] . '\\'');\n if (tep_db_num_rows($state_query) > 0) {\n $state_code_arr = tep_db_fetch_array($state_query);\n } else {\n $state_code_arr['zone_code'] = '';\n }\n $address_arr['zone_code'] = $state_code_arr['zone_code'];\n\n // get the country code\n // ISO 3166 standard country code\n $country_query = tep_db_query('SELECT countries_iso_code_2\n FROM ' . TABLE_COUNTRIES . '\n WHERE countries_id = \\'' . $address_arr['entry_country_id'] . '\\'');\n if (tep_db_num_rows($country_query) > 0) {\n $country_code_arr = tep_db_fetch_array($country_query);\n } else {\n // default to go old US\n $country_code_arr['countries_iso_code_2'] = 'US';\n }\n $address_arr['countries_iso_code_2'] = $country_code_arr['countries_iso_code_2'];\n\n // return address data.\n return $address_arr;\n }\n }\n\n return false;\n }", "function Is_Service_Charge_Payment($event)\n{\n\tif(in_array($event->context, array('generated', 'arrange_next')))\n\t{\n\t\tforeach($event->amounts as $ea)\n\t\t{\n\t\t\tif($ea->event_amount_type == 'service_charge' && $ea->amount < 0)\n\t\t\t\treturn TRUE;\n\t \t}\n\t}\n\treturn FALSE;\n}", "function sendPaymentProof(Transaction $transaction,$payment_proof_url)\n {\n $transaction->payment_url = $payment_proof_url;\n $this->transactionRepo->save($transaction);\n //if the last status is not \"need checking\", change it\n $transactionStatus = $this->transactionStatusRepo->findByTransactionMostRecent($transaction);\n if (!$transactionStatus->isNeedChecking()){\n $transactionStatus = $this->addStatus($transaction,TransactionStatus::STATUS_NEED_CHECKING,null);\n }\n return $transactionStatus;\n }", "private function depositToWallet() {\n # there is not api_limited_quota/cashier_quota msg\n # transfer function has to return error_code and error_msg\n }", "public function get_translation_fee()\n {\n $this->load->model('cases_model', 'cases');\n $this->load->model('currencies_model', 'currencies');\n $this->load->model('estimates_model', 'estimates');\n $case_number = $this->input->post('case_number');\n $number_words = $this->input->post('number_words');\n $country_id = $this->input->post('country_id');\n $translation_rate = $this->input->post('translation_rate');\n $estimate_fee_level = $this->input->post('estimate_fee_level');\n $estimate_currency = $this->input->post('estimate_currency');\n $translation_fee = 0;\n $currency_sign = '$';\n if (!is_null($case = $this->cases->find_case_by_number($case_number))) {\n $estimate_countries = $this->estimates->get_estimate_countries($case['id'], $case['user_id'], $estimate_fee_level);\n if (!is_null($customer_fees = $this->estimates->get_customer_fees_by_countries($case['user_id'], $case['case_type_id'], $case['case_number'], $estimate_countries, $case['entity']))) {\n $translation_fee = ceil($translation_rate * $number_words + $customer_fees[$country_id]['translation_rates_for_claims'] * $case['number_words_in_claims']);\n\n if ($estimate_currency == 'euro') {\n $currency_sign = '€';\n $euro_exchange_rate = $this->currencies->get_currency_rate_by_code('EUR');\n\n $translation_fee = ceil($translation_fee / $euro_exchange_rate);\n }\n }\n }\n echo $currency_sign . $translation_fee;\n }", "public function get_restaurant_list_fees () {\n\t\t\n\t\t$restaurantIDString = $this->get_param('post.restaurant_id_list');\n\t\t$deliveryRegionID = $this->get_param('post.delivery_region_id');\n\t\t\n\t\t$extraFee = M('restaurant')\n\t\t\t->where('`id` in (' . $restaurantIDString . ')')\n\t\t\t->field('sum(`extra_fee`) as extra_fee')\n\t\t\t->find();\n\t\t\n\t\tif (!$extraFee) {\n\t\t\t$extraFee = \"0\";\n\t\t} else {\n\t\t\t$extraFee = $extraFee['extra_fee'];\n\t\t}\n\t\t\n\t\t\n\t\t$deliveryFee = M('restaurant_deliver_fee')\n\t\t\t->where(\"`region_id` = $deliveryRegionID and `restaurant_id` in ( $restaurantIDString ) \")\n\t\t\t->select();\n\t\t\n\t\t$this->return_data(['extra_fee' => $extraFee, 'delivery_fee' => $deliveryFee]);\n\t}", "private function account(){\n\t\t\t// Cross validation if the request method is POST else it will return \"Not Acceptable\" status\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\t\t\t\n\t\t\t$first_name = $this->_request['first_name'];\t\t\n\t\t\t$last_name = $this->_request['last_name'];\n\t\t\t$address = $this->_request['address'];\t\t\n\t\t\t$member_number = $this->_request['member_number'];\t\n\t\t\t$email = $this->_request['email'];\n\t\t\t$phone_number = $this->_request['phone_number'];\n\t\t\t$mobile = $this->_request['mobile'];\t\n\t\t\t$signature = $this->_request['signature'];\n\t\t\t$current_datetime = new DateTime(); \n\t\t\t$birth_date = $this->_request['birth_date'];\t\n\t\t\t$birth_date_format = substr($birth_date, 6, 4).'-'.substr($birth_date, 3, 2).'-'.substr($birth_date, 0, 2);\n\t\t\t$name_of_fund_1 = $this->_request['name_of_fund_1'];\n\t\t\t$name_of_fund_2 = $this->_request['name_of_fund_2'];\n\t\t\t$name_of_fund_3 = $this->_request['name_of_fund_3'];\n\t\t\t$name_of_fund_4 = $this->_request['name_of_fund_4'];\n\t\t\t$name_of_fund_5 = $this->_request['name_of_fund_5'];\n\t\t\t$previous_name = $this->_request['previous_name'];\n\t\t\t$name_of_fund = $name_of_fund_1;\n\t\t\tif(trim($name_of_fund_2)!=''){\n\t\t\t\t$name_of_fund .= ', '.$name_of_fund_2;\n\t\t\t}\t\n\t\t\tif(trim($name_of_fund_3)!=''){\n\t\t\t\t$name_of_fund .= ', '.$name_of_fund_3;\n\t\t\t}\n\t\t\tif(trim($name_of_fund_4)!=''){\n\t\t\t\t$name_of_fund .= ', '.$name_of_fund_4;\n\t\t\t}\n\t\t\tif(trim($name_of_fund_5)!=''){\n\t\t\t\t$name_of_fund .= ', '.$name_of_fund_5;\n\t\t\t}\t\t\t\n\t\t\t$previous_address = $this->_request['previous_address'];\n\t\t\t$result = mysql_query(\"INSERT INTO accounts (member_number, first_name, last_name, address, email, phone_number, mobile, birth_date, signature, date_created, date_modified ) \n\t\t\tVALUES ('\".$member_number.\"', '\".mysql_real_escape_string($first_name).\"', '\".mysql_real_escape_string($last_name).\"', '\".$address.\"', '\".$email.\"', '\".$phone_number.\"', '\".$mobile.\"', '\".$birth_date_format.\"', '\".$signature.\"', NOW(), NOW())\", $this->db);\n\t\t\tif($result) {\n\t\t\t\t$account_id = mysql_insert_id();\n\t\t\t\tif(trim($name_of_fund_1)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_1).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\tif(trim($name_of_fund_2)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_2).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\tif(trim($name_of_fund_3)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_3).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(trim($name_of_fund_4)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_4).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\tif(trim($name_of_fund_5)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_5).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\t\t\t\t\n\t\t\tif($result){\n\t\t\t\t$to = \tEMAIL_TO;\n\t\t\t\t$subject = \t'\"Snap4m New Account';\n\t\t\t\t$mime_boundary=\"==Multipart_Boundary_x\".md5(mt_rand()).\"x\";\n\t\t\t\t \t \t\t\t /*\t*/\n\t\t\t\t$headers = \t\"From:\".EMAIL_FROM.\"\\r\\n\";\n\t\t\t\t$headers .= \t\"MIME-Version: 1.0\\r\\n\"\n\t\t\t\t \t.\"Content-Type: multipart/mixed; boundary=\\\"{$mime_boundary}\\\"\";\t\t\t\t\t \t \n\t $message = \"This is a multi-part message in MIME format.\\n\\n\".\n\t \"--{$mime_boundary}\\n\" .\n\t \"Content-Type: text/plain; charset=\\\"iso-8859-1\\\"\\n\" .\n\t \"Content-Transfer-Encoding: 7bit\\n\\n\";\n\t $message .= \"Name: \".htmlspecialchars($first_name).' '.htmlspecialchars($last_name).\"\\r\\n\"\n\t\t\t\t\t.\"Member No: \".$member_number.\"\\r\\n\"\n\t\t\t\t\t.\"Birthdate: \".$birth_date.\"\\r\\n\"\n\t\t\t\t\t.\"Address: \".$address.\"\\r\\n\"\n\t\t\t\t\t.\"Email: \".$email.\"\\r\\n\"\n\t\t\t\t\t.\"Phone No: \".$phone_number.\"\\r\\n\"\n\t\t\t\t\t.\"Mobile: \".$mobile.\"\\r\\n\"\n\t\t\t\t\t.\"Name of Fund: \".htmlspecialchars($name_of_fund).\"\\r\\n\"\n\t\t\t\t\t.\"Previous Name: \".htmlspecialchars($previous_name).\"\\r\\n\"\n\t\t\t\t\t.\"Previous Address: \".$previous_address.\"\\r\\n\\r\\n\".\"Signature:\\n\\n\";\n\t // attachment with mime babble\n\t $message .= \"--{$mime_boundary}\\n\";\t\t\t\t\t\t\t \t \n\t\t\t\t$file = \tfile_get_contents(\"http://snap4m.com/signatures/\".$signature);\t\t\t\t\t\t \t \n\t\t\t\t$message .= \t\"Content-Type: image/png; name=\\\"\".$signature.\"\\\"\\r\\n\"\n\t\t\t\t \t.\"Content-Transfer-Encoding: base64\\r\\n\"\n\t\t\t\t \t.\"Content-disposition: attachment; file=\\\"\".$signature.\"\\\"\\r\\n\"\n\t\t\t\t \t.\"\\r\\n\"\n\t\t\t\t \t.chunk_split(base64_encode($file))\n\t\t\t\t \t.\"--{$mime_boundary}--\\n\";\n\t\t\t\t\n\t\t\t\tif(mail($to, $subject, $message, $headers))\n\t\t\t\t{\n\t\t\t\t $this->response('success', 200);\n\t\t\t\t} else {\n\t\t\t\t $this->response('success', 200);\n\t\t\t\t} \t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t//$this->response('success', 200);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Add Failed\");\n\t\t\t\t$this->response($this->json($error), 400);\t\t\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}", "public function validatePayment()\n\t{\n\t\t$array_result = array();\n\t\t$array_result['verified'] = 0;\n\t\t$array_result['tot_paid'] = 0.0;\n\t\t$array_result['log'] = '';\n\t\t\n\t\t//cURL Method HTTP1.1 October 2013\n\t\t$raw_post_data \t= file_get_contents('php://input');\n\t\t$raw_post_array = explode('&', $raw_post_data);\n\t\t\n\t\t$myPost = array();\n\t\tforeach ($raw_post_array as $keyval)\n\t\t{\n\t\t\t$keyval = explode('=', $keyval);\n\t\t\tif (count($keyval) == 2)\n\t\t\t{\n\t\t\t\t$myPost[$keyval[0]] = urldecode($keyval[1]);\n\t\t\t}\n\t\t}\n\n\t\t// check if the form has been spoofed\n\t\t$against = array(\n\t\t\t'business' \t => $this->account,\n\t\t\t'mc_gross' \t => number_format($this->order_info['total_net_price'], 2, '.', ''),\n\t\t\t'mc_currency' => $this->order_info['transaction_currency'],\n\t\t\t'tax'\t\t => number_format($this->order_info['total_tax'], 2, '.', ''),\n\t\t);\n\n\t\t/**\n\t\t * If the account name contains the merchant code instead\n\t\t * of the e-mail related to the account, the spoofing check will fail\n\t\t * as the merchant code is always converted into the account e-mail.\n\t\t *\n\t\t * For example, if we specify 835383648, PayPal will return the related\n\t\t * account: dev@e4j.com\n\t\t * Then, 2 different values will be compared:\n\t\t * \"835383648\" ($this->account) againt \"dev@e4j.com\" ($myPost['business'])\n\t\t */\n\n\t\t// inject the original values within the payment data\n\t\tforeach ($against as $k => $v)\n\t\t{\n\t\t\tif (isset($myPost[$k]))\n\t\t\t{\n\t\t\t\t$myPost[$k] = $v;\n\t\t\t}\n\t\t}\n\t\t//\n\n\t\t$req = 'cmd=_notify-validate';\n\t\tif (function_exists('get_magic_quotes_gpc'))\n\t\t{\n\t\t\t$get_magic_quotes_exists = true;\n\t\t}\n\n\t\tforeach ($myPost as $key => $value)\n\t\t{\n\t\t\tif ($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1)\n\t\t\t{\n\t\t\t\t$value = urlencode(stripslashes($value));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$value = urlencode($value);\n\t\t\t}\n\n\t\t\t$req .= \"&$key=$value\";\n\t\t\t$array_result['log'] .= \"&$key=$value\\n\";\n\t\t}\n\t\t\n\t\tif (!function_exists('curl_init'))\n\t\t{\n\t\t\t$array_result['log'] = \"FATAL ERROR: cURL is not installed on the server\\n\\n\" . $array_result['log'];\n\n\t\t\treturn $array_result;\n\t\t}\n\t\t\n\t\tif ($this->sandbox == 1)\n\t\t{\n\t\t\t$paypal_url = \"https://www.sandbox.paypal.com/cgi-bin/webscr\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$paypal_url = \"https://www.paypal.com/cgi-bin/webscr\";\n\t\t}\n\t\t\n\t\t$ch = curl_init($paypal_url);\n\t\tif ($ch == false)\n\t\t{\n\t\t\t$array_result['log'] = \"Curl error: \" . curl_error($ch) . \"\\n\\n\" . $array_result['log'];\n\n\t\t\treturn $array_result;\n\t\t}\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $req);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\t\t\n\t\t/**\n\t\t * Turn on TLS 1.2 protocol in case of safe mode or sandbox enabled.\n\t\t *\n\t\t * @since 1.6.2\n\t\t */\n\t\tif (defined('CURLOPT_SSLVERSION') && ($this->sandbox || $this->safemode))\n\t\t{\n\t\t\tcurl_setopt($ch, CURLOPT_SSLVERSION, 6);\n\t\t}\n\n\t\tcurl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\n\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\n\t\t\n\t\t// CONFIG: Please download 'cacert.pem' from \"http://curl.haxx.se/docs/caextract.html\" and copy it in the same folder as this php file\n\t\t// This is mandatory for some environments.\n\t\t// $cert = dirname(__FILE__) . \"/cacert.pem\";\n\t\t// curl_setopt($ch, CURLOPT_CAINFO, $cert);\n\t\t\n\t\t$res = curl_exec($ch);\n\n\t\tif (curl_errno($ch) != 0)\n\t\t{\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e] ') . \" Can't connect to PayPal to validate IPN message: \" . curl_error($ch) . PHP_EOL;\n\n\t\t\tcurl_close($ch);\n\n\t\t\treturn $array_result;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e]') . \" HTTP request of validation request:\". curl_getinfo($ch, CURLINFO_HEADER_OUT) .\" for IPN payload: $req\" . PHP_EOL;\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e]') . \" HTTP response of validation request: $res\" . PHP_EOL;\n\t\t\t\n\t\t\tcurl_close($ch);\n\t\t}\n\t\t\n\t\tif (strcmp(trim($res), 'VERIFIED') == 0)\n\t\t{\n\t\t\t$array_result['tot_paid'] = $_POST['mc_gross'];\n\t\t\t$array_result['verified'] = 1;\n\t\t\t$array_result['log'] = '';\n\t\t}\n\t\telse if (strcmp(trim($res), 'INVALID') == 0)\n\t\t{\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e]'). \" Invalid IPN: $req\\n\\nResponse: [$res]\" . PHP_EOL;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e]'). \" Unknown Error: $req\\n\\nResponse: [$res]\" . PHP_EOL;\n\t\t}\n\t\t\n\t\t//END cURL Method HTTP1.1 October 2013\n\t\t\n\t\treturn $array_result;\n\t}", "public function notify(TransferFundsNotification $notification)\n {\n $sender = $this->members->with($notification->senderId());\n $recipient = $this->members->with($notification->recipientId());\n\n $this->sender->sendFundsTransferredEmail(\n $sender->information(),\n $recipient->information(),\n $notification->amount(),\n $notification->occurredOn()\n );\n\n $this->sender->sendDepositReceivedEmail(\n $sender->information(),\n $recipient->information(),\n $notification->amount(),\n $notification->occurredOn()\n );\n }", "public function sendConfirmed($payment_address_id, $destination, $quantity, $asset, $fee=null, $dust_size=null, $request_id=null) {\n return $this->sendFromAccount($payment_address_id, $destination, $quantity, $asset, 'default', false, $fee, $dust_size, $request_id);\n }", "function paid_sendEmail_supplier($details) {\n\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$custemail = $details->accountEmail;\t\t\t\t\n\t\t\t\t$sendto = $this->supplierEmail($details->module, $details->itemid);\n\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"<a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$template = $this->shortcode_variables(\"bookingpaidsupplier\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidsupplier\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidadmin\");\n\t\t\t\t$values = array($invoiceid, $refno, $deposit, $totalamount, $custemail, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $name);\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= str_replace($template, $values, $details[0]->temp_body);\n\t\t\t\t$message .= $this->mailFooter;\n\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $this->adminmobile, \"bookingpaidadmin\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Payment Notification');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function pay($moneyBookersTransactionId, $toEmail, $amount){\n if($this->prepearePayment($moneyBookersTransactionId, $toEmail, $amount)){\n return $this->transfer();\n }else {\n return false;\n }\n }", "public function estimated_shipping() {\n\n\t\t$this->api_record_event( $this->event_name['estimated_shipping'] );\n\t}", "public function issetFee($index)\n {\n return isset($this->fee[$index]);\n }", "protected function makePayment(){\n\t \n $receiver = Input::get('number');\n $amounttosend = Input::get('amount');\n $currency = Input::get('currency');\n $destinationProvider = Input::get('target');\n $charges = new PlatformCharges($amounttosend, $currency, $destinationProvider);\n $desc = $charges->getReceiverType($destinationProvider);\n $user = User::find(Auth::user()->id);\n \n $transaction = [\n 'Customer' => [\n 'FirstName' => Auth::user()->name,\n 'Street1' => 'Level 5',\n 'Country' => 'US',\n 'Mobile' => Auth::user()->number,\n 'Email' => Auth::user()->email\n ],\n 'Items' => [\n [\n 'SKU' => mt_rand(),\n 'Description' => 'Hybrid Transfer from EWAY to '.$desc.' user',\n 'Quantity' => 1,\n 'UnitCost' => $charges->convertCurrency($currency, 'AUD',$charges->getDueAmount('ew', $destinationProvider)),\n 'Tax' => 100, //$1 applied as charge to every transaction irrespective of the amount transfered\n // Total is calculated automatically\n ]\n ],\n 'Options' => [\n [\n 'Value' => $desc,//Receipient's payement system\n ],\n [\n 'Value' => $receiver, //receiver's details to which to make the due transfer\n ],\n [\n 'Value' => 'AUD', // currency used to make the transfer when sending to the receipient\n ],\n [\n 'Value' =>(0.01 * $amounttosend)\n ]\n ],\n 'Payment' => [\n 'TotalAmount' => $charges->convertCurrency($currency, 'AUD',$charges->getDueAmount('ew', $destinationProvider)) * 100, //$amounttosend,\n 'CurrencyCode' => 'AUD'\n ],\n 'Method' => 'ProcessPayment',\n 'RedirectUrl' => URL::route('dashboard').'/ewayconfirm',\n 'CancelUrl' => URL::route('dashboard').'/ewaycancel',\n 'PartnerID' => EwayController::$_EWAY_CUSTOMER_ID,\n 'TransactionType' => \\Eway\\Rapid\\Enum\\TransactionType::PURCHASE, //normally would be PURCHASE. Modes are MOTO, Recurring\n 'Capture' => true,\n 'LogoUrl' => 'https://izepay.iceteck.com/public/images/logo.png',\n 'HeaderText' => 'Izepay Money Transfer',\n 'Language' => 'EN',\n 'CustomView' => 'BootstrapCerulean', //Bootstrap, BootstrapAmelia, BootstrapCerulean, BootstrapCosmo, BootstrapCyborg, BootstrapFlatly, BootstrapJournal, BootstrapReadable, BootstrapSimplex, BootstrapSlate, BootstrapSpacelab, BootstrapUnited\n 'VerifyCustomerEmail' => true,\n 'Capture' => true,\n 'CustomerReadOnly' => false\n ];\n try{\n $response = $this->client->createTransaction(\\Eway\\Rapid\\Enum\\ApiMethod::RESPONSIVE_SHARED, $transaction);\n //var_dump($response);\n// echo $response->SharedPaymentUrl;\n //sleep(20);\n }catch(Exception $ex){\n return Redirect::route('dashboard')\n\t\t\t \t->with('alertError', 'Debug Error: '.$ex->getMessage());\n }\n //manage response\n \n if (!$response->getErrors()) {\n // Redirect to the Responsive Shared Page\n header('Location: '.$response->SharedPaymentUrl);\n //die();\n } else {\n foreach ($response->getErrors() as $error) {\n //echo \"Response Error: \".\\Eway\\Rapid::getMessage($error).\"<br>\";\n return Redirect::route('dashboard')\n\t\t\t \t ->with('alertError', 'Error! '.\\Eway\\Rapid::getMessage($error));\n }\n }\n\t}", "public function calculateshipping(Request $request)\n {\n $pickUp = $request->pickup;\n $pickupState = $request->pickupState;\n $dropOff = $request->dropoff;\n $dropoffState = $request->dropoffState;\n $totalShipping = 0;\n $finalShipping = 0;\n if (!empty($pickUp)) {\n $PickUpresult = DB::table($this->DBTables['Shipping'].' as shp')\n ->join($this->DBTables['Regions'].' as reg', 'reg.id', '=', 'shp.region_id')\n ->where([['reg.stateid', '=', $pickupState],['shp.postcode', '=', $pickUp]])\n ->select('shp.id', 'shp.postcode', 'shp.shipping_cost', 'shp.suburb', 'reg.region')\n ->get();\n if (count($PickUpresult) > 0) {\n $totalShipping = $totalShipping + $PickUpresult[0]->shipping_cost;\n }else{\n $totalShipping = $totalShipping + 50;\n }\n }\n if (!empty($dropOff)) {\n $DropOffresult = DB::table($this->DBTables['Shipping'].' as shp')\n ->join($this->DBTables['Regions'].' as reg', 'reg.id', '=', 'shp.region_id')\n ->where([['reg.stateid', '=', $dropoffState],['shp.postcode', '=', $dropOff]])\n ->select('shp.id', 'shp.postcode', 'shp.shipping_cost', 'shp.suburb', 'reg.region')\n ->get();\n if (count($DropOffresult) > 0) {\n $totalShipping = $totalShipping + $DropOffresult[0]->shipping_cost;\n }else{\n $totalShipping = $totalShipping + 50;\n }\n }\n $freightPrice = Config::get('constants.FreightPrice');\n if ($totalShipping > $freightPrice) {\n $finalShipping = $totalShipping - $freightPrice;\n }\n return $finalShipping;\n }", "public function ProcessGatewayPing()\n\t{\n\t\tif(!isset($_REQUEST['payment_reference']) || !isset($_REQUEST['bank_reference']) || !isset($_REQUEST['orderToken']) || !isset($_REQUEST['signature'])) {\n\t\t\texit;\n\t\t}\n\n\t\t$paymentReference = $_REQUEST['payment_reference'];\n\t\t$paymentAmount = number_format($_REQUEST['payment_amount'], 2, '.', '');\n\t\t$orderToken = $_REQUEST['orderToken'];\n\t\t$sessionToken = $_REQUEST['sessionToken'];\n\t\t$requestSignature = $_REQUEST['signature'];\n\t\t$transactionId = $_REQUEST['payment_number'];\n\t\t$bankReference = $_REQUEST['bank_reference'];\n\n\t\t$this->SetOrderData(LoadPendingOrdersByToken($orderToken));\n\n\t\t$orders = $this->GetOrders();\n\t\tlist(,$order) = each($orders);\n\t\t$orderId = $order['orderid'];\n\n\t\t// GetGatewayAmount returns the amount from the order record, so $amount is that but formatted into #.##\n\t\t$amount = number_format($this->GetGatewayAmount(), 2, '.', '');\n\n\t\t// verify that the signature matches\n\t\t$verifySignature = md5($amount . $orderToken . $orderId . GetConfig('EncryptionToken'));\n\n\t\tif ($verifySignature != $requestSignature) {\n\t\t\t$errorMsg = GetLang('NabSignatureMismatchDetails', array('orderId' => $orderId, 'transactionId' => $transactionId));\n\t\t\t$GLOBALS['ISC_CLASS_LOG']->LogSystemError(array('payment', $this->GetName()), GetLang('NabSignatureMismatch'), $errorMsg);\n\t\t\treturn false;\n\t\t}\n\n\t\t/** @var ISC_TRANSACTION */\n\t\t$transaction = GetClass('ISC_TRANSACTION');\n\n\t\t$previousTransaction = $transaction->LoadByTransactionId($transactionId, $this->GetId());\n\n\t\tif(is_array($previousTransaction) && $previousTransaction['transactionid']) {\n\t\t\t$GLOBALS['ISC_CLASS_LOG']->LogSystemError(array('payment', $this->GetName()), sprintf(GetLang('NabTransactionAlreadyProcessed'), $_REQUEST['payment_date']));\n\t\t\treturn false;\n\t\t}\n\n\t\t// Need to finish the processing of the pingback\n\t\t$newTransaction = array(\n\t\t\t'providerid' => $this->GetId(),\n\t\t\t'transactiondate' => $_REQUEST['payment_date'],\n\t\t\t'transactionid' => $transactionId,\n\t\t\t'orderid' => $orderId,\n\t\t\t'message' => 'Completed',\n\t\t\t'status' => '',\n\t\t\t'amount' => $_REQUEST['payment_amount'],\n\t\t\t'extrainfo' => array()\n\t\t);\n\n\t\t$newTransaction['status'] = TRANS_STATUS_COMPLETED;\n\t\t$newOrderStatus = ORDER_STATUS_AWAITING_FULFILLMENT;\n\n\t\t$transaction->Create($newTransaction);\n\n\t\t// If the order was previously incomplete, empty the customers cart\n\t\tif($this->GetOrderStatus() == ORDER_STATUS_INCOMPLETE) {\n\t\t\tsession_write_close();\n\t\t\t$session = new ISC_SESSION($sessionToken);\n\t\t\tEmptyCartAndKillCheckout();\n\t\t}\n\n\t\t$status = $newOrderStatus;\n\t\t// If it's a digital order & awaiting fulfillment, automatically complete it\n\t\tif($order['ordisdigital'] && $status == ORDER_STATUS_AWAITING_FULFILLMENT) {\n\t\t\t$status = ORDER_STATUS_COMPLETED;\n\t\t}\n\t\tUpdateOrderStatus($orderId, $status);\n\n\t\t$updatedOrder = array(\n\t\t\t'ordpayproviderid' => $_REQUEST['payment_number'],\n\t\t\t'ordpaymentstatus' => 'captured',\n\t\t);\n\n\t\t$this->UpdateOrders($updatedOrder);\n\n\t\t// This was a successful order\n\t\t$oldStatus = GetOrderStatusById($this->GetOrderStatus());\n\n\t\tif(!$oldStatus) {\n\t\t\t$oldStatus = 'Incomplete';\n\t\t}\n\n\t\t$newStatus = GetOrderStatusById($newOrderStatus);\n\t\t$extra = GetLang('NabSuccessDetails',\n\t\t\tarray(\n\t\t\t\t'orderId' \t\t\t=> $orderId,\n\t\t\t\t'amount' \t\t\t=> $amount,\n\t\t\t\t'bankAuth' \t\t\t=> $bankReference,\n\t\t\t\t'transactionId' \t=> $transactionId,\n\t\t\t\t'paymentStatus' \t=> 'Captured',\n\t\t\t\t'newOrderStatus' \t=> $newStatus,\n\t\t\t\t'oldOrderStatus' \t=> $oldStatus,\n\t\t\t)\n\t\t);\n\t\t$GLOBALS['ISC_CLASS_LOG']->LogSystemSuccess(array('payment', $this->GetName()), GetLang('NabSuccess'), $extra);\n\t\treturn true;\n\t}", "private function formFeeSuccessBmda ($irrigation_payment) {\n if ($irrigation_payment->payment_type_id == 1) {\n $FarSchApplication = FarmerSchemeApplication::find($irrigation_payment->far_application_id);\n $FarSchApplication->payment_status = 1;\n $FarSchApplication->save();\n }\n }", "public function send() {\n\n\t\t\t$campaign = Campaigns::findOrFail($this->request->_id);\n\n\t\t\t//<---- Verify Pledge send\n\t\t\tif(isset($this->request->_pledge) && $this->request->_pledge != 0 ){\n\t\t\t\t$findPledge = $campaign->rewards->where('id', $this->request->_pledge)\n\t\t\t\t\t\t->where('campaigns_id', $this->request->_id)\n\t\t\t\t\t\t->where('amount', $this->request->amount)->first();\n\n\t\t\t\t$pledgeClaimed = $campaign->donations()->where('rewards_id', $findPledge->id)->count();\n\t\t\t}\n\n\t\t\tif(isset($findPledge) && $pledgeClaimed < $findPledge->quantity) {\n\t\t\t\t$this->request->_pledge = $findPledge->id;\n\t\t\t} else {\n\t\t\t\t$this->request->_pledge = 0;\n\t\t\t}\n\n\t\t\t// Currency Position\n\t\t\tif($this->settings->currency_position == 'right') {\n\t\t\t\t$currencyPosition = 2;\n\t\t\t} else {\n\t\t\t\t$currencyPosition = null;\n\t\t\t}\n\n\t\t\tValidator::extend('check_payment_gateway', function($attribute, $value, $parameters)\n\t\t\t{\n\t\t\t\treturn PaymentGateways::find($value);\n\t\t\t});\n\n\t\t\t$data = $this->request->all();\n\n\t\t\t$data['_captcha'] = $this->settings->captcha_on_donations == 'off' ? $data['_captcha'] = 1 : $data['_captcha'] = 0;\n\n\t\t\t$messages = array (\n\t\t\t'amount.min' => trans('misc.amount_minimum'.$currencyPosition, ['symbol' => $this->settings->currency_symbol, 'code' => $this->settings->currency_code]),\n\t\t\t'amount.max' => trans('misc.amount_maximum'.$currencyPosition, ['symbol' => $this->settings->currency_symbol, 'code' => $this->settings->currency_code]),\n\t\t\t'payment_gateway.check_payment_gateway' => trans('admin.payments_error'),\n\n\t\t\t'bank_transfer.required_if' => trans('admin.bank_transfer_required'),\n\t\t\t'bank_transfer.min' => trans('admin.bank_transfer_limit'),\n\t\t\t'bank_transfer.max' => trans('admin.bank_transfer_limit'),\n\t\t\t'g-recaptcha-response.required_if' => trans('admin.captcha_error_required'),\n\t 'g-recaptcha-response.captcha' => trans('admin.captcha_error'),\n\t\t);\n\n\t\t//<---- Validation\n\t\t$validator = Validator::make($data, [\n\t\t\t\t'amount' => 'required|integer|min:'.$this->settings->min_donation_amount.'|max:'.$this->settings->max_donation_amount,\n 'full_name' => 'required|max:25',\n 'email' => 'required|email|max:100',\n 'country' => 'required',\n 'postal_code' => 'required|max:30',\n 'comment' => 'nullable|max:100',\n\t\t\t\t'payment_gateway' => 'required|check_payment_gateway',\n\t\t\t\t'bank_transfer' => 'required_if:payment_gateway,==,3|min:10|max:300',\n\t\t\t\t'g-recaptcha-response' => 'required_if:_captcha,==,0|captcha'\n\n\t \t],$messages);\n\n\t\t\tif ($validator->fails()) {\n\t\t\t return response()->json([\n\t\t\t\t\t 'success' => false,\n\t\t\t\t\t 'errors' => $validator->getMessageBag()->toArray(),\n\t\t\t\t\t ]);\n\t\t\t }\n\n\t\t\t\t\t// Get name of Payment Gateway\n\t\t\t\t\t$payment = PaymentGateways::find($this->request->payment_gateway);\n\n\t\t\t\t\tif(!$payment) {\n\t\t\t\t\t\treturn response()->json([\n\t\t\t\t\t\t\t\t'success' => false,\n\t\t\t\t\t\t\t\t'errors' => ['error' => trans('admin.payments_error')],\n\t\t\t\t\t\t]);\n\t\t\t\t\t}\n\n\t\t\t\t\t$data = [\n\t\t\t\t\t\t'campaign_id' => $campaign->id,\n\t\t\t\t\t\t'campaign_title' => $campaign->title,\n\t\t\t\t\t];\n\n\t\t\t\t\t$data_all = $this->request->except(['_token']);\n\t\t\t\t\t$dataGlobal = array_merge($data, $data_all);\n\n\t\t\t\t\t// Send data to the payment processor\n\t\t\t\t\t\treturn redirect()->route(str_slug($payment->name), $dataGlobal);\n\t\t\t}", "function give_require_billing_address( $payment_mode ) {\n\n\t$return = false;\n\t$billing_country = ! empty( $_POST['billing_country'] ) ? give_clean( $_POST['billing_country'] ) : 0; // WPCS: input var ok, sanitization ok, CSRF ok.\n\n\tif ( $billing_country || did_action( \"give_{$payment_mode}_cc_form\" ) || did_action( 'give_cc_form' ) ) {\n\t\t$return = true;\n\t}\n\n\t// Let payment gateways and other extensions determine if address fields should be required.\n\treturn apply_filters( 'give_require_billing_address', $return );\n\n}", "function process_payment($order_number, $order_total, &$d) {\n return true;\n }", "public function sendFrom($fromaccount, $tobitcoinaddress, $amount, $minconf = 1, $comment = '', $commentTo = '');", "function openstack_change_funds($invoiceid, $substract=False) {\n $items = Capsule::table('tblinvoiceitems')->where('invoiceid', '=', $invoiceid)->get();\n\n // Retrieve the invoice total paid.\n // If this invoice was not fully paid, we do not substract from Fleio.\n // There is no other way to prevent subtracting from Fleio when cancelling an invoice and marking it unpaid afterwards\n try {\n $balance = Capsule::table('tblaccounts as ta')\n ->where('ta.invoiceid', '=', $invoiceid)\n ->join('tblinvoices as ti', 'ta.invoiceid', '=', 'ti.id')\n ->select(Capsule::raw('SUM(ta.amountin)-SUM(ta.amountout)-ti.total as balance'))\n ->value('balance');\n } catch (Exception $e) {\n logActivity($e->getMessage());\n $balance = false;\n } \n $cost_by_service = array();\n $promo_by_service = array();\n foreach($items as $item) {\n # NOTE(tomo): Check if relid is set and not an empty string\n if (($item->relid == '') || !isset($item->relid)) {\n continue;\n }\n if ($item->type == 'PromoHosting') {\n # NOTE(tomo): Do nothing with $promo_by_service. Just don't add it\n # to the final amount to avoid incorrect credit addition in Fleio\n if (isset($promo_by_service[$item->relid])) {\n $promo_by_service[$item->relid] += $item->amount;\n } else {\n $promo_by_service[$item->relid] = $item->amount;\n }\n } else {\n if (isset($cost_by_service[$item->relid])) {\n $cost_by_service[$item->relid] += $item->amount;\n } else {\n $cost_by_service[$item->relid] = $item->amount;\n }\n }\n }\n\n foreach($items as $item) {\n if (($item->type != 'Hosting') || !isset($cost_by_service[$item->relid])) {\n continue;\n }\n # We now know that relid is a Hosting package (not a Domain for example)\n $service = FleioUtils::getServiceById($item->relid);\n if ($service->servertype == 'fleio') {\n # NOTE(tomo): Make sure the service is active. If it's not active and we don't handle this, the credit is lost.\n # NOTE(tomo): We currently handle this in the add/remove credit methods.\n $clientCurrency = getCurrency($item->userid);\n $defaultCurrency = getCurrency();\n $clientAmount = $cost_by_service[$item->relid]; // Amount + Setup and/or other related prices in client's currency\n # NOTE(tomo): Fleio needs to use the WHMCS default currency\n $amount = convertCurrency($clientAmount, 1, $clientCurrency['id']); // Amount in default currency.\n if ($amount == 0) {\n logActivity('Fleio: ignoring Service ID: '. $item->relid . ' with cost equal to 0 from Invoice ID: ' . $invoiceid);\n continue;\n }\n if ($substract && $balance != false && $balance >= 0) {\n logActivity('Fleio: ignoring Service ID: '. $item->relid .' from Invoice ID: ' . $invoiceid . ' with status Unpaid but fully paid');\n continue;\n }\n $fl = Fleio::fromServiceId($item->relid);\n if ($substract) {\n $msg_format = \"Fleio: removing credit for WHMCS User ID: %s with %.02f %s (%.02f %s from Invoice ID: %s)\";\n } else {\n $msg_format = \"Fleio: adding credit for WHMCS User ID: %s with %.02f %s (%.02f %s from Invoice ID: %s)\";\n }\n $msg = sprintf($msg_format, $item->userid, $amount, $defaultCurrency[\"code\"], $clientAmount, $clientCurrency[\"code\"], $invoiceid);\n logActivity($msg);\n # TODO(tomo): We use the userid which can be a contact ?\n try {\n $addCredit = (!$subtract); // Add credit or subtract, boolean\n $response = $fl->clientChangeCredit($addCredit, $amount, $defaultCurrency[\"code\"], $clientCurrency[\"rate\"], $clientAmount, $clientCurrency[\"code\"], $invoiceid);\n } catch (FlApiException $e) {\n logActivity(\"Unable to update the client credit in Fleio: \" . $e->getMessage()); \n return;\n }\n logActivity(\"Fleio: successfully changed client credit with \".$amount.\" \".$defaultCurrency[\"code\"]. \" for Fleio client id: \".$response['client'].\". New Fleio balance: \".$response['credit_balance'].\" \".$defaultCurrency[\"code\"]); \n }\n }\n}", "public static function get_stripe_fee( $order = null ) {\n\t\tif ( is_null( $order ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();\n\n\t\t$amount = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, self::META_NAME_FEE, true ) : $order->get_meta( self::META_NAME_FEE, true );\n\n\t\t// If not found let's check for legacy name.\n\t\tif ( empty( $amount ) ) {\n\t\t\t$amount = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, self::LEGACY_META_NAME_FEE, true ) : $order->get_meta( self::LEGACY_META_NAME_FEE, true );\n\n\t\t\t// If found update to new name.\n\t\t\tif ( $amount ) {\n\t\t\t\tself::update_stripe_fee( $order, $amount );\n\t\t\t}\n\t\t}\n\n\t\treturn $amount;\n\t}", "function mail_payout($email, $user, $amount, $wallet, $txid)\n{\n global $mail_headers;\n\n $message = \"Hello,\\n\\nThis is a BTC withdrawal notification from https://www.bitjack21.com for $user.\\n\\n$amount BTC has just been sent to your Bitcoin wallet $wallet\\n\\nYou can track this payout on blockexplorer.com using the transaction ID $txid as per below:\\n\\nhttp://blockexplorer.com/tx/$txid\\n\\nThanks for playing!\\n\\n--\\nbitjack21.com\";\n\n mail($email, \"[BitJack21] Withdrawal Notification\", $message, $mail_headers);\n}", "function paid_sendEmail_owner($details) {\n\t\t\t\t$currencycode = $details->currCode;\n\t\t\t\t$currencysign = $details->currSymbol;\n\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$totalamount = $details->checkoutTotal;\n\t\t\t\t$deposit = $details->checkoutAmount;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$custemail = $details->accountEmail;\t\t\t\t\n\t\t\t\n\t\t\t\t$sendto = $this->ownerEmail($details->module, $details->itemid);\n\t\t\t\t$sitetitle = \"\";\n\t\t\t\t\n\t\t\t\t$message = $this->mailHeader;\n\t\t\t\t$message .= \"<h4><b>Booking Paid Successfully</b></h4>\";\n\t\t\t\t$message .= \"Invoice No.: \" . $invoiceid . \".<br>\";\n\t\t\t\t//$message .= \"Payment Method: \" . $paymethod . \".<br><br>\";\n\t\t\t\t$message .= \"Deposit Amount: \" . $currencycode . \" \" . $currencysign . $deposit . \"<br>\";\n\t\t\t\t$message .= \"Total Amount: \" . $currencycode . \" \" . $currencysign . $totalamount . \"<br><br>\";\n\t\t\t\t$message .= \"<h4><b>Customer Information</b></h4>\";\n\t\t\t\t$message .= \"Customer ID: \" . $custid . \"<br>\";\n\t\t\t\t$message .= \"Name : \" . $name . \"<br>\";\n\t\t\t\t$message .= \"Email : \" . $custemail . \"<br>\";\n\t\t\t\t$message .= \"Country : \" . $country . \"<br>\";\n\t\t\t\t$message .= \"Phone : \" . $phone . \"<br>\";\n\t\t\t\t$message .= \"<br> To view Invoice <a href=\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \" >\" . base_url() . \"invoice?id=\" . $invoiceid . \"&sessid=\" . $refno . \"</a>\";\n\t\t\t\t$message .= $this->mailFooter;\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Booking Payment Notification');\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t}", "public function processPayment();", "function dosql_fee(){\n global $conn;\n $paid=$_SESSION['pay_not'];\n if($paid=='All'){\n $sql4=\"SELECT * FROM owner_fee\";\n $result4=mysqli_query($conn,$sql4);\n\n\n\n return $result4;\n \n }else if($paid=='N'){\n $sql5=\"SELECT * FROM owner_fee where paid='N' \";\n $result5=mysqli_query($conn,$sql5);\n return $result5;\n }else if($paid='Y'){\n $sql6=\"SELECT * FROM owner_fee where paid='Y' \";\n $result6=mysqli_query($conn,$sql6);\n return $result6;\n }\n }", "public function makePayment(Request $request){\n //iniatilize constants\n $email = $request->p_email;\n $amount = $request->amount;\n $password = $request->p_password;\n $getter = User::where('email', 'awazoneinfo@gmail.com')->get();\n\n //check the users balance\n $check = User::where('email', $email)->where('password', $password)->get();\n if(count($check)< 1){\n\n return response( ['message' => 'User not found'], 404);\n\n }else{\n //subtract the amount from users balance\n //check balance\n if(($check[0]->balance) >= $amount){\n $subtract = $check[0]->balance - $amount;\n User::where('email', $email)->update(['balance'=> $subtract]);\n \n //input into transaction history\n $transaction = new TransactionsHistory;\n\n $transaction->amount = $amount;\n $transaction->description = \"Awazone.net Payment \";\n $transaction->time = now();\n $transaction->user_id = $check[0]->id;\n\n $saved = $transaction->save();\n\n if($saved){\n //add payment to awazone\n $add = $getter[0]->balance + $amount;\n User::where('email', 'awazoneinfo@gmail.com')->update(['balance' => $add]);\n $receiver = new TransactionsHistory;\n $receiver->amount = $amount;\n $receiver->description = $check[0]->username.\" Payment from Awazone\";\n $receiver->time = now();\n $receiver->user_id = $getter[0]->id;\n $save = $receiver -> save();\n if($save){\n return response(['message'=> 'Payment made Successfully', 'status'=> 'ok'], 200);\n }else{\n return response(['message' => 'An error occur'], 417);\n }\n \n }else{\n return response(['message' => 'An error occur'], 501);\n }\n\n\n }else{\n return response(['message'=> 'Insufficient Balance'], 402);\n }\n \n }\n }", "function cf_order_valid_amount($params)\n\t{\n\t\t/* Insert: (grand_total - plan_total) < new_amount => error */\n\t\t/* Update: (grand_total - sum(plan_amount except current id)) < new_amount => error */\n\t\t$params = is_array($params) ? (object) $params : $params;\n\t\tif (! isset($params->order_id) && !$params->order_id)\n\t\t\treturn false;\n\t\t\n\t\t$id = isset($params->id) && $params->id ? 'and t2.id <> '.$params->id : '';\n\t\t$order_id = $params->order_id;\n\t\tif (isset($params->is_plan) && $params->is_plan) {\n\t\t\t// $str = \"SELECT grand_total,\n\t\t\t\t// (\n\t\t\t\t\t// select coalesce(sum(amount),0) from cf_order_plan t2 where t2.is_active = '1' and t2.is_deleted = '0' and t2.order_id = t1.id $id\n\t\t\t\t// ) as plan_total \n\t\t\t\t// from cf_order t1 where t1.id = $order_id\";\n\t\t\t$str = \"SELECT (grand_total - (select coalesce(sum(amount),0) from cf_order_plan t2 where t2.is_active = '1' and t2.is_deleted = '0' and t2.order_id = t1.id $id)) as amount \n\t\t\t\tfrom cf_order t1 where t1.id = $order_id\";\n\t\t}\n\t\t$row = $this->db->query($str)->row();\n\t\t// if ($row->grand_total - $row->plan_total - $params->amount < 0) {\n\t\tif ($row->amount - $params->amount < 0) {\n\t\t\t// $this->session->set_flashdata('message', $row->grand_total - $row->plan_total);\n\t\t\t$this->session->set_flashdata('message', $row->amount);\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t\t// if ($row->grand_total - $row->plan_total < $params->amount)\n\t}", "public function fee(Wallet $wallet, int $amount): int\n {\n if ($wallet instanceof Taxing) {\n return (int)($amount * $wallet->getFeePercent() / 100);\n }\n\n return 0;\n }", "function wpap_get_total_woocommerce_order_fees($order)\n{\n $total_fee = 0;\n $order_fee_items = $order->get_fees();\n if(!is_array($order_fee_items)){\n return $total_fee;\n }\n \n foreach ( $order_fee_items as $fee_item ) {\n $total_fee += $fee_item['line_total'];\n }\n return $total_fee;\n}", "public function reminder_payment_check()\n {\n $this->load->model('ReportModel', 'report');\n $this->load->model('AccountPayablePaymentModel', 'accountPayablePayment');\n $this->load->model('StatusHistoryModel', 'statusHistory');\n $this->load->model('modules/Mailer', 'mailer');\n $this->load->model('modules/Exporter', 'exporter');\n\n $filters = [\n 'payment_statuses' => AccountPayablePaymentModel::STATUS_PENDING,\n 'payment_date_from' => date('Y-m-d', strtotime('+1 day')),\n 'payment_date_to' => date('Y-m-d', strtotime('+1 days'))\n ];\n $payments = $this->report->getPaymentControl($filters);\n $dataExport = $payments;\n\n if (!empty($payments)) {\n $emailTo = 'direktur@transcon-indonesia.com';\n\n $this->db->trans_start();\n\n foreach ($payments as &$payment) {\n if ($payment['payment_check'] == AccountPayablePaymentModel::STATUS_PENDING) {\n $this->accountPayablePayment->update([\n 'status_check' => AccountPayablePaymentModel::STATUS_ASK_APPROVAL\n ], $payment['id_account_payable_payment']);\n }\n\n $this->load->helper('string');\n $token = random_string('alnum', 32);\n\n $payment['token'] = $token;\n\n $this->statusHistory->create([\n 'type' => StatusHistoryModel::TYPE_SUBMISSION_PAYMENT,\n 'id_reference' => $payment['id_account_payable_payment'],\n 'status' => AccountPayablePaymentModel::STATUS_ASK_APPROVAL,\n 'description' => 'Auto reminder transfer',\n 'data' => json_encode([\n 'token' => $token,\n 'email' => $emailTo,\n 'creator' => 0\n ])\n ]);\n }\n\n $this->db->trans_complete();\n\n if ($this->db->trans_status()) {\n $emailTitle = \"Payment transfer request on \" . format_date($filters['payment_date_from'], 'd F Y') . ' (batch transactions)';\n $emailTemplate = 'emails/payment_request_batch';\n $emailData = [\n 'email' => $emailTo,\n 'date' => $filters['payment_date_from'],\n 'accountPayablePayments' => $payments,\n 'isReminder' => false\n ];\n $emailAttachment = $this->exporter->exportFromArray('Control Data', $dataExport, false);\n $emailOptions = [\n 'cc' => ['fin2@transcon-indonesia.com', 'acc_mgr@transcon-indonesia.com'],\n 'attachment' => $emailAttachment\n ];\n $send = $this->mailer->send($emailTo, $emailTitle, $emailTemplate, $emailData, $emailOptions);\n if (!$send) {\n log_message('error', $this->email->print_debugger(['headers']));\n }\n }\n }\n }", "function charge_v1_vtdirect_payment( $order_id )\n {\n global $woocommerce;\n $order_items = array();\n\n // Check token id\n if( $_POST['veritrans_token_id'] == '' ) {\n throw new Exception( __('Invalid Token ID', 'woocommerce') );\n }\n\n $endpoint_url = 'https://payments.veritrans.co.id/vtdirect/v1/charges';\n $server_key = $this->server_key;\n $server_key = base64_encode($server_key . ':');\n $token_id = $_POST['veritrans_token_id'];\n\n $order = new WC_Order( $order_id );\n \n $shipping_address = array();\n $billing_address = array();\n\n // Order Items\n if( sizeof( $order->get_items() ) > 0 ) {\n foreach( $order->get_items() as $item ) {\n $order_items[] = array(\n 'id' => $item['product_id'],\n 'name' => substr($item['name'], 0, 20),\n 'qty' => $item['qty'] / 1,\n 'price' => ceil( $order->get_item_subtotal( $item, false ) )\n );\n }\n }\n\n // Shipping Fee\n if( $order->get_total_shipping() > 0 ) {\n $order_items[] = array(\n 'id' => 'shippingfee',\n 'name' => 'Shipping Fee',\n 'qty' => 1,\n 'price' => ceil( $order->get_total_shipping() )\n );\n }\n\n // Tax\n if( $order->get_total_tax() > 0 ) {\n $order_items[] = array(\n 'id' => 'taxfee',\n 'name' => 'Tax',\n 'qty' => 1,\n 'price' => ceil($order->get_total_tax())\n );\n }\n\n // Fees\n if ( sizeof( $order->get_fees() ) > 0 ) {\n $fee_counter = 0;\n foreach ( $order->get_fees() as $item ) {\n $fee_counter++;\n $order_items[] = array(\n 'id' => 'feeitem' . $fee_counter,\n 'name' => 'Fee Item ' . $fee_counter,\n 'qty' => 1,\n 'price' => ceil( $item['line_total'] )\n );\n }\n }\n\n // Shipping Address\n $shipping_address['first_name'] = $order->shipping_first_name;\n $shipping_address['last_name'] = $order->shipping_last_name;\n $shipping_address['address1'] = $order->shipping_address_1;\n $shipping_address['address2'] = $order->shipping_address_2;\n $shipping_address['city'] = $order->shipping_city;\n $shipping_address['postal_code'] = $order->shipping_postcode;\n $shipping_address['phone'] = $order->billing_phone;\n\n // Billing Address\n $billing_address['first_name'] = $order->billing_first_name;\n $billing_address['last_name'] = $order->billing_last_name;\n $billing_address['address1'] = $order->billing_address_1;\n $billing_address['address2'] = $order->billing_address_2;\n $billing_address['city'] = $order->billing_city;\n $billing_address['postal_code'] = $order->billing_postcode;\n $billing_address['phone'] = $order->billing_phone;\n\n // Body that will be send to Veritrans\n $body = array(\n 'token_id' => $token_id,\n 'order_id' => $order_id,\n 'order_items' => $order_items,\n 'gross_amount' => ceil( $order->order_total ),\n 'email' => $order->billing_email,\n 'shipping_address' => $shipping_address,\n 'billing_address' => $billing_address\n );\n\n $headers = array( \n 'Authorization' => 'Basic ' . $server_key,\n 'content-type' => 'application/json'\n ); \n\n $response = wp_remote_post( $endpoint_url, array(\n 'body' => json_encode($body),\n 'headers' => $headers,\n 'timeout' => 20,\n 'sslverify' => false\n ) );\n\n // If wp_remote_post failed\n if( is_wp_error( $response ) ) {\n throw new Exception( $response->get_error_message() );\n }\n\n $response_body = $response['body'];\n $response_body = json_decode( $response_body );\n\n // If response from Veritrans is failure\n if( $response_body->code != 'VD00' ) {\n throw new Exception( $response_body->message );\n }\n \n // Set order as complete\n $order->payment_complete();\n\n // Remove cart\n $woocommerce->cart->empty_cart();\n }", "function fn_multisafepay_set_fastcheckout($payment_id, $order_id = 0, $order_info = array(), $cart = array())\n{\n $auth['user_id'] = '0';\n $auth['tax_exempt'] = '0';\n $cart['payment_id'] = $payment_id;\n\n\n $result = fn_place_order($cart, $auth, $action = '', $issuer_id = null, $parent_order_id = 0);\n\n\n $processor_data = fn_get_payment_method_data($payment_id);\n $taxes = array();\n $order_info = $cart;\n $ip = fn_get_ip();\n\n $itemlist = $order_info[\"products\"];\n if (is_array($itemlist)) {\n $cart_items = \"<ul>\\n\";\n foreach ($itemlist as $product) {\n $cart_items .= \"<li>\" . $product['amount'] . \" x : \" . $product['product'] . \" : \" . $product['price'] . \"</li>\\n\";\n }\n $cart_items .= \"</ul>\\n\";\n }\n\n if ($processor_data['processor_params']['mode'] == 'T') {\n $test = true;\n } else {\n $test = false;\n }\n\n\n $orderid = $result[0];\n\n\n $msp = new MultiSafepay();\n $msp->test = $test;\n $msp->merchant['account_id'] = $processor_data['processor_params']['account'];\n $msp->merchant['site_id'] = $processor_data['processor_params']['site_id'];\n $msp->merchant['site_code'] = $processor_data['processor_params']['securitycode'];\n if ($order_id == 0) {\n $msp->transaction['id'] = $orderid;\n } else {\n $msp->transaction['id'] = $order_id;\n }\n $msp->merchant['notification_url'] = fn_payment_url('current', \"multisafepay_fastcheckout.php?mode=fastcheckout_notify&payment_id=$payment_id\");\n $msp->merchant['cancel_url'] = fn_url(\"checkout.cart\", 'C', 'current');\n $msp->merchant['redirect_url'] = fn_payment_url('current', \"multisafepay_fastcheckout.php?mode=fastcheckout_return&payment_id=$payment_id\");\n $msp->merchant['close_window'] = true;\n $msp->customer['locale'] = CART_LANGUAGE . '_' . strtoupper(CART_LANGUAGE);\n $msp->customer['ipaddress'] = $ip['host'];\n $msp->customer['forwardedip'] = $ip['proxy'];\n\n $msp->transaction['currency'] = (isset($order_info['secondary_currency']) ? $order_info['secondary_currency'] : $processor_data['processor_params']['currency']);\n $msp->transaction['amount'] = $order_info['total'] * 100;\n $msp->transaction['description'] = 'Order #' . $msp->transaction['id'];\n $msp->transaction['items'] = $cart_items;\n $msp->plugin_name = 'CS-Cart 4.x';\n $msp->version = '1.6.2';\n $msp->plugin['shop'] = 'CS-Cart';\n $msp->plugin['shop_version'] = PRODUCT_VERSION;\n $msp->plugin['plugin_version'] = '1.6.1';\n $msp->plugin['partner'] = '';\n $msp->plugin['shop_root_url'] = Registry::get('config.current_location');\n\n\n\n $items = $order_info['products'];\n\n //Add the products\n foreach ($items as $item) {\n $product_data = fn_get_product_data($item['product_id'], $_SESSION['auth'], CART_LANGUAGE, '', true, true, true, true, false, true, true);\n\n\n\n foreach ($product_data['tax_ids'] as $key => $value) {\n $taxid = $value;\n if (isset($order_info['taxes'][$value]['price_includes_tax'])) {\n $taxed = $order_info['taxes'][$value]['price_includes_tax'];\n } else {\n $taxed = 'N';\n }\n }\n\n if ($taxed == 'N') {\n $product_price = $item['price'];\n } else {\n $btw = $item['price'] / (100 + $order_info['taxes'][$taxid]['rate_value']) * $order_info['taxes'][$taxid]['rate_value'];\n $product_price = $item['price'] - $btw;\n }\n\n $cart_item_msp = new MspItem($item['product'], '', $item['amount'], $product_price, 'KG', 0);\n $msp->cart->AddItem($cart_item_msp);\n $cart_item_msp->SetMerchantItemId($item['product_code']);\n //$cart_item_msp->SetTaxTableSelector('P_'.$item['item_id']);\n $cart_item_msp->SetTaxTableSelector($taxid);\n }\n\n\n //add shipping line item\n $result = fn_get_shippings(true);\n\n print_r(fn_get_destinations());\n exit;\n\n\n foreach ($order_info['shipping'] as $key => $shipper) {\n if ($shipper['shipping_id'] == $_SESSION['cart']['chosen_shipping'][0]) {\n if ($shipper['rate'] != 0) {\n foreach ($order_info['taxes'] as $key => $value) {\n if ($value['applies']['S'] != '0')\n $shiptaxselector = $key;\n }\n\n $taxed = $order_info['taxes'][$shiptaxselector]['price_includes_tax'];\n\n if ($taxed == 'N') {\n $shiping_price = $shipper['rate'];\n } elseif ($shiptaxselector) {\n $btw = $shipper['rate'] / (100 + $order_info['taxes'][$shiptaxselector]['rate_value']) * $order_info['taxes'][$shiptaxselector]['rate_value'];\n $shiping_price = $shipper['rate'] - $btw;\n } else {\n $shiping_price = $shipper['rate'];\n }\n\n $c_item = new MspItem($shipper['shipping'], 'Verzending', 1, $shiping_price, 'KG', 0);\n $c_item->SetMerchantItemId($key);\n //$c_item->SetTaxTableSelector('S_'.$key.'_0');\n\n if ($shiptaxselector) {\n $c_item->SetTaxTableSelector($shiptaxselector);\n } else {\n $c_item->SetTaxTableSelector('BTW0');\n }\n\n $msp->cart->AddItem($c_item);\n }\n }\n }\n\n\n //add available tax rates\n $taxes = array();\n foreach ($order_info['taxes'] as $key => $tax) {\n if (!in_array($key, $taxes)) {\n $taxes[] = $key;\n $percentage = $tax['rate_value'] / 100;\n $taxname = $key;\n $taxtable = new MspAlternateTaxTable($taxname, 'true');\n $taxrule = new MspAlternateTaxRule($percentage);\n $taxtable->AddAlternateTaxRules($taxrule);\n $msp->cart->AddAlternateTaxTables($taxtable);\n }\n }\n\n //If there are coupons applied add coupon as a product with negative price\n if (isset($order_info['promotions'])) {\n foreach ($order_info['promotions'] as $key => $value) {\n if ($order_info['subtotal_discount'] != '0.00') {\n $discount_price = $order_info['subtotal_discount'];\n $coupon = new MspItem($value['name'], 'Discount Price', 1, ('-' . $discount_price));\n $coupon->SetTaxTableSelector('BTW0');\n $msp->cart->AddItem($coupon);\n }\n }\n }\n\n $percentage = '0.00';\n $taxname = 'BTW0';\n $taxtable = new MspAlternateTaxTable($taxname, 'true');\n $taxrule = new MspAlternateTaxRule($percentage);\n $taxtable->AddAlternateTaxRules($taxrule);\n $msp->cart->AddAlternateTaxTables($taxtable);\n\n\n foreach ($order_info['product_groups'] as $key => $group) {\n $shipping_methods = $group['shippings'];\n\n foreach ($shipping_methods as $method => $values) {\n $shipping = new MspFlatRateShipping($values['shipping'], $values['rate']);\n $msp->cart->AddShipping($shipping);\n }\n }\n\n\n $url = $msp->startCheckout();\n\n\n if ($msp->error) {\n echo \"MultiSafepay Error \" . $msp->error_code . \": \" . $msp->error;\n exit();\n }\n\n if (isset($url)) {\n return $url;\n } else {\n return $msp;\n }\n}", "public static function update_stripe_fee( $order = null, $amount = 0.0 ) {\n\t\tif ( is_null( $order ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();\n\n\t\tWC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, self::META_NAME_FEE, $amount ) : $order->update_meta_data( self::META_NAME_FEE, $amount );\n\t}", "public function testTransactionRequestRejectedByPayerFsp()\n {\n $precondition = Factory::instance(\n 'TransactionRequestRejectedByPayerFsp'\n );\n\n $testdata = $precondition->getData();\n\n $this->assertTrue($testdata['amount'] == 10.1);\n }", "public function payListingFee($userID, $prodID, $paymentType = BuckysShopProduct::LIST_FEE_PAYMENT_TYPE_BTC){\n\n $flag = false;\n\n if($paymentType == BuckysShopProduct::LIST_FEE_PAYMENT_TYPE_CREDIT){\n $transactionIns = new BuckysTransaction();\n $flag = $transactionIns->useCreditsInShop($userID, SHOP_PRODUCT_LISTING_FEE_IN_CREDIT);\n\n }else if($paymentType == BuckysShopProduct::LIST_FEE_PAYMENT_TYPE_BTC){\n\n $flag = BuckysBitcoin::sendBitcoin($userID, SHOP_TNB_LISTING_FEE_RECEIVER_BITCOIN_ADDRESS, SHOP_PRODUCT_LISTING_FEE_IN_BTC);\n buckys_get_messages(); // this will flash the messages\n\n if($flag){\n //Create bitcoin transaction\n BuckysBitcoinTransaction::addTransaction(BuckysBitcoinTransaction::TNB_BITCOIN_RECEIVER_ID, $userID, BuckysBitcoinTransaction::ACTIVITY_TYPE_LISTING_PRODUCT, $prodID, SHOP_PRODUCT_LISTING_FEE_IN_BTC);\n }\n\n }\n\n return $flag;\n }", "public function paystackCallbackURL(Request $request)\n {\n $reference = $request->get('reference');\n $paymentDetails = $this->paystackVerifyPayment($reference);\n if ($paymentDetails['status']===true) {\n $amount_paid= $paymentDetails['data']['amount'] / 100;\n\n try{\n\n DB::beginTransaction();\n //Create the record in the deposit table for the user\n $deposit = Deposit::create([\n 'amount'=> $amount_paid,\n 'user_id'=>auth()->id(),\n 'paystack_reference'=>$paymentDetails['data']['reference']\n ]);\n\n //Create the record on the transactions table with the Deposit Model\n $deposit->transactions()->create([\n 'user_id'=>auth()->id(),\n 'type'=>'+',\n 'amount'=>$amount_paid\n ]);\n\n //Check if the user already have a wallet, if yes update the balance column, if no, create a Wallet record for the user\n $user= auth()->user();\n $wallet= $user->wallet;\n $wallet==null ?\n $balance= $amount_paid : $balance= $wallet->balance + $amount_paid;\n Wallet::updateOrCreate(\n ['user_id' => auth()->user()->id],\n ['balance' =>$balance]\n );\n DB::commit();\n\n //Send Email to the user and queue it\n mail::to($user->email)->queue(new DepositWasSuccessful($deposit));\n return new DepositResource($deposit);\n\n }catch(\\Throwable $e){\n DB::rollBack();\n return response()->json([\n 'status'=>false,\n 'message'=> 'Ops, something went wrong, your balance will be updated very soon'.$e->getMessage()\n ], 400);\n\n }\n\n }else{\n\n return response()->json([\n 'status'=>false,\n 'message'=>'Fund deposit was not completed'\n ], 400);\n }\n\n\n }" ]
[ "0.66339225", "0.58234954", "0.5811076", "0.5711179", "0.56941795", "0.5664857", "0.5615015", "0.5576808", "0.55509794", "0.55477744", "0.54827857", "0.5460622", "0.5439523", "0.54153365", "0.53975487", "0.53732127", "0.53642917", "0.5359935", "0.5344628", "0.5317806", "0.5307833", "0.5301156", "0.5284812", "0.52767617", "0.5267569", "0.5257078", "0.5251111", "0.5250196", "0.52479655", "0.5245866", "0.52445567", "0.524152", "0.52396405", "0.519989", "0.51911783", "0.5173606", "0.5156564", "0.5145428", "0.5143617", "0.5141285", "0.5129296", "0.51282173", "0.5120652", "0.5119983", "0.5115298", "0.5104083", "0.5101781", "0.509751", "0.50972384", "0.5091133", "0.5091012", "0.5081354", "0.5081312", "0.50663507", "0.50648093", "0.50583786", "0.50520587", "0.5049336", "0.5046917", "0.5045905", "0.50357795", "0.5032616", "0.50317854", "0.5030268", "0.5023396", "0.5019", "0.501111", "0.5010917", "0.5008291", "0.50050676", "0.50018793", "0.4984197", "0.498345", "0.4981005", "0.49675637", "0.49634507", "0.4963448", "0.4961354", "0.4960574", "0.49597734", "0.49566504", "0.49565744", "0.49556643", "0.49539977", "0.4951082", "0.49503598", "0.49469855", "0.4946849", "0.49457842", "0.49451408", "0.49431017", "0.4940466", "0.49329934", "0.49307302", "0.49299908", "0.49214965", "0.49106607", "0.49049497", "0.49045634", "0.4903694" ]
0.5022292
65
estimates the fee for sending confirmed and unconfirmed funds from the given payment address confirmed funds are sent first if they are available
public function cleanupUTXOs($payment_address_uuid, $utxos_to_consolidate, $priority=null) { $body = [ 'max_utxos' => $utxos_to_consolidate, ]; if ($priority !== null) { $body['priority'] = $priority; } $result = $this->newAPIRequest('POST', '/cleanup/'.$payment_address_uuid, $body); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function calculate_fee() {\n // Only delivery incurs a fee\n if ($this->type == 'delivery') {\n if ($this->distance > $this->Seller->Delivery->free_distance) {\n if ($this->Seller->Delivery->pricing_rate == 'per-mile') {\n $fee = number_format($this->Seller->Delivery->fee * ($this->distance - $this->Seller->Delivery->free_distance), 0);\n } else {\n $fee = number_format($this->Seller->Delivery->fee, 0);\n }\n } \n }\n \n // For everything else, charge $0 (and check for non-chargeable values)\n $this->fee = ((isset($fee) && $fee >= 1) ? $fee : 0);\n\n $this->update([\n 'fee' => $this->fee\n ]);\n }", "protected function _addPaymentFeeLine()\n {\n if (Mage::helper('core')->isModuleEnabled('Afterpay_Afterpayfee'))\n {\n $paymentFee = (float) $this->_order->getAfterpayfeeAmount();\n \n if (!empty($paymentFee)) {\n $paymentFeeLine = array(\n 'articleDescription' => Mage::getStoreConfig('afterpay/afterpay_afterpayfee/afterpayfee_label', $this->_order->getStoreId()),\n 'articleId' => 'FEE',\n 'unitPrice' => round($paymentFee * 100, 0),\n 'vatCategory' => 1,\n 'quantity' => 1,\n );\n \n return $paymentFeeLine;\n }\n }\n \n // Check if Fooman Surcharge is used for service fee\n if (Mage::helper('core')->isModuleEnabled('Fooman_Surcharge'))\n {\n $paymentFee = $this->_order->getFoomanSurchargeAmount() + $this->_order->getFoomanSurchargeTaxAmount();\n \n if (!empty($paymentFee)) {\n $paymentFeeLine = array(\n 'articleDescription' => $this->_order->getFoomanSurchargeDescription(),\n 'articleId' => 'FEE',\n 'unitPrice' => round($paymentFee * 100, 0),\n 'vatCategory' => 1,\n 'quantity' => 1,\n );\n \n return $paymentFeeLine;\n }\n }\n \n // Check if Mageworx Multifees is used for service fee\n if (Mage::helper('core')->isModuleEnabled('MageWorx_MultiFees'))\n {\n $paymentFee = (float) ($this->_order->getMultifeesAmount());\n \n if (!empty($paymentFee)) {\n $paymentFeeLine = array(\n 'articleDescription' => 'Extra kosten',\n 'articleId' => 'FEE',\n 'unitPrice' => round($paymentFee * 100, 0),\n 'vatCategory' => 1,\n 'quantity' => 1,\n );\n \n return $paymentFeeLine;\n }\n }\n \n return false;\n }", "function edd_wallet_add_funds( $payment_id ) {\n\t$fees = edd_get_payment_fees( $payment_id );\n\n\tif( $fees && count( $fees ) == 1 ) {\n\t\tif( $fees[0]['id'] == 'edd-wallet-deposit' ) {\n\n\t\t\t// Disable purchase receipts... we send our own emails\n\t\t\tremove_action( 'edd_complete_purchase', 'edd_trigger_purchase_receipt', 999 );\n\n\t\t\t// Send our custom emails\n\t\t\tedd_wallet_send_email( 'user', $payment_id );\n\n\t\t\t// Get the ID of the purchaser\n\t\t\t$user_id = edd_get_payment_user_id( $payment_id );\n\n\t\t\t// Deposit the funds\n\t\t\tedd_wallet()->wallet->deposit( $user_id, $fees[0]['amount'], 'deposit', $payment_id );\n\n\t\t\t// Tag the payment so we can find it later\n\t\t\tedd_update_payment_meta( $payment_id, '_edd_wallet_deposit', $user_id );\n\t\t}\n\t}\n}", "function dsf_send_sagepay_mail($savedorder, $address_confirmations=''){\nglobal $basket, $customer_id, $payment, $currencies;\n\n\t\t\t\t\t$good_mail_id = '3';\n\t\t\t\t\t$bad_mail_id = '6';\n\n\n\t\t\t\t\tif ($address_confirmations == 'OK'){ // status OK and addresses OK\n\t\t\t\t\t\t\n\t\t\t\t\t\t$email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $good_mail_id .\"'\");\n\t\t\t\t\t }elseif (MODULE_PAYMENT_PROTXCC_CHECK_ADDRESS == 'false'){\n\t\t\t\t\t\t$email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $good_mail_id .\"'\");\n\t\t\t\t\t}elseif ($address_confirmations == 'ALLOW'){ // status OK Adress failed under threshold.\n\t\t\t\t\t\t$email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $good_mail_id .\"'\");\n\t\t\t\t\t }else{\n\t\t\t\t\t $email_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='\" . $bad_mail_id .\"'\");\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\n// lets start with the email confirmation\n\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t$email_details = dsf_db_fetch_array($email_query);\n\t\t\t\t\t\t\t\t\t\t$signature_query = dsf_db_query(\"select subject, details from \". DS_DB_SHOP . \".email_templates where id ='1'\");\n\t\t\t\t\t\t\t\t\t $signature_details = dsf_db_fetch_array($signature_query);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_subject = $email_details['subject'];\n\t\t\t\t\t\t\t\t\t $email_footer = $signature_details['details'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// overwrite subject as per Christian emails 2011-09-28\n\t\t\t\t\t\t\t\t\t $email_subject = TRANSLATION_EMAIL_YOUR_ORDER . ' ' . SAP_ORDER_PREFIX . $savedorder->info['id'];\n\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// plain text;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order = TRANSLATION_WORD_DEAR . ' ' . $savedorder->customer['name'] . \"\\n\\n\" . $email_details['details'] . \"\\n\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t// get products ordered by doing email function.\n\t\t\t\t\t\t\t\t\t $products_ordered = dsf_order_email_items($savedorder, 'true');\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order .= $products_ordered['plain'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order .= \"\\n\" .EMAIL_SEPARATOR .\"\\n\" . $email_footer;\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \t\t// html\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $html_order = TRANSLATION_WORD_DEAR . ' ' . $savedorder->customer['name'] . \"<br /><br />\";\n\t\t\t\t\t\t\t\t\t $html_order .= $email_details['details'] . \"<br /><br />\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t $html_order .= $products_ordered['html'] . '<br /><br />';\n\t\t\t\t\t\t\t\t\t $html_order .= $email_footer;\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t $email_order = str_replace(\"[ORDER_NUMBER]\" , SAP_ORDER_PREFIX . $savedorder->info['id'], $email_order);\n\t\t\t\t\t\t\t\t\t $html_order = str_replace(\"[ORDER_NUMBER]\" , SAP_ORDER_PREFIX . $savedorder->info['id'], $html_order);\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t // end of email.\n\t\t\t\t\t\t \n\n\n \n\t\t\t\t\t dsf_send_email($savedorder->customer['name'], $savedorder->customer['email_address'], $email_subject, $email_order, STORE_OWNER, EMAIL_FROM,$html_order);\n\t\t\t\t\t\n\t\t\t\t\t// send emails to other people\n\t\t\t\t\t if (SEND_EXTRA_ORDER_EMAILS_TO != '') {\n\t\t\t\t\t\tdsf_send_email(STORE_OWNER, SEND_EXTRA_ORDER_EMAILS_TO, $email_subject, $email_order, STORE_OWNER, EMAIL_FROM,$html_order);\n\t\t\t\t\t }\n\n\n\t\t\t\t\t// send emails to other people\n\t\t\t\t\t if (SEND_EXTRA_ORDER_EMAILS_DUPLICATE != '') {\n\t\t\t\t\t\tdsf_send_email(STORE_OWNER, SEND_EXTRA_ORDER_EMAILS_DUPLICATE, $email_subject, $email_order, STORE_OWNER, EMAIL_FROM,$html_order);\n\t\t\t\t\t }\n\n\n\n\n\n// just for consistancy.\n\nreturn true;\n\n\n\n\n}", "function compute_withdrawing_fee($amount)\n{\n $fee = 0;\n if (!is_null($amount) && $amount > 0)\n {\n if ($amount < 20000)\n {\n $fee = 1;\n }\n else if ($amount < 50000)\n {\n $fee = 3;\n }\n else\n {\n $fee = 5;\n }\n }\n return $fee;\n}", "public function askForFeeConfirmation()\n {\n }", "function tranferFounds($project_id, $returnTotal=false, $adaptivepayments_pay = true) {\n\n App::import('Vendor', 'paypal');\n $this->Paypal = new Paypal();\n\n\n $this->recursive = -1;\n $sponsorships = $this->find('all', array('conditions' => array('Sponsorship.project_id' => $project_id)));\n\n $tranferredSponsorships = array();\n $total = 0;\n foreach ($sponsorships as $sponsorship) {\n $sponsorship_id = $sponsorship[$this->alias]['id'];\n if ($this->getPaymentType($sponsorship) == EXPRESSCHECKOUT) { // all of these payments are already on our paypal account, no tenemos que hacer nada.\n if ($this->isTransferred($sponsorship, EXPRESSCHECKOUT)) { // se marco como trasferido ? \n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } else {\n $transactionId = $sponsorship[$this->alias]['expresscheckout_transaction_id'];\n if (!empty($transactionId)) {\n $response = $this->Paypal->hashCall('GetTransactionDetails', array('TRANSACTIONID' => $transactionId));\n if ($this->updateExpressCheckoutStatus($sponsorship_id, $transactionId)) {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n }\n }\n }\n } elseif ($this->getPaymentType($sponsorship) == PREAPPROVAL) {\n if ($this->isTransferred($sponsorship, PREAPPROVAL)) { // se marco como trasferido ? \n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } else {\n $preapproval_key = $sponsorship[$this->alias]['preapproval_key'];\n if ($this->updatePreApprovalStatus($sponsorship_id, $preapproval_key)) { // actualizamos el pago | si esta activo ....\n $transferred = true;\n $sponsorship = $this->read(null, $sponsorship_id);\n if (!$this->isTransferred($sponsorship, PREAPPROVAL)) {\n // transferimos el pago a groofi $transferred = true ;\n if ($adaptivepayments_pay == true && $this->adaptivepayments_pay($sponsorship)) { //\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } elseif ($adaptivepayments_pay == false) {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n }\n } else {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n $sponsorship[$this->alias]['internal_status'] = SPONSORSHIP_TRANSFERRED;\n $sponsorship[$this->alias]['transferred'] = 1;\n $this->save($sponsorship);\n }\n }\n }\n }\n }\n return $returnTotal ? $total : $tranferredSponsorships;\n }", "function get_transaction_fee($amount)\n\t{\n\t\treturn round(0.25+0.034*$amount,2);\n\t}", "function deliveryFee($rID, $subtotal, $tip, $date_time, $addr) {\n $_errors = array();\n \n if (!preg_match('/^\\d+/$', $rID)) {\n $_errors[] = \"Restaurant DeliveryFee - Validation - Restaurant ID (invalid, must be integer) (\" . $rID . \")\";\n }\n \n if(!preg_match('/^\\d*(\\.\\d{2})?$/', $subtotal) && $subtotal != '') {\n $_errors[] = \"Restaurant DeliveryFee - Validation - Subtotal (invalid, must be numeric) (\" . $subtotal . \")\";\n }\n \n if(empty($tip)) {\n $tip = 0;\n }\n elseif(!preg_match('/^\\d*\\.\\d{2}$/', $tip) && $tip != '') {\n $_errors[] = \"Restaurant DeliveryFee - Validation - Tip (invalid, must be numeric) (\" . $tip . \")\";\n }\n \n try {\n $addr->validate();\n } catch (OrdrinExceptionBadValue $ex) {\n $_errors[] = $ex.__toString();\n }\n \n if(!empty($_errors)) {\n throw new OrdrinExceptionBadValue($_errors);\n }\n \n $dt = $this->format_datetime($date_time);\n\n return $this->_call_api(\"GET\",\n array(\n \"fee\",\n $rID,\n $subtotal,\n $tip,\n $dt,\n $addr->zip,\n $addr->city,\n $addr->street\n )\n );\n }", "public static function confirmPayment() {\n $url = self::$username.':'.self::$password.'@'.self::$address.':'.self::$port.'/';\n self::$rpcClient = new jsonRPCClient($url, self::$debug);\n \n self::$emercoin_info = self::$rpcClient->getinfo();\n \n if(!is_callable(self::$get_order_id)) {\n throw new Exception('Property self::$get_order_id must be callable');\n }\n $account = self::$account_prefix.'_'.call_user_func(self::$get_order_id);\n \n if(!is_callable(self::$get_order_ammount)) {\n throw new Exception('Property self::$get_order_ammount must be callable');\n }\n $order_ammount = call_user_func(self::$get_order_ammount);\n \n \n\t\ttry {\n $received_amount = self::$rpcClient->getreceivedbyaccount($account,0);\n\t\t} catch (Exception $e) {\n\t\t\techo false;\n\t\t}\n \n\t\t//if((float)$received_amount >= (float)$order_ammount) {\n \n //Comparing two floats with epsilon (http://php.net/manual/en/language.types.float.php)\n $epsilon = 0.0000001; // 1 Satoshi\n if((float)$order_ammount - (float)$received_amount < $epsilon) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n }", "public function getMyFeesEstimate($request);", "public function assess_late_fees() {\n // Setup finance_charge record.\n $late_charge = ORM::factory('finance_charge');\n $data = array(\n 'title' => sprintf('Late Fee: %s', $this->title),\n 'due' => date::to_db(),\n 'site_id' => $this->site_id,\n 'user_id' => $this->user_id,\n 'amount' => $this->late_fee_type == 'percent' ? number_format($this->amount * $this->late_fee / 100, 2) : $this->late_fee, // Fix to use percentage as well.\n 'budget_id' => $this->budget_id,\n 'deposit_account_id' => $this->deposit_account_id\n );\n $late_charge->validate($data, TRUE);\n \n // Assess charge to the individual members.\n foreach ($this->finance_charge_members as $member_charge) {\n $charge = ORM::factory('finance_charge_member');\n $data = array(\n 'finance_charge_id' => $late_charge->id,\n 'site_id' => $this->site_id,\n 'user_id' => $member_charge->user_id,\n 'amount' => $this->late_fee_type == 'percent' ? number_format($member_charge->balance() * $this->late_fee / 100, 2) : $this->late_fee, \n );\n $charge->validate($data, TRUE);\n }\n \n // Send out emails to all members who have received the late fee.\n $late_charge->notify_members();\n \n // Update late_fee_assessed record so we don't assess this late fee again.\n $this->late_fee_assessed = TRUE;\n $this->save();\n }", "public function test_get_sbps_purchase_fee_and_payment_request($carriers, $codes, $from, $to)\n {\n /** @var \\CI_DB_result $query */\n $sql = sprintf(<<<EOF\nSELECT order_detail.id\nFROM order_detail JOIN\n order_settlement ON order_detail.id = order_settlement.order_detail_id JOIN\n contract_order ON contract_order.id = order_detail.contract_order_id JOIN\n contract ON contract.id = contract_order.contract_id\nWHERE contract.`disable` = %3\\$d AND\n contract_order.`disable` = %3\\$d AND\n order_detail.`disable` = %3\\$d AND\n order_settlement.`disable` = %3\\$d AND\n contract.contract_status_id <> %5\\$d AND\n contract_order.order_type_code %1\\$s AND\n order_settlement.settlement_type_id %2\\$s AND\n order_detail.authorize_status = %4\\$d\nEOF\n , $this->transformInEqual($codes)\n , $this->transformInEqual($carriers)\n , self::STATUS_ENABLE\n , Sbps::AUTHORIZE_STATUS_BEFORE_CHECK_CREDIT_LIMIT\n , $this->getContractStatus());\n\n $sql .= $this->transformDate('order_settlement.settlement_plan_date', ['from' => $from, 'to' => $to]);\n $query = $this->CI->db->query($sql);\n $collection = $query->row_array();\n $query->free_result();\n\n /** @var array $actual */\n $query = $this->CI->contract->get_sbps_purchase_fee_and_payment_request($carriers, $codes, $from, $to);\n $actual = $query->row_array();\n $query->free_result();\n\n $this->assertInstanceOf('CI_DB_result', $query);\n $this->assertEquals($collection, $actual);\n }", "function pay_on_credit_apply_interest_fee() {\n\n $payment_method = WC()->session->get('chosen_payment_method');\n $payment_duration = WC()->session->get('chosen_payment_duration');\n \n \n\n if ( $payment_method === \"wcpg-pay-on-credit\" ) {\n $label = __( 'Interest Fee', 'wcpg-pay-on-credit' );\n $amount = 0;\n\n switch ($payment_duration) {\n case '4':\n $percentage = 0.05;\n $amount = ( WC()->cart->cart_contents_total + WC()->cart->shipping_total ) * $percentage;\n break;\n\n case '6':\n $percentage = 0.1;\n $amount = ( WC()->cart->cart_contents_total + WC()->cart->shipping_total ) * $percentage;\n break; \n \n default:\n # code...\n break;\n }\n\n WC()->cart->add_fee( $label, $amount, false, '' );\n }\n \n \n}", "private function _calculatePaymentFee(): int\n {\n $paymentFee = 0;\n if ($this->paymentMethod === 'paypal' && $_COOKIE['currency'] == 'EUR') {\n $paymentFee = 45;\n }\n\n return $paymentFee;\n }", "public static function chargeFees($price=1)\n {\n\n }", "function submitCreditFee($user_id, $type, $comments, $total, $date = null) {\n global $BoL_enabled;\n\tif (is_null($date)) $date = time();\n\tif (!is_numeric($user_id)) die('submitCreditFee: Non-Numeric User-ID');\n\tif ($type != 'c' && $type != 'f') die('submitCreditFee: Invalid Type, For Orders use submitOrder');\n\tif (!is_numeric($total)) die('submitCreditFee: Non-Numeric Amount');\n\tif (!is_numeric($date)) die('submitCreditFee: Invalid Date Format, Use UNIX Epoch');\n\t$values = array();\n\t$values['ordered'] = date('Y-m-d G:i:s',$date);\n\t$values['user'] = $user_id;\n\t$values['type'] = $type;\n\t$sql = \"SELECT snapshot FROM users WHERE ID = '\".$user_id.\"'\";\n\t$query = mysql_query($sql);\n\tcheckDBError($sql);\n\tif($result = mysql_fetch_assoc($query)) {\n\t\t$values['snapshot_user'] = $result['snapshot'];\n\t}\n if ($type==\"c\" && $total>=0)\n $total = $total-$total-$total; // make negative\n if ($type==\"f\")\n $total = abs($total);\n\t$values['total'] = $total;\n\t$values['comments'] = $comments;\n\t$values['processed'] = 'Y';\n\t$values['process_time'] = date('Y-m-d G:i:s');\n\t$sql = buildInsertQuery(\"order_forms\", $values, true);\n\tmysql_query($sql);\n\tcheckDBError($sql);\n\t$po_id = mysql_insert_id();\n\t$po = $po_id + 1000;\n\tif ($values['type'] == 'f') { // If it's a fee\n\t\t$sql = \"SELECT email, email2, email3 FROM users WHERE ID=\".$user_id;\n\t\t$query = mysql_query($sql);\n\t\tcheckDBError($sql);\n\t\tif ($result = mysql_fetch_array($query)) {\n\t\t\t$email = $result[0];\n\t\t\t$email2 = $result[1];\n\t\t\t$email3 = $result[2];\n\t\t} else {\n\t\t\tunset($email);\n\t\t\tunset($email2);\n\t\t\tunset($email3);\n\t\t}\n\t\t$msg =\n\t\t\"This is a bill; please retain for your records.\\n\\n\".\n\n\t\t\"Do not reply to this e-mail, contact your Dealer Support Person for any issues associated with this Bill.\\n\\n\".\n\n\t\t\"-----------------------------------------------------------\\n\";\n\n\t\t$body = OrderForEmail($po,'D');\n\t\t$msg .= $body;\n\n\t\t$subject = date( \"m/d/Y\", $date).\" Bill\";\n\t\t$headers = \"From: RSS Orders <orders@retailservicesystems.com>\";\n\t\tif ($email2 <> \"\") $headers .= \"\\nCc: \".$email2;\n\t\tif ($email3 <> \"\") $headers .= \"\\nCc: \".$email3;\n\t\t$headers .= \"\\nBcc: orders@retailservicesystems.com\";\n\t\tsendmail($email, $subject, $msg, $headers);\n\t}\n\treturn $po;\n}", "public function finance(int $value, int $paymentsRemaining, $paymentValue): float;", "public function estimateTransactionFee(int $inputs, int $outputs, $amount = 0, int $minConf = null);", "protected function calcStateFee(float $debt = 0)\n {\n $stateFee = $debt / 100 * 13;\n $stateFee = number_format($stateFee,2,'.','');\n return $stateFee;\n }", "public function testSendWithRequestAddressBalance()\n {\n $service = $this->getStubForTest(file_get_contents(__DIR__ . '/TestAsset/Response/address_balance.txt'));\n\n $request = new Request\\AddressBalance();\n $request->setAddress('efjsdkfjkwefkwejfkesf');\n\n /* @var $response Response\\AddressBalance */\n $response = $service->send($request);\n\n $this->assertEquals(0, $response->getBalance());\n\n $this->assertEquals(\n $this->getLastRawRequestExpected(__DIR__ . '/TestAsset/Request/address_balance.txt'),\n $this->getLastRawRequest($service),\n 'Requests does not match'\n );\n }", "public static function getConfirmedReceivedByAddress($address)\n\t{\n\t\t$amount = file_get_contents(\"https://blockchain.info/q/getreceivedbyaddress/$address?confirmations=\" . getenv(\"REQUIRED_CONFIRMATIONS\"));\n\n\t\treturn $amount;\n\t}", "public function sendWithFeeRate($payment_address_id, $destination, $quantity, $asset, $fee_rate='medium', $request_id=null) {\n return $this->sendFromAccount($payment_address_id, $destination, $quantity, $asset, 'default', $_unconfirmed=true, $_fee=null, $_dust_size=null, $request_id, $_custom_inputs=null, $fee_rate);\n }", "function calculateReferralFee($user_id,$order_details,$transaction_id)\n\t\t{\n\t\t\t//get user details\n\t\t\t$user_details = $this->_BLL_obj->manage_content->getValue_where('user_info','*', 'user_id', $user_id);\n\t\t\tif($user_details[0]['member_level'] != 0)\n\t\t\t{\n\t\t\t\t//getting user rf\n\t\t\t\t$user_level = $this->_BLL_obj->manage_content->getValue_where('member_level_info','*', 'member_level', $user_details[0]['member_level']);\n\t\t\t\tif(!empty($user_level[0]['RF']))\n\t\t\t\t{\n\t\t\t\t\t$ref_fee = ((intval($user_level[0]['RF']) * $order_details[0]['amount']) / 100);\n\t\t\t\t\t//getting user money from money table\n\t\t\t\t\t$user_money = $this->_BLL_obj->manage_content->getLastValue('user_money_info', '*', 'user_id', $user_id, 'id');\n\t\t\t\t\tif(!empty($user_money[0]['total_money']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$user_total_money = $user_money[0]['total_money'] + $ref_fee;\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$user_total_money = $ref_fee;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//insert values to user money info table\n\t\t\t\t\t$column_name_money = array('user_id','specification','earn_money','total_money');\n\t\t\t\t\t$column_value_money = array($user_id,$transaction_id,$ref_fee,$user_total_money);\n\t\t\t\t\t$insert_money = $this->_BLL_obj->manage_content->insertValue('user_money_info', $column_name_money, $column_value_money);\n\t\t\t\t\t//insert values to user profile info\n\t\t\t\t\t$this->_BLL_obj->increaseGrossAmount($user_id, $ref_fee);\n\t\t\t\t\t\n\t\t\t\t\treturn $ref_fee;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn 0;\t\n\t\t\t}\n\t\t}", "public function processShippingAmount($address, $total)\n {\n if ($this->amount->getBaseBalanceForShipping() <= 0) {\n return false;\n }\n\n $shippingAmount = $this->amount->getShippingPrice();\n $baseShippingAmount = $this->amount->getBaseShippingPrice();\n\n if ($baseShippingAmount <= 0) {\n return $this;\n }\n\n $discountAmount = min(\n $shippingAmount,\n $this->amount->getBalanceForShipping()\n );\n $baseDiscountAmount = min(\n $baseShippingAmount,\n $this->amount->getBaseBalanceForShipping()\n );\n\n $address->setGiftcardShippingAmount($discountAmount<0?$discountAmount:-$discountAmount); //negative\n $address->setBaseGiftcardShippingAmount($baseDiscountAmount<0?$baseDiscountAmount:-$baseDiscountAmount); //negative\n\n $total->setShippingGiftcardAmount($discountAmount<0?$discountAmount:-$discountAmount); //negative\n $total->setBaseShippingGiftcardAmount($baseDiscountAmount<0?$baseDiscountAmount:-$baseDiscountAmount); //negative\n\n return $this;\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 }", "function paid_sendEmail_customer($details) {\n\t\t\t\n\t\t\t$currencycode = $details->currCode;\n\t\t\t$currencysign = $details->currSymbol;\n\n\n\t\t\t\t$total_amount = $details->checkoutTotal;\n\t\t\t\t $abc = $details->Extra_data->normal_price - $total_amount;\n if($abc < 0){\n $save = '0';\n\n }else{\n $save = number_format($details->Extra_data->normal_price - $total_amount,0);\n\t\t\t\t\t}\n\n\t\t\t\t$id = $details->id;\n\t\t\t\t$itemid = $details->itemid;\n\t\t\t\t$custid = $details->bookingUser;\n\t\t\t\t$country = $details->userCountry;\n\t\t\t\t$name = $details->userFullName;\n\t\t\t\t$stars = $details->stars;\n\t\t\t\t$code = $details->code;\n\t\t\t\t$booking_adults = $details->Extra_data->adults;\n\t\t\t\t$child = $details->Extra_data->child;\n\t\t\t\t\n\t\t\t\t$phone = $details->userMobile;\n\t\t\t\t$paymethod = $details->paymethod;\n\t\t\t\t$invoiceid = $details->id;\n\t\t\t\t$refno = $details->code;\n\t\t\t\t$deposit = $details->subItem->price;\n\t\t\t\t$quantity = $details->subItem->quantity;\n\t\t\t\t$hotel_title = $details->subItem->title;\n\t\t\t\t$duedate = $details->expiry;\n\t\t\t\t$date = $details->date;\n\t\t\t\t$sendto = $details->accountEmail;\n\n\t\t\t\t$additionaNotes = $details->additionaNotes;\n\n\t\t\t\t$remaining = $details->remainingAmount;\n\t\t\t\t$HOTEL_NAME = $details->title;\n\t\t\t\t$location = $details->location;\n\t\t\t\t$room_name = $details->subItem->title;\n\t\t\t\t$booking_adults = $details->subItem->booking_adults;\n\t\t\t\t$room_price = $details->subItem->price;\n\t\t\t\t\n\t\t\t\t$checkin = $details->checkin;\n\t\t\t\t\n\t\t\t\t$checkout = $details->checkout;\n\t\t\t\t$couponRate = $details->couponRate;\n\t\t\t\t\n\t\t\t\t$date = date ( \"m/d/Y\" , strtotime ( \"-1 day\" , strtotime ( $details->checkin ) ) );\n\t\t\t\t$no_of_room = $details->subItem->quantity;\n\t\t\t\t$thumbnail = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$details->thumbnail);\n\t\t\t\t$hotel_id = $details->itemid;\n\n\t\t\t\t$guest_name = $details->Extra_data->guest_name;\n\t\t\t\t$guest_age = $details->Extra_data->guest_age;\n\t\t\t\t$chil = $details->Extra_data->child;\n\t\t\t\t$child_name = isset($details->Extra_data->child_name) ? $details->Extra_data->child_name : 0;\n\t\t\t\t$child_age = isset($details->Extra_data->child_age) ? $details->Extra_data->child_age : 0;\n\t\t\t\t\n\t\t\t\t$sitetitle = \"\";\n\n\t\t\t\t$invoicelink = \"\";\n\t\t\t\t\n\t\t\t\t$sendto = $details->accountEmail;\n\t\t\t\t\n\t\t\t\t $ptheme = pt_default_theme();\n\t\t\t\t\t$this->_config = config_item('theme');\n\t\t\t\t\t$uu = $this->_config['url'];\n\t\t\t\t$email_temp_img = $uu.$ptheme.'/email_temp_img/gb_email_temp_img/';\n\t\t\t\t/*$template = $this->shortcode_variables(\"bookingpaidcustomer\");\n\t\t\t\t$details = email_template_detail(\"bookingpaidcustomer\");*/\n\n\t\t\t\t $book_room = $no_of_room;\n \n $room_per_guest = $booking_adults / $book_room;\n \n for ($r_i=0; $r_i < $book_room ; $r_i++) {\n \t$cc = $r_i+1;\n \t$no_top_hotel .= '<li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px;\">\n <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;margin-left: -30px;\">ROOM '.$cc.'</p>\n </li>';\n\t for($g_d_a=0; $g_d_a < $room_per_guest; $g_d_a++){\n\n\t $jj = $g_d_a + $r_i;\n\t $dd = $guest_name[$jj];\n\t $age = $guest_age[$jj];\n\t \n\n\t \t$no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 100%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px; \">\n\t\t <h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$dd.'</h5>\n \t\t<h5 class=\"right\" style=\"float:right;font-size: 16px;color: #0c134f;margin-right: 5px;\">'.$age.' Years</h5>\n\t\t </li>';\n\t }\n }\n\n if($chil > 0){\n\t $no_top_hotel .= ' <li class=\"title\" style=\"float: left; width: 100%; list-style-type: none; margin-left:0px; \">\n \t\t\t\t <p style=\"font-size: 11px;color: #a5a6b4;padding-top: 15px;\">CHILD DETAILS</p>\n \t\t\t\t </li>';\n \t for($c_i=0;$c_i<$chil;$c_i++){\n \t \t $ii = $c_i;\n\t \t\t $child_name1 = $child_name[$ii];\n\t \t\t $child_age1= $child_age[$ii];\n \t \t\n \t \t $no_top_hotel .= '<li class=\"username\" style=\"list-style-type: none;width: 96%;float:left;border-bottom: 1px solid #e6e7ed; margin-left:0px;\">\n \t\t\t<h5 class=\"left\" style=\"font-size: 16px;color: #0c134f;float: left; margin-left: -30px;\">'.$child_name1.'</h5>\n \t\t<h5 class=\"right\" style=\"font-size: 16px;color: #0c134f;float: right;margin-right: 5px;\"><img src=\"'.$email_temp_img.'paynow_icon8.png\"> '.$child_age1.' Years</h5>\n \t\t\t</li>';\n \t}\n }\n\n \t$this->db->select('hotel_latitude,hotel_longitude,hotel_desc,hotel_map_city,hotel_stars');\n\t\t \t$this->db->where('hotel_id', $itemid);\n\t\t \t$query = $this->db->get('pt_hotels');\t\n\t\t \t$hotel_data = $query->result();\n\n\t\t \t$star_temp_img = $uu.$ptheme.'/images/';\n\n\t\t\t\t\t/*echo $hotel_data[0]->hotel_stars;*/\n\n\t\t\t\t\t$aaa = '';\n\t\t\t\t\tfor ($st_i=0; $st_i < 5 ; $st_i++) { \n \tif($st_i < $hotel_data[0]->hotel_stars){\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-on.png\">';\n \t}else{\n \t\t$aaa .= '<img src=\"'.$star_temp_img.'/star-off.png\">';\n \t}\n }\n\n\t\t \t$arrayInfo['checkIn'] = date(\"m/d/Y\", strtotime(\"+1 days\"));\n\t\t \t$arrayInfo['checkOut'] = date(\"m/d/Y\", strtotime(\"+2 days\"));\n\t\t \t$arrayInfo['adults'] = '1';\n\t\t \t$arrayInfo['child'] = '';\n\t\t \t$arrayInfo['room'] = '1';\n\t\t \t/*error_reporting(E_ALL);*/\n\t\t \t\t//$this->ci = & get_instance();\n\t\t\t\t\t\t// $this->db = $this->ci->db;\n\t\t\t\t\t$this->load->model('hotels/hotels_model');\n\t\t \t\n\t\t \t$local_hotels = $this->hotels_model->search_hotels_by_lat_lang($hotel_data[0]->hotel_latitude, $hotel_data[0]->hotel_longitude,$arrayInfo);\n\n\t\t \t$top_hotel = '<div class=\"col-sm-12 hotels\">';\n\n\t\t \tfor ($i=0; $i < count($local_hotels['hotels']) ; $i++) { \n\t\t \t\tif($i < 3){\n\t\t \t\t $image = str_replace(\"demo.tarzango.com/\",\"tarzango.com/\",$bb[$i]->thumbnail);\n\t\t \t\t$bb = $local_hotels['hotels'];\n\t\t \t\t $bb[$i]->title;\n\t\t \t\t$top_hotel .= '<a class=\"col-sm-4\" href=\"'.$bb[$i]->slug.'\" style=\"margin-left: 2%;padding:10px;text-decoration: none; width:27.3333%;float: left; box-sizing: border-box;position: relative;\">';\n\t\t \t\t\t\t\t\tif($image == \"\"){\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$uu.$ptheme.'/email_temp_img/gb_email_temp_img/email-d-lasvegas.png\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<img height=185px class=\"img-responsive\" src=\"'.$image.'\" style=\"width: 100%; min-height: 185px; height: 185px; max-height: 185px;\">';\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t$top_hotel .= '<p style=\"text-align:center;margin:0px;color: rgb(12, 19, 79);font-size: 14px;margin: 20px 0 10px;font-family: \\'Roboto\\',sans-serif;\">'.$this->custom_echo($bb[$i]->title, 25).'</p>\n\t\t\t\t\t\t\t\t\t\t\t<h4 style=\" text-align:center;margin:0px; color: rgb(28, 192, 251);font-size: 20px;font-weight: 600;font-family: \\'Roboto\\',sans-serif;\">'.$bb[$i]->currCode.$bb[$i]->price.'</h4>\n\t\t\t\t\t\t\t\t\t\t</a>';\n\t\t \t} \n\t\t }\n\n\t\t \t$map = '<div class=\"col-sm-12 map\" style=\"width: 100%;padding-left: 0;float: left; box-sizing: border-box;min-height: 1px; padding-right:0px; position: relative;\">\n\t\t\t\t\t\t\t\t <a href=\"http://maps.google.com/?daddr={hotel_name}\" target=\"_blank\"> \n <img style=\"width:100%\" border=\"0\" src=\"https://maps.googleapis.com/maps/api/staticmap?center='.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&zoom=14&size=620x260&markers=size:mid%7Ccolor:red%7C'.$hotel_data[0]->hotel_latitude.','.$hotel_data[0]->hotel_longitude.'&key=AIzaSyAH65sTGsDsP4mMpmbHC8zqRiM1Qh07iL8\" alt=\"Google map\"></a>\n\t\t\t\t\t\t\t</div>';\n\n\t\t\t\t$res = $this->settings_model->get_contact_page_details();\n\t\t\t\t$contact_phone = $res[0]->contact_phone;\n\t\t\t\t$contact_email = $res[0]->contact_email;\n\t\t\t\t$contact_address = $res[0]->contact_address;\n\n\t\t\t\t\n\n\t\t\t\t$template = array(\"{invoice_id}\", \"{hotel_name}\", \"{stars}\", \"{location}\", \"{code}\",\"{invoice_code}\", \"{deposit_amount}\", \"{total_amount}\", \"{customer_email}\", \"{customer_id}\", \"{country}\", \"{phone}\", \"{currency_code}\", \"{currency_sign}\", \"{invoice_link}\", \"{site_title}\", \"{remaining_amount}\", \"{fullname}\",\"{room_name}\",\"{date}\",\"{checkin}\",\"{checkout}\",\"{no_of_room}\",\"{thumbnail}\",\"{booking_adults}\",\"{room_price}\",\"{couponRate}\",\"{additionaNotes}\",\"{email_temp_img}\",\"{quantity}\",\"{hotel_title}\",\"{booking_adults}\",\"{child}\",\"{no_top_hotel}\",\"{top_hotel}\",\"{map}\",\"{aaa}\",\"{save}\");\n\t\t\t\t//$smsdetails = sms_template_detail(\"bookingpaidcustomer\");\n\t\t\t\t$values = array($invoiceid, $HOTEL_NAME, $stars, $location, $code, $refno, $deposit, $total_amount, $sendto, $custid, $country, $phone, $currencycode, $currencysign, $invoicelink, $sitetitle, $remaining , $name, $room_name, $date, $checkin, $checkout, $no_of_room, $thumbnail,$booking_adults,$room_price,$couponRate,$additionaNotes,$email_temp_img, $quantity,$hotel_title,$booking_adults,$child,$no_top_hotel,$top_hotel,$map,$aaa,$save);\n\n\t\t\t\t$HTML_DATA = file_get_contents( $uu.$ptheme.'/invoice.html');\n\t\t\t\t$message = str_replace($template, $values, $HTML_DATA);\n\n\t\t\t\t\n\t\t\t\t/*$message = $this->mailHeader;*/\n\t\t\t\t/*echo '<pre>'.json_encode($message).'</pre>';\n\t\t\t\texit();*/\n\t\t\t\t/*$details = $this->html_template_booking($hotel_id,$invoiceid);\n\t\t\t\t$message .= str_replace($template, $values, $details);*/\n\t\t\t\t//$message .= $this->mailFooter;\n\t\t\t\t/*echo $message;\n\t\t\t\texit;*/\n\t\t\t\t//$smsmessage = str_replace($template, $values, $smsdetails[0]->temp_body);\n\t\t\t\t//sendsms($smsmessage, $phone, \"bookingpaidcustomer\");\n\t\t\t\t$this->email->set_newline(\"\\r\\n\");\n\t\t\t\t$this->email->from($this->sendfrom);\n\t\t\t\t$this->email->to($sendto);\n\t\t\t\t$this->email->subject('Thanks for Booking at the '.$HOTEL_NAME);\n\t\t\t\t$this->email->message($message);\n\t\t\t\t$this->email->send();\n\t\t\t\t\n\t\t}", "public static function canApply($address)\n {\n // Put here your business logic to check if fee should be applied or not\n // Example of data retrieved :\n // $address->getShippingMethod(); > flatrate_flatrate\n // $address->getQuote()->getPayment()->getMethod(); > checkmo\n // $address->getCountryId(); > US\n // $address->getQuote()->getCouponCode(); > COUPONCODE\n return true;\n }", "function funding_failed($parameters) \n\t{\n\t\t$status = $parameters->verified;\n\n\t\t// Gather the total of all unpaired fees/scs, and adjust for it.\n\t\t$total = 0.0;\n\t\t\n\t\t$fund_date = strtotime($parameters->info->date_fund_stored);\n\t\t$balance = Fetch_Balance_Information($parameters->application_id);\n\t\t$total = $balance->total_balance;\n\t\t\n\t\t$db = ECash::getMasterDb();\n\t\t\n\t\ttry \n\t\t{\n\t\t\t$db->beginTransaction();\n\t\t\t// Remove the schedule immediately\n\t\t\tRemove_Unregistered_Events_From_Schedule($parameters->application_id);\n\t\n\t\t\tif ($total > 0.0) \n\t\t\t{\n\t\t\t\t$today = date(\"Y-m-d\");\n\t\t\t\t$amounts = array();\n\n\t\t\t\tif($balance->fee_pending > 0)\n\t\t\t\t{\n\t\t\t\t\t$amounts[] = Event_Amount::MakeEventAmount('fee', -$balance->fee_pending);\n\t\t\t\t}\n\n\t\t\t\tif($balance->service_charge_pending > 0)\n\t\t\t\t{\n\t\t\t\t\t$amounts[] = Event_Amount::MakeEventAmount('service_charge', -$balance->service_charge_pending);\n\t\t\t\t}\n\n\t\t\t\t$e = Schedule_Event::MakeEvent($today, $today, $amounts, 'adjustment_internal',\n\t\t\t\t\t\t\t\t\t'Adjusting out all accrued fees due to failure.');\n\n\t\t\t\tPost_Event($parameters->application_id, $e);\n\t\t\t}\n\t\t\t\n\t\t\t$db->commit();\n\t\t\t\n\t\t} \n\t\tcatch (Exception $e) \n\t\t{\n\t\t\t$this->Log(__METHOD__.\": Unable to update transactions.\");\n\t\t\t$db->rollBack();\n\t\t\tthrow $e;\n\t\t}\n\t\t\n\t\t// update status\n\t\t\n\t\ttry \n\t\t{\n\t\t\tUpdate_Status(null, $parameters->application_id, array('funding_failed','servicing','customer','*root'));\n\t\t} \n\t\tcatch (Exception $e) \n\t\t{\n\t\t\t$this->Log(__METHOD__.\": Unable to update status.\");\n\t\t\tthrow $e;\n\t\t}\n\t\t// Finally send the email - are we supposed to do this?\n\t}", "function compute_saving_fee($amount)\n{\n $fee = 0;\n if (!is_null($amount) && $amount > 0)\n {\n $fee = $amount * 0.5;\n if ($fee > 10000)\n {\n $fee = 10000;\n }\n else \n {\n $fee = ceil($fee);\n }\n $fee = $fee * 0.01;\n }\n return $fee;\n}", "public function markAsDomesticShipping(Order $draftOrder): bool;", "public function estimateTransactionSmartFeeRequest($blockchain, $network, $context = null, $confirmation_target = null, $estimate_mode = null)\n {\n // verify the required parameter 'blockchain' is set\n if ($blockchain === null || (is_array($blockchain) && count($blockchain) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $blockchain when calling estimateTransactionSmartFee'\n );\n }\n // verify the required parameter 'network' is set\n if ($network === null || (is_array($network) && count($network) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $network when calling estimateTransactionSmartFee'\n );\n }\n\n $resourcePath = '/blockchain-data/{blockchain}/{network}/estimate-transaction-smart-fee';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n // query params\n if ($context !== null) {\n if('form' === 'form' && is_array($context)) {\n foreach($context as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['context'] = $context;\n }\n }\n // query params\n if ($confirmation_target !== null) {\n if('form' === 'form' && is_array($confirmation_target)) {\n foreach($confirmation_target as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['confirmationTarget'] = $confirmation_target;\n }\n }\n // query params\n if ($estimate_mode !== null) {\n if('form' === 'form' && is_array($estimate_mode)) {\n foreach($estimate_mode as $key => $value) {\n $queryParams[$key] = $value;\n }\n }\n else {\n $queryParams['estimateMode'] = $estimate_mode;\n }\n }\n\n\n // path params\n if ($blockchain !== null) {\n $resourcePath = str_replace(\n '{' . 'blockchain' . '}',\n ObjectSerializer::toPathValue($blockchain),\n $resourcePath\n );\n }\n // path params\n if ($network !== null) {\n $resourcePath = str_replace(\n '{' . 'network' . '}',\n ObjectSerializer::toPathValue($network),\n $resourcePath\n );\n }\n\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['application/json']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['application/json'],\n []\n );\n }\n\n // for model (json/xml)\n if (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('x-api-key');\n if ($apiKey !== null) {\n $headers['x-api-key'] = $apiKey;\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function sendToAddress($bitcoinaddress, $amount, $comment = '', $commentTo = '');", "public function calcServiceFee(): float\n\t{\n\t\treturn $this->price * $this->rental_period->service_percent_fee + $this->rental_period->service_flat_fee;\n\t}", "public static function lockFunds($from, $amount, $fee=0){\n\t\t$fromuser = \\CouchDB::getDoc($from, \"users\");\n\t\t$frombalance = Dogecoin::getBalance($from);\n\t\tif ($frombalance['available'] < ($amount + $fee)){\n\t\t\t//they don't have the funds\n\t\t\treturn \\Shared\\Error::handleError(\"nofunds\");\n\t\t}else{\n\t\t\tif ($fee != 0){\n\t\t\t\t$response = Dogecoin::payMe($from, $fee);\n\t\t\t}\n\t\t\t$response = Dogecoin::move($from, \"LOCKED-FEE\", $amount);\n\t\t\t$fromuser->wallet->locked += $amount;\n\t\t\t$response = \\CouchDB::setDoc($fromuser, \"users\");\n\t\t\treturn $amount;\n\t\t}\n\t\t//something went wrong, but i have no idea what that might be.\n\t\treturn 0;\n\t}", "public function validatePayment()\n\t{\n\t\t$array_result = array();\n\t\t$array_result['verified'] = 0;\n\t\t$array_result['tot_paid'] = 0.0;\n\t\t$array_result['log'] = '';\n\t\t\n\t\t//cURL Method HTTP1.1 October 2013\n\t\t$raw_post_data \t= file_get_contents('php://input');\n\t\t$raw_post_array = explode('&', $raw_post_data);\n\t\t\n\t\t$myPost = array();\n\t\tforeach ($raw_post_array as $keyval)\n\t\t{\n\t\t\t$keyval = explode('=', $keyval);\n\t\t\tif (count($keyval) == 2)\n\t\t\t{\n\t\t\t\t$myPost[$keyval[0]] = urldecode($keyval[1]);\n\t\t\t}\n\t\t}\n\n\t\t// check if the form has been spoofed\n\t\t$against = array(\n\t\t\t'business' \t => $this->account,\n\t\t\t'mc_gross' \t => number_format($this->order_info['total_net_price'], 2, '.', ''),\n\t\t\t'mc_currency' => $this->order_info['transaction_currency'],\n\t\t\t'tax'\t\t => number_format($this->order_info['total_tax'], 2, '.', ''),\n\t\t);\n\n\t\t/**\n\t\t * If the account name contains the merchant code instead\n\t\t * of the e-mail related to the account, the spoofing check will fail\n\t\t * as the merchant code is always converted into the account e-mail.\n\t\t *\n\t\t * For example, if we specify 835383648, PayPal will return the related\n\t\t * account: dev@e4j.com\n\t\t * Then, 2 different values will be compared:\n\t\t * \"835383648\" ($this->account) againt \"dev@e4j.com\" ($myPost['business'])\n\t\t */\n\n\t\t// inject the original values within the payment data\n\t\tforeach ($against as $k => $v)\n\t\t{\n\t\t\tif (isset($myPost[$k]))\n\t\t\t{\n\t\t\t\t$myPost[$k] = $v;\n\t\t\t}\n\t\t}\n\t\t//\n\n\t\t$req = 'cmd=_notify-validate';\n\t\tif (function_exists('get_magic_quotes_gpc'))\n\t\t{\n\t\t\t$get_magic_quotes_exists = true;\n\t\t}\n\n\t\tforeach ($myPost as $key => $value)\n\t\t{\n\t\t\tif ($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1)\n\t\t\t{\n\t\t\t\t$value = urlencode(stripslashes($value));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$value = urlencode($value);\n\t\t\t}\n\n\t\t\t$req .= \"&$key=$value\";\n\t\t\t$array_result['log'] .= \"&$key=$value\\n\";\n\t\t}\n\t\t\n\t\tif (!function_exists('curl_init'))\n\t\t{\n\t\t\t$array_result['log'] = \"FATAL ERROR: cURL is not installed on the server\\n\\n\" . $array_result['log'];\n\n\t\t\treturn $array_result;\n\t\t}\n\t\t\n\t\tif ($this->sandbox == 1)\n\t\t{\n\t\t\t$paypal_url = \"https://www.sandbox.paypal.com/cgi-bin/webscr\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$paypal_url = \"https://www.paypal.com/cgi-bin/webscr\";\n\t\t}\n\t\t\n\t\t$ch = curl_init($paypal_url);\n\t\tif ($ch == false)\n\t\t{\n\t\t\t$array_result['log'] = \"Curl error: \" . curl_error($ch) . \"\\n\\n\" . $array_result['log'];\n\n\t\t\treturn $array_result;\n\t\t}\n\t\t\n\t\tcurl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $req);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\t\t\n\t\t/**\n\t\t * Turn on TLS 1.2 protocol in case of safe mode or sandbox enabled.\n\t\t *\n\t\t * @since 1.6.2\n\t\t */\n\t\tif (defined('CURLOPT_SSLVERSION') && ($this->sandbox || $this->safemode))\n\t\t{\n\t\t\tcurl_setopt($ch, CURLOPT_SSLVERSION, 6);\n\t\t}\n\n\t\tcurl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\n\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\n\t\t\n\t\t// CONFIG: Please download 'cacert.pem' from \"http://curl.haxx.se/docs/caextract.html\" and copy it in the same folder as this php file\n\t\t// This is mandatory for some environments.\n\t\t// $cert = dirname(__FILE__) . \"/cacert.pem\";\n\t\t// curl_setopt($ch, CURLOPT_CAINFO, $cert);\n\t\t\n\t\t$res = curl_exec($ch);\n\n\t\tif (curl_errno($ch) != 0)\n\t\t{\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e] ') . \" Can't connect to PayPal to validate IPN message: \" . curl_error($ch) . PHP_EOL;\n\n\t\t\tcurl_close($ch);\n\n\t\t\treturn $array_result;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e]') . \" HTTP request of validation request:\". curl_getinfo($ch, CURLINFO_HEADER_OUT) .\" for IPN payload: $req\" . PHP_EOL;\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e]') . \" HTTP response of validation request: $res\" . PHP_EOL;\n\t\t\t\n\t\t\tcurl_close($ch);\n\t\t}\n\t\t\n\t\tif (strcmp(trim($res), 'VERIFIED') == 0)\n\t\t{\n\t\t\t$array_result['tot_paid'] = $_POST['mc_gross'];\n\t\t\t$array_result['verified'] = 1;\n\t\t\t$array_result['log'] = '';\n\t\t}\n\t\telse if (strcmp(trim($res), 'INVALID') == 0)\n\t\t{\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e]'). \" Invalid IPN: $req\\n\\nResponse: [$res]\" . PHP_EOL;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$array_result['log'] .= date('[Y-m-d H:i e]'). \" Unknown Error: $req\\n\\nResponse: [$res]\" . PHP_EOL;\n\t\t}\n\t\t\n\t\t//END cURL Method HTTP1.1 October 2013\n\t\t\n\t\treturn $array_result;\n\t}", "public function balanceOf($address)\n {\n\t\t// Remove 0x from address\n\t\tif(strlen($address) == 42 && substr($address, 0, 2) == '0x') {\n\t\t\t$address = substr($address, 2);\n\t\t}\n\n\t\t// Params\n\t\t$c = new \\stdClass();\n\t\t$c->from = '0x7ee760b17ce5cd95b9752f261bfb9b91c2babdba';\n\t\t$c->to = $this->sc_address;\n\t\t$c->data = '0x70a08231000000000000000000000000' . $address;\n\t\t\t\t\n\t\t$params = [$c, \"latest\"];\n\t\t\n\t\t// Perform request (request->request->... ugly!)\n\t\t$data = $this->request->request('eth_call', $params);\n\t\t\t\t\n\t\treturn $data;\n }", "private function saveAddresses() {\n\t\t\t$billingSaved = false;\n\t\t\t$shippingSaved = false;\n\t\t\tif ($this->memberID && $this->billingAddress->validAddress() && $this->shippingAddress->validAddress()) {\n\t\t\t\t// compare billing and shipping addresses\n\t\t\t\t$billingIsShipping = true;\n\t\t\t\tforeach ($this->billingAddress->get('addressForm') as $key => $val) {\n\t\t\t\t\tif ($val != $this->shippingAddress->getArrayData('addressForm', $key)) {\n\t\t\t\t\t\t$billingIsShipping = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($billingIsShipping) {\n\t\t\t\t\t// if the billing address is the same as the shipping address\n\t\t\t\t\t// address record will retain the shipping address name\n\t\t\t\t\t// billing address does not have a name\n\t\t\t\t\t// (payment method name will be in the payment record)\n\t\t\t\t\t$this->shippingAddress->addType('billing');\n\t\t\t\t\tif ($this->shippingAddress->get('saveAddress') || systemSettings::get('FORCESAVESHIPPING')) {\n\t\t\t\t\t\tif (!$this->shippingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->shippingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->shippingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->shippingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `shippingID` = '\".$this->shippingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$billingIsDefault = false;\n\t\t\t\t\t\tif ($this->billingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$billingIsDefault = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->billingAddress->loadAddress($this->shippingAddress->get('addressID'))) {\n\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($this->billingAddress->get('saveAddress') || systemSettings::get('FORCESAVEBILLING')) {\n\t\t\t\t\t\tif (!$this->billingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->billingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->billingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->billingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `billingID` = '\".$this->billingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$billingSaved = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ($this->shippingAddress->get('saveAddress') || systemSettings::get('FORCESAVESHIPPING')) {\n\t\t\t\t\t\tif (!$this->shippingAddress->get('addressID')) {\n\t\t\t\t\t\t\tif ($this->shippingAddress->saveAddress($this->memberID)) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($this->shippingAddress->updateAddress()) {\n\t\t\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ($this->shippingAddress->get('defaultAddress')) {\n\t\t\t\t\t\t\t$this->dbh->query(\"UPDATE `customers` SET `shippingID` = '\".$this->shippingAddress->get('addressID').\"' WHERE `memberID` = '\".$this->memberID.\"'\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$shippingSaved = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn ($billingSaved && $shippingSaved);\n\t\t}", "public function chargeFee($amount = false) {\n $this->checkFee($amount);\n\n if(!$amount) {\n $fee = config('games.under_over.entry_fee');\n } else {\n $fee = $amount;\n }\n \n // deduct from the gold of current user\n $this->gold = $this->gold - $fee;\n try {\n $this->saveOrFail();\n } catch(QueryException $ex) {\n throw new PersonalRuntimeException(__('common.errors.invalid_query'));\n }\n }", "public function processPCTWalletTransfer($payload)\n\t{\n\t # Load user model\n\t $this->load->model('user');\n\t \n\t $result = $this->user->sign_in($this->input->post('user-name'), $this->input->post('user-password'));\n\t \n\t if(!$result)\n\t {\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_FAILED_LOGIN_ERROR);\n\t return $response;\n\t }\n\t \n\t $txnId = \"PCTINT\".time();\n\t $fromUser = $result;\n\t $toUser = $this->input->post('to-account');\n\t $txnType = 'User To User Transfer';\n\t $txnPoints = $this->input->post('pct-transfer-points');\n\t $txnTopic = $this->input->post('pct-topic');\n\t $txnMessage = $this->input->post('pct-message');\n\t \n\t # Now before actually making the transaction store, we need to add points to users account\n\t \n\t $profile = $this->user->getUserProfile($result);\n\t \n\t $walletAmount = $profile->{User::_PCT_WALLET_AMOUNT};\n\t \n\t if($txnPoints > $walletAmount){\n\t $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_TRANSFER_FAILURE_INSUFFICIENT_FUND);\n\t return $response;\n\t }\n\t \n\t $toUserProfile = $this->user->getUserProfile($toUser);\n\t \n\t $this->db->where(User::_ID, $toUser)->update(User::_TABLE, array(User::_PCT_WALLET_AMOUNT => $toUserProfile->{User::_PCT_WALLET_AMOUNT} + $txnPoints));\n\t $this->db->where(User::_ID, $fromUser)->update(User::_TABLE, array(User::_PCT_WALLET_AMOUNT => ($walletAmount- $txnPoints)));\n\t \n\t \n\t # Load pct-transaction model\n\t $this->load->model('pct_transaction');\n\t $result = $this->pct_transaction->create_transaction($fromUser, $toUser, $txnId, $txnType, $txnPoints, $txnTopic, $txnMessage);\n\t \n\t # Now once the payment is successfull, we should get the balance once again and pass this\n\t \n\t $profile = $this->user->getUserProfile($fromUser);\t \n\t $walletAmount = $profile->{User::_PCT_WALLET_AMOUNT};\n\t \n\t \n\t if($result) $response = array('flag'=>1, 'message'=>Message::PCT_PAYMENT_TRANSFER_SUCCESS, 'walletAmount'=>$walletAmount);\n\t else $response = array('flag'=>0, 'message'=>Message::PCT_PAYMENT_TRANSFER_FAILURE);\n\t \n\t return $response;\n\t}", "function openstack_change_funds($invoiceid, $substract=False) {\n $items = Capsule::table('tblinvoiceitems')->where('invoiceid', '=', $invoiceid)->get();\n\n // Retrieve the invoice total paid.\n // If this invoice was not fully paid, we do not substract from Fleio.\n // There is no other way to prevent subtracting from Fleio when cancelling an invoice and marking it unpaid afterwards\n try {\n $balance = Capsule::table('tblaccounts as ta')\n ->where('ta.invoiceid', '=', $invoiceid)\n ->join('tblinvoices as ti', 'ta.invoiceid', '=', 'ti.id')\n ->select(Capsule::raw('SUM(ta.amountin)-SUM(ta.amountout)-ti.total as balance'))\n ->value('balance');\n } catch (Exception $e) {\n logActivity($e->getMessage());\n $balance = false;\n } \n $cost_by_service = array();\n $promo_by_service = array();\n foreach($items as $item) {\n # NOTE(tomo): Check if relid is set and not an empty string\n if (($item->relid == '') || !isset($item->relid)) {\n continue;\n }\n if ($item->type == 'PromoHosting') {\n # NOTE(tomo): Do nothing with $promo_by_service. Just don't add it\n # to the final amount to avoid incorrect credit addition in Fleio\n if (isset($promo_by_service[$item->relid])) {\n $promo_by_service[$item->relid] += $item->amount;\n } else {\n $promo_by_service[$item->relid] = $item->amount;\n }\n } else {\n if (isset($cost_by_service[$item->relid])) {\n $cost_by_service[$item->relid] += $item->amount;\n } else {\n $cost_by_service[$item->relid] = $item->amount;\n }\n }\n }\n\n foreach($items as $item) {\n if (($item->type != 'Hosting') || !isset($cost_by_service[$item->relid])) {\n continue;\n }\n # We now know that relid is a Hosting package (not a Domain for example)\n $service = FleioUtils::getServiceById($item->relid);\n if ($service->servertype == 'fleio') {\n # NOTE(tomo): Make sure the service is active. If it's not active and we don't handle this, the credit is lost.\n # NOTE(tomo): We currently handle this in the add/remove credit methods.\n $clientCurrency = getCurrency($item->userid);\n $defaultCurrency = getCurrency();\n $clientAmount = $cost_by_service[$item->relid]; // Amount + Setup and/or other related prices in client's currency\n # NOTE(tomo): Fleio needs to use the WHMCS default currency\n $amount = convertCurrency($clientAmount, 1, $clientCurrency['id']); // Amount in default currency.\n if ($amount == 0) {\n logActivity('Fleio: ignoring Service ID: '. $item->relid . ' with cost equal to 0 from Invoice ID: ' . $invoiceid);\n continue;\n }\n if ($substract && $balance != false && $balance >= 0) {\n logActivity('Fleio: ignoring Service ID: '. $item->relid .' from Invoice ID: ' . $invoiceid . ' with status Unpaid but fully paid');\n continue;\n }\n $fl = Fleio::fromServiceId($item->relid);\n if ($substract) {\n $msg_format = \"Fleio: removing credit for WHMCS User ID: %s with %.02f %s (%.02f %s from Invoice ID: %s)\";\n } else {\n $msg_format = \"Fleio: adding credit for WHMCS User ID: %s with %.02f %s (%.02f %s from Invoice ID: %s)\";\n }\n $msg = sprintf($msg_format, $item->userid, $amount, $defaultCurrency[\"code\"], $clientAmount, $clientCurrency[\"code\"], $invoiceid);\n logActivity($msg);\n # TODO(tomo): We use the userid which can be a contact ?\n try {\n $addCredit = (!$subtract); // Add credit or subtract, boolean\n $response = $fl->clientChangeCredit($addCredit, $amount, $defaultCurrency[\"code\"], $clientCurrency[\"rate\"], $clientAmount, $clientCurrency[\"code\"], $invoiceid);\n } catch (FlApiException $e) {\n logActivity(\"Unable to update the client credit in Fleio: \" . $e->getMessage()); \n return;\n }\n logActivity(\"Fleio: successfully changed client credit with \".$amount.\" \".$defaultCurrency[\"code\"]. \" for Fleio client id: \".$response['client'].\". New Fleio balance: \".$response['credit_balance'].\" \".$defaultCurrency[\"code\"]); \n }\n }\n}", "function getPayments(){\n $earlyPayment = 0;\n $regularPayment = 0;\n $latePayment = 0;\n \n // Separate fee payments into early, regular, late deadlines\n $this->totalFinAid = 0;\n $payments = payment::getSchoolPayments($this->schoolId);\n for($i = 0; $i < sizeof($payments); $i++){\n $payment = new payment($payments[$i]);\n if($payment->finaid == '1') $this->totalFinAid += $payment->amount;\n if($payment->startedTimeStamp<=generalInfoReader('earlyRegDeadline')){\n $earlyPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('earlyRegDeadline') && $payment->startedTimeStamp<=generalInfoReader('regularRegDeadline')){\n $regularPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('regularRegDeadline')){\n $latePayment += intval($payment->amount);\n }\n }\n // Check when school fee was paid\n if($earlyPayment>=generalInfoReader('earlySchoolFee') || $this->numStudents <= 5){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n\t } else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($earlyPayment+$regularPayment>=generalInfoReader('regularSchoolFee')){\n $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t$this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n\n\t}elseif($earlyPayment+$regularPayment+$latePayment>=generalInfoReader('lateSchoolFee')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }else{ // School fee was not paid\n $curTime = time();\n if($curTime<=generalInfoReader('earlyRegDeadline')){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n \t} else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('earlyRegDeadline') && $curTime<=generalInfoReader('regularRegDeadline')){\n\t $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t $this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('regularRegDeadline')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }\n }\n\t\n // Small delegations don't pay school fees\n if($this->numStudents <=5 && $this->numAdvisers){\n $this->schoolFee = 0;\n }\n\t\n\t//Chosun doesn't pay\n\tif(strpos(strtolower($this->schoolName),\"chosun\") !== False || strpos(strtolower($this->schoolName),\"worldview\") !== False){\n\t $this->schoolFee = 0;\n\t $this->delegateFee = 0;\n\t}\n\n // Calculating numbers\n $this->totalPaid = $earlyPayment + $regularPayment + $latePayment - $this->totalFinAid;\n $this->delegateFeeTotal = $this->numStudents*$this->delegateFee;\n $mealTicket = new mealTicket($this->schoolId);\n $this->mealTicketTotal = $mealTicket->totalCost;\n \n $this->schoolFeePaid = 0;\n $this->schoolFeeOwed = 0;\n $this->delegateFeePaid = 0;\n $this->delegateFeeOwed = 0;\n $this->mealTicketPaid = 0;\n $this->mealTicketOwed = 0;\n if($this->totalPaid < $this->schoolFee){\n // Haven't paid school fee\n $this->schoolFeePaid = $this->totalPaid;\n $this->schoolFeeOwed = $this->schoolFee - $this->totalPaid;\n $this->delegateFeeOwed = $this->delegateFeeTotal;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }elseif($this->totalPaid + $this->totalFinAid < $this->schoolFee + $this->delegateFeeTotal){\n // Have paid school fee but not delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->totalPaid + $this->totalFinAid - $this->schoolFee;\n $this->delegateFeeOwed = $this->delegateFeeTotal - $this->delegateFeePaid;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }else{\n // Have paid school and delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->delegateFeeTotal;\n $this->mealTicketPaid = min($this->mealTicketTotal, $this->totalPaid + $this->totalFinAid - $this->schoolFee - $this->delegateFeeTotal);\n $this->mealTicketOwed = $this->mealTicketTotal - $this->mealTicketPaid;\n }\n $this->totalFee = $this->schoolFee + $this->delegateFeeTotal + $this->mealTicketTotal;\n $this->totalOwed = $this->totalFee - $this->totalFinAid - $this->totalPaid;\n \n\t//Create formatted versions:\n\t$this->totalFeeFormatted = '$'.money_format('%.2n',$this->totalFee);\n\t$this->totalPaidFormatted = '$'.money_format('%.2n',$this->totalPaid);\n\t$this->totalOwedFormatted = '$'.money_format('%.2n',$this->totalOwed);\n\n\n\t$this->schoolFeeFormatted = '$'.money_format('%.2n',$this->schoolFee);\n\t$this->schoolFeePaidFormatted = '$'.money_format('%.2n',$this->schoolFeePaid);\n\t$this->schoolFeeOwedFormatted = '$'.money_format('%.2n',$this->schoolFeeOwed);\n\t\n\t$this->delegateFeeFormatted = '$'.money_format('%.2n',$this->delegateFee);\n\t$this->delegateFeeTotalFormatted = '$'.money_format('%.2n',$this->delegateFeeTotal);\n\t$this->delegateFeePaidFormatted = '$'.money_format('%.2n',$this->delegateFeePaid);\n\t$this->delegateFeeOwedFormatted = '$'.money_format('%.2n',$this->delegateFeeOwed);\n\n\t$this->totalFinAidFormatted = '$'.money_format('%.2n',$this->totalFinAid);\n\n\n // Calculate Payment Due Date\n if($this->delegateFee == generalInfoReader('earlyDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('earlyRegDeadline');\n if($this->delegateFee == generalInfoReader('regularDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('regularRegDeadline');\n if($this->delegateFee == generalInfoReader('lateDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('lateRegDeadline');\n $this->totalPaymentDue = generalInfoReader('paymentDueDate');\n\t\n }", "public function feeEstimate(int $numBlocks = null)\n {\n return $this->execute($this->getCoin() . '/tx/fee', 'GET', [\n 'numBlocks' => $numBlocks\n ]);\n }", "private function account(){\n\t\t\t// Cross validation if the request method is POST else it will return \"Not Acceptable\" status\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\t\t\t\n\t\t\t$first_name = $this->_request['first_name'];\t\t\n\t\t\t$last_name = $this->_request['last_name'];\n\t\t\t$address = $this->_request['address'];\t\t\n\t\t\t$member_number = $this->_request['member_number'];\t\n\t\t\t$email = $this->_request['email'];\n\t\t\t$phone_number = $this->_request['phone_number'];\n\t\t\t$mobile = $this->_request['mobile'];\t\n\t\t\t$signature = $this->_request['signature'];\n\t\t\t$current_datetime = new DateTime(); \n\t\t\t$birth_date = $this->_request['birth_date'];\t\n\t\t\t$birth_date_format = substr($birth_date, 6, 4).'-'.substr($birth_date, 3, 2).'-'.substr($birth_date, 0, 2);\n\t\t\t$name_of_fund_1 = $this->_request['name_of_fund_1'];\n\t\t\t$name_of_fund_2 = $this->_request['name_of_fund_2'];\n\t\t\t$name_of_fund_3 = $this->_request['name_of_fund_3'];\n\t\t\t$name_of_fund_4 = $this->_request['name_of_fund_4'];\n\t\t\t$name_of_fund_5 = $this->_request['name_of_fund_5'];\n\t\t\t$previous_name = $this->_request['previous_name'];\n\t\t\t$name_of_fund = $name_of_fund_1;\n\t\t\tif(trim($name_of_fund_2)!=''){\n\t\t\t\t$name_of_fund .= ', '.$name_of_fund_2;\n\t\t\t}\t\n\t\t\tif(trim($name_of_fund_3)!=''){\n\t\t\t\t$name_of_fund .= ', '.$name_of_fund_3;\n\t\t\t}\n\t\t\tif(trim($name_of_fund_4)!=''){\n\t\t\t\t$name_of_fund .= ', '.$name_of_fund_4;\n\t\t\t}\n\t\t\tif(trim($name_of_fund_5)!=''){\n\t\t\t\t$name_of_fund .= ', '.$name_of_fund_5;\n\t\t\t}\t\t\t\n\t\t\t$previous_address = $this->_request['previous_address'];\n\t\t\t$result = mysql_query(\"INSERT INTO accounts (member_number, first_name, last_name, address, email, phone_number, mobile, birth_date, signature, date_created, date_modified ) \n\t\t\tVALUES ('\".$member_number.\"', '\".mysql_real_escape_string($first_name).\"', '\".mysql_real_escape_string($last_name).\"', '\".$address.\"', '\".$email.\"', '\".$phone_number.\"', '\".$mobile.\"', '\".$birth_date_format.\"', '\".$signature.\"', NOW(), NOW())\", $this->db);\n\t\t\tif($result) {\n\t\t\t\t$account_id = mysql_insert_id();\n\t\t\t\tif(trim($name_of_fund_1)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_1).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\tif(trim($name_of_fund_2)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_2).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\tif(trim($name_of_fund_3)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_3).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(trim($name_of_fund_4)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_4).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\tif(trim($name_of_fund_5)!=''){\n\t\t\t\t\t$result_fund = mysql_query(\"INSERT INTO funds (account_id, fund_name, name, address) \n\t\t\t\t\tVALUES ('\".$account_id.\"', '\".mysql_real_escape_string($name_of_fund_5).\"', '\".mysql_real_escape_string($previous_name).\"', '\".$previous_address.\"')\", $this->db);\t\t\t\t\t\t\t\n\t\t\t\t} \t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}\t\t\t\t\n\t\t\tif($result){\n\t\t\t\t$to = \tEMAIL_TO;\n\t\t\t\t$subject = \t'\"Snap4m New Account';\n\t\t\t\t$mime_boundary=\"==Multipart_Boundary_x\".md5(mt_rand()).\"x\";\n\t\t\t\t \t \t\t\t /*\t*/\n\t\t\t\t$headers = \t\"From:\".EMAIL_FROM.\"\\r\\n\";\n\t\t\t\t$headers .= \t\"MIME-Version: 1.0\\r\\n\"\n\t\t\t\t \t.\"Content-Type: multipart/mixed; boundary=\\\"{$mime_boundary}\\\"\";\t\t\t\t\t \t \n\t $message = \"This is a multi-part message in MIME format.\\n\\n\".\n\t \"--{$mime_boundary}\\n\" .\n\t \"Content-Type: text/plain; charset=\\\"iso-8859-1\\\"\\n\" .\n\t \"Content-Transfer-Encoding: 7bit\\n\\n\";\n\t $message .= \"Name: \".htmlspecialchars($first_name).' '.htmlspecialchars($last_name).\"\\r\\n\"\n\t\t\t\t\t.\"Member No: \".$member_number.\"\\r\\n\"\n\t\t\t\t\t.\"Birthdate: \".$birth_date.\"\\r\\n\"\n\t\t\t\t\t.\"Address: \".$address.\"\\r\\n\"\n\t\t\t\t\t.\"Email: \".$email.\"\\r\\n\"\n\t\t\t\t\t.\"Phone No: \".$phone_number.\"\\r\\n\"\n\t\t\t\t\t.\"Mobile: \".$mobile.\"\\r\\n\"\n\t\t\t\t\t.\"Name of Fund: \".htmlspecialchars($name_of_fund).\"\\r\\n\"\n\t\t\t\t\t.\"Previous Name: \".htmlspecialchars($previous_name).\"\\r\\n\"\n\t\t\t\t\t.\"Previous Address: \".$previous_address.\"\\r\\n\\r\\n\".\"Signature:\\n\\n\";\n\t // attachment with mime babble\n\t $message .= \"--{$mime_boundary}\\n\";\t\t\t\t\t\t\t \t \n\t\t\t\t$file = \tfile_get_contents(\"http://snap4m.com/signatures/\".$signature);\t\t\t\t\t\t \t \n\t\t\t\t$message .= \t\"Content-Type: image/png; name=\\\"\".$signature.\"\\\"\\r\\n\"\n\t\t\t\t \t.\"Content-Transfer-Encoding: base64\\r\\n\"\n\t\t\t\t \t.\"Content-disposition: attachment; file=\\\"\".$signature.\"\\\"\\r\\n\"\n\t\t\t\t \t.\"\\r\\n\"\n\t\t\t\t \t.chunk_split(base64_encode($file))\n\t\t\t\t \t.\"--{$mime_boundary}--\\n\";\n\t\t\t\t\n\t\t\t\tif(mail($to, $subject, $message, $headers))\n\t\t\t\t{\n\t\t\t\t $this->response('success', 200);\n\t\t\t\t} else {\n\t\t\t\t $this->response('success', 200);\n\t\t\t\t} \t\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t//$this->response('success', 200);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Add Failed\");\n\t\t\t\t$this->response($this->json($error), 400);\t\t\t\t\t\t\n\t\t\t}\t\t\t\n\t\t}", "public static function payUser($from, $to, $amount, $fee){\n\t\t$frombalance = Dogecoin::getBalance($from);\n\t\tif ($frombalance['available'] < $amount){\n\t\t\t//they don't have the funds\n\t\t\treturn \\Shared\\Error::handleError(\"nofunds\");\n\t\t}\n\t\t//move the fee to the fee account\n\t\ttry{\n\t\t\t$response = Dogecoin::move($from, $to, $amount);\n\t\t\t$response = Dogecoin::move($to, \"CREATION-FEE\", $fee);\n\t\t\treturn $amount;\n\t\t}catch(Exception $e){\n\t\t\treturn 0;\n\t\t}\n\t}", "function transfer_money() {\n\t\t$user_id = $_REQUEST['user_id'];\n\t\t$mobile = $_REQUEST['mobile_no'];\n\t\t$amount = $_REQUEST['amount'];\n\t\t$mobile_no = $_REQUEST['mobile_no'];\n\n\t\t//$transaction_id= mt_rand( 10000000, 99999999);\n\t\t$wallet_type_main = 2;\n\t\t// amount debit in user self\n\t\t$wallet_type_frnd = 1;\n\t\t// amount credit in frnd\n\t\t$wallet_category_to = 5;\n\t\t// transfer money to\n\t\t$wallet_category_from = 10;\n\t\t// transfer money from\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\tif (!empty($mobile)) {\n\t\t\t$user_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif (!empty($user_records)) {\n\t\t\t\t$main_wallet = $user_records['0']['wallet_amount'];\n\t\t\t\t$contact_number_main = $user_records['0']['user_contact_no'];\n\t\t\t\t// main user mobile number\n\t\t\t\tif ($main_wallet >= $amount) {\n\t\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t\t\tif (!empty($records)) {\n\t\t\t\t\t\t$contact_number_frnd = $records['0']['user_contact_no'];\n\t\t\t\t\t\t// frnd mobile number\n\t\t\t\t\t\t$frnd_wallet = $records['0']['wallet_amount'];\n\t\t\t\t\t\t$frnd_id = $records['0']['user_id'];\n\t\t\t\t\t\tif ($frnd_id != $user_id) {\n\t\t\t\t\t\t\t// amount transfer to another\n\t\t\t\t\t\t\t$transaction_id1 = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t$w_to_desc = \"Amount transfer to \" . $contact_number_frnd;\n\t\t\t\t\t\t\t$wallet_to_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_to . '\",\"' . $transaction_id1 . '\",\"' . $w_to_desc . '\",\"' . $contact_number_frnd . '\"');\n\t\t\t\t\t\t\tif (!empty($wallet_to_transfer)) {\n\t\t\t\t\t\t\t\t//amount recieved by transfer\n\t\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t\t$w_by_desc = \"Amount transfer from \" . $contact_number_main;\n\t\t\t\t\t\t\t\t$wallet_by_transfer = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $frnd_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_from . '\",\"' . $transaction_id . '\",\"' . $w_by_desc . '\",\"' . $contact_number_main . '\"');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (!empty($wallet_by_transfer)) {\n\t\t\t\t\t\t\t\t$main_wallet_money = $main_wallet - $amount;\n\t\t\t\t\t\t\t\t$frnd_wallet_money = $frnd_wallet + $amount;\n\t\t\t\t\t\t\t\t// update main user wallet\n\t\t\t\t\t\t\t\t$data['wallet_amount'] = $main_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user_id, $data);\n\t\t\t\t\t\t\t\t// update frnd wallet//\n\t\t\t\t\t\t\t\t$data1['wallet_amount'] = $frnd_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $frnd_id, $data1);\n\t\t\t\t\t\t\t\t$post = array('status' => 'true', 'message' => 'Transfer money successfully', 'main_user_id' => $user_id, 'main_wallet' => $main_wallet_money, 'frnd_wallet' => $frnd_wallet_money, 'frnd_id' => $frnd_id, 'transfer_mobile' => $mobile_no, 'transfer_amount' => $amount, 'transaction_id' => $transaction_id1, 'transfer_date' => $current_date);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Error in transfering amount\");\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Please enter another user number\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"This user is not exist of given number\");\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Wallet amount is not sufficent to transfer money\");\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"invalid user\", 'user_id' => $user_id);\n\t\t\t}\n\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"missing parameter\", 'user_id' => $user_id, 'amount' => $amount, 'mobile' => $moble);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "public function getAddressCapayableFee(Mage_Sales_Model_Quote_Address $address,$value = NULL,$alreadyExclTax = FALSE){\n if($this->_logging) {\n Mage::log('In getAddressCapayableFee (Postpayment)', null, $this->_logfile);\n }\n if (is_null($value)){\n $value = floatval(Mage::helper('capayable')->getPaymentMethodCost($this->_code,$address));\n }\n if (Mage::helper('capayable')->capayableFeePriceIncludesTax()) {\n if (!$alreadyExclTax) {\n $value = Mage::helper('capayable')->getCapayableFeePrice($value, false, $address, $address->getQuote()->getCustomerTaxClassId());\n }\n }\n if($this->_logging) {\n Mage::log('getAddressCapayableFee (Postpayment) value '.$value, null, $this->_logfile);\n }\n return $value;\n }", "public function calculatePayment()\n {\n }", "function dosql_fee(){\n global $conn;\n $paid=$_SESSION['pay_not'];\n if($paid=='All'){\n $sql4=\"SELECT * FROM owner_fee\";\n $result4=mysqli_query($conn,$sql4);\n\n\n\n return $result4;\n \n }else if($paid=='N'){\n $sql5=\"SELECT * FROM owner_fee where paid='N' \";\n $result5=mysqli_query($conn,$sql5);\n return $result5;\n }else if($paid='Y'){\n $sql6=\"SELECT * FROM owner_fee where paid='Y' \";\n $result6=mysqli_query($conn,$sql6);\n return $result6;\n }\n }", "public function makeExamFeePayment($admin_id)\n {\n // Validation\n // $this->validate($request, [\n // 'user_id' => 'required',\n // 'student_index' => 'required',\n // 'student_name' => 'required'\n // ]);\n\n //Collecting data from html form\n // $user_id = trim($request->user_id);\n // $student_index = trim($request->student_index);\n // $student_name = trim($request->student_name);\n\n\n $merchant_order_id = rand(111112,888889);\n $merchant_ref_id = rand(334335,987415);\n\n $callback_url = \"https://smart-typing.com/examFeePaymentSuccess\";\n\n $general = DB::table('tbl_payment_gateway')->first();\n $feeQuery = DB::table('tbl_exam_fee')->first();\n $userQuery = DB::table('admin')->where('id',$admin_id)->first();\n $studentName = $userQuery->first_name.' '.$userQuery->last_name;\n $username = $userQuery->email;\n $user_id = $userQuery->id;\n $step_id = $userQuery->step_id;\n $sessionQuery = DB::table('tbl_step')->where('id',$step_id)->first();\n $product_desc = \"Exam Fee of Smart Typing. Session : \".$sessionQuery->step_name;\n $customer_add = \"Gazipur, Dhaka\";\n $mobile = $userQuery->mobile;\n\n $serverData = json_decode($this->getWMXServerData());\n $url = $serverData->url;\n $app_name = $general->wmx_app_name;\n $options = (base64_encode('s='.$app_name.',i='.\\request()->ip()));\n $wmx_id = $general->wmx_id;\n $access_app_key = $general->wmx_access_app_key;\n $access_username = $general->wmx_access_username;\n $access_password = $general->wmx_access_password;\n $authorization = 'Basic '.base64_encode($access_username.':'.$access_password);\n $cart_info = $wmx_id.','.$app_name.','.'flight';\n \n $data = [\n 'wmx_id' => $wmx_id,\n 'merchant_order_id' => $merchant_order_id,\n 'merchant_ref_id' => $merchant_ref_id,\n 'app_name' => $app_name,\n 'cart_info' => $cart_info,\n 'customer_name' => $studentName,\n 'customer_email' => $username,\n 'customer_add' => $customer_add,\n 'customer_phone' => $mobile,\n 'product_desc' => $product_desc,\n 'amount' => $sessionQuery->amount,\n 'currency' => 'BDT',\n 'options' => $options,\n 'callback_url' => $callback_url,\n 'access_app_key' => $access_app_key,\n 'authorization' => $authorization,\n ];\n \n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL => $url,\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => http_build_query($data),\n ));\n \n $resp = curl_exec($curl);\n curl_close($curl);\n \n $json = json_decode($resp);\n $token = $json->token;\n \n Session::put($token.'_user_id',$user_id);\n Session::put($token.'_username',$username);\n \n return Redirect::to('http://sandbox.walletmix.com/bank-payment-process/'.$token.'/'.$username);\n }", "function handleChannelFees(&$trans, $use_erp) {\n debug_print(\"Entry: handlingChannelFees ( use_erp = \" . (($use_erp) ? \"yes\" : \"no\") . \" )\");\n\n $fees = loadManagementFees(\n tget($trans, 'params.amount'), tget($trans, 'work.paymentmethod_id'), tget($trans, 'work.meter.debtortype_id'), tget($trans, 'work.meter.country_id'), tget($trans, 'work.chargefee'), tget($trans, 'work.account_id'), 100, // tenantfeepercentage. Was hard coded to 100. Still is.\n tget($trans, 'work.vat_rate')\n );\n\n debug_print(\"Calculated fees: \" . (debug_flatten_array($fees)));\n\n // According to the tenantfeepercentage, we must now split the fees\n // between the tenant and the landlord.\n\n $amount = tget($trans, \"params.amount\");\n $vat = $fees['tax'];\n $exclusive = $fees['excl'];\n $landlord = $fees['landlord'];\n\n $tenantPercentage = tget($trans, \"work.account.tenantfeepercentage\");\n\n // Don't waste time if we have 100 or 0\n if ($tenantPercentage == 100) {\n $tid = handleChannelFeesForTenant($trans, $vat, $exclusive, $landlord, $use_erp);\n debug_print(\"Returning transaction ids ( $tid, 0 )\");\n return array($tid, 0);\n }\n\n if ($tenantPercentage == 0) {\n $tid = handleChannelFeesForLandlord($trans, $vat, $exclusive, $landlord, $use_erp);\n debug_print(\"Returning transaction ids ( 0, $tid )\");\n return array(0, $tid);\n }\n\n // We have to calculate percentages\n\n $ttid = 0;\n $ltid = 0;\n\n $newVat = round((($vat * $tenantPercentage) / 100), 2);\n $newExclusive = round((($exclusive * $tenantPercentage) / 100), 2);\n $newLandlord = round((($landlord * $tenantPercentage) / 100), 2);\n\n // Floating point errors can be stupid sometimes\n if ($newVat < 0.01)\n $newVat = 0.0;\n if ($newExclusive < 0.01)\n $newExclusive = 0.0;\n if ($newLandlord < 0.01)\n $newLandlord = 0.0;\n\n // In some cases, there's no point in doing this.\n if (($newVat != 0) || ($newExclusive != 0)) {\n $ttid = handleChannelFeesForTenant(\n $trans, $newVat, $newExclusive, $landlord, $use_erp\n );\n\n $ltid = handleChannelFeesForLandlord(\n $trans, ($vat - $newVat), ($exclusive - $newExclusive), ($landlord - $newLandlord), $use_erp\n );\n } else {\n // In this case, there's technically all for the landlord\n $ltid = handleChannelFeesForLandlord(\n $trans, $vat, $exclusive, $landlord, $use_erp\n );\n }\n\n\n $rc = array($ttid, $ltid);\n\n debug_print(\"Returning transaction ids ( $ttid, $ltid )\");\n return $rc;\n}", "function Is_Service_Charge_Payment($event)\n{\n\tif(in_array($event->context, array('generated', 'arrange_next')))\n\t{\n\t\tforeach($event->amounts as $ea)\n\t\t{\n\t\t\tif($ea->event_amount_type == 'service_charge' && $ea->amount < 0)\n\t\t\t\treturn TRUE;\n\t \t}\n\t}\n\treturn FALSE;\n}", "public function notify(TransferFundsNotification $notification)\n {\n $sender = $this->members->with($notification->senderId());\n $recipient = $this->members->with($notification->recipientId());\n\n $this->sender->sendFundsTransferredEmail(\n $sender->information(),\n $recipient->information(),\n $notification->amount(),\n $notification->occurredOn()\n );\n\n $this->sender->sendDepositReceivedEmail(\n $sender->information(),\n $recipient->information(),\n $notification->amount(),\n $notification->occurredOn()\n );\n }", "public function transferBalance($post)\n {\n $response = array();\n //Get user details By token\n $userData = $this->getUserModel()->getUserByToken($post['token']);\n \n $currentDate = $this->getAppService()->getDate();\n //Check Request\n if ($post['type'] == 'debit') {\n //Get Local user details By PhoneNo\n $localUserData = $this->getUserModel()->getLocalUserByPhoneNo($post['phoneNo']);\n \n if (count($localUserData)) {\n //check account status\n if ($localUserData['accountStatus'] == 'Active') {\n //check request Bal\n if (($localUserData['avaiPurchaseBal'] - $this->signupBal) >= $post['balance']) {\n //generate bal request code\n $transferCodeMatch = true;\n while ($transferCodeMatch == true) {\n \n $transferCode = rand('111111', '999999');\n $getUserInfo = $this->getUserModel()->passwordVerifyCodeExist($transferCode);\n if (count($getUserInfo) == 0) {\n $transferCodeMatch = false;\n }\n }\n try {\n //set transfer code\n $updateUserData = array (\n 'balReqCode' => $transferCode,\n 'balReq' => $post['balance']\n );\n $this->getUserModel()->updateUser($localUserData['Id'], $updateUserData);\n \n //set notification message\n $notificationData = array (\n 'reqFrom' => $userData['Id'],\n 'reqTo' => $localUserData['Id'],\n 'requestedName' => $userData['name'],\n 'message' => 'Reject chips : '.$post['balance'].'.Code :'.$transferCode,\n 'date' => $this->getAppService()->getDateTime()\n );\n $this->getNotificationModel()->createNotification($notificationData);\n \n $response['status'] = 'success';\n $response['message'] = 'Transfer code send successfully.';\n $response['bal'] = $userData['avaiTransBal'];\n \n } catch (\\Exception $e) {\n $response['status'] = 'error';\n $response['message'] = 'Something went wrong : Please try agaign.';\n }\n \n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User does not have efficient balance.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User account deactivated by Admin.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User not available.';\n }\n } else {\n //Get Local user details By PhoneNo\n $localUserData = $this->getUserModel()->getUserByPhoneNo($post['phoneNo']);\n //Transfer credit Balance\n if ($userData['avaiTransBal'] >= $post['balance']) {\n if (count($localUserData) > 0) {\n if ($localUserData['accountStatus'] == 'Active') {\n \n //START TRANSACTION\n $em = $this->getController()->getServiceLocator()->get('doctrine.entitymanager.orm_default');\n try {\n $em->getConnection()->beginTransaction();\n \n //check date records exist if not then create new if Yes then use Id\n $getTicketDate = $this->getTicketDateModel()->getTicketDate($userData['Id'],$currentDate);\n\n if (count($getTicketDate) == 0) {\n //create Date Records\n $dateData = array (\n 'userId' => $userData['Id'],\n 'drawDate' => $currentDate,\n 'openingBal' => $userData['avaiTransBal'],\n );\n\n $getDateEntity = $this->getTicketDateModel()->createTicketDate($dateData);\n $dateId = $getDateEntity->Id;\n } else {\n $dateId = $getTicketDate['Id'];\n }\n \n if ($localUserData['userRoll'] == 'local') {\n $localUser = array (\n 'avaiPurchaseBal' => $post['balance'],\n 'totalWinBal' => 0,\n );\n //Update Local user balance.\n $this->getUserModel()->updateUserBal($localUserData['Id'],$localUser);\n \n $notificationData = array (\n 'reqFrom' => $userData['Id'],\n 'reqTo' => $localUserData['Id'],\n 'requestedName' => $userData['name'],\n 'message' => 'Receive chips : '.$post['balance'],\n 'date' => $this->getAppService()->getDateTime()\n ); \n //set notification message\n $this->getNotificationModel()->createNotification($notificationData);\n } else {\n //check date records exist if not then create new if Yes then use Id\n $getLocalTicketDate = $this->getTicketDateModel()->getTicketDate($localUserData['Id'],$currentDate);\n \n if (count($getLocalTicketDate) == 0) {\n //create Date Records\n $dateData = array (\n 'userId' => $localUserData['Id'],\n 'drawDate' => $currentDate,\n 'openingBal' => $localUserData['avaiTransBal'],\n );\n\n $getLocalDateEntity = $this->getTicketDateModel()->createTicketDate($dateData);\n $localDateId = $getLocalDateEntity->Id;\n } else {\n $localDateId = $getLocalTicketDate['Id'];\n }\n $localUser = array (\n 'avaiTransBal' => $localUserData['avaiTransBal'] + $post['balance'],\n );\n //Update Local user balance.\n $this->getUserModel()->updateUser($localUserData['Id'],$localUser);\n \n $transactionData = array (\n 'dateId' => $localDateId,\n 'userId' => $userData['Id'],\n 'agentId' => $localUserData['Id'],\n 'transBalance' => $post['balance'],\n 'transType' => 'Debit',\n 'time' => $this->getAppService()->getTime()\n );\n //create Transaction report\n $this->getTransactionModel()->createTransaction($transactionData);\n }\n \n $agentUser = array (\n 'avaiTransBal' => $userData['avaiTransBal'] - $post['balance'],\n );\n //Update Agent user balance.\n $this->getUserModel()->updateUser($userData['Id'],$agentUser);\n \n $transactionData = array (\n 'dateId' => $dateId,\n 'userId' => $localUserData['Id'],\n 'agentId' => $userData['Id'],\n 'transBalance' => $post['balance'],\n 'transType' => 'Credit',\n 'time' => $this->getAppService()->getTime()\n );\n //create Transaction report\n $this->getTransactionModel()->createTransaction($transactionData);\n \n $response['status'] = 'success';\n $response['message'] = 'Chips transfer successfully.';\n $response['bal'] = $userData['avaiTransBal'] - $post['balance'];\n\n $em->getConnection()->commit();\n } catch (\\Exception $e) {\n $em->getConnection()->rollback();\n $response['status'] = 'error';\n $response['message'] = $e->getMessage();//'Internal Error. Please try agaign.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User account deactivated by Admin.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = $post['phoneNo'].': User not available.';\n }\n } else {\n $response['status'] = 'error';\n $response['message'] = 'you do have not efficient balance.';\n }\n }\n return $response;\n }", "function directPayment()\n\t{\n\t\tglobal $eWAYCustomerID,\n\t\t\t\t$eWayTotalAmount,\n\t\t\t\t$ewayCustomerFirstName,\n\t\t\t\t$ewayCustomerLastName,\n\t\t\t\t$ewayCustomerEmail,\n\t\t\t\t$ewayCustomerAddress,\n\t\t\t\t$ewayCustomerPostcode,\n\t\t\t\t$ewayCustomerInvoiceDescription,\n\t\t\t\t$ewayCustomerInvoiceRef,\n\t\t\t\t$ewayCardHoldersName,\n\t\t\t\t$ewayCardNumber,\n\t\t\t\t$ewayCardExpiryMonth,\n\t\t\t\t$ewayCardExpiryYear,\n\t\t\t\t$ewayCVN,\n\t\t\t\t$ewayTrxnNumber,\n\t\t\t\t$ewayOption1,\n\t\t\t\t$ewayOption2,\n\t\t\t\t$ewayOption3,\n\t\t\t\t$directPaymentUrl,\n\t\t\t\t$eWaySOAPActionURL;\n\t\t\t\t$testUrl = \"https://www.eway.com.au/gateway_cvn/xmltest/testpage.asp\";\n\t\t\t\t$liveUrl = \"https://www.eway.com.au/gateway_cvn/xmlpayment.asp\";\n\t\t\t\t$eWaySOAPActionURL = \"https://www.eway.com.au/gateway/managedpayment\";\n\t\t\t\t$eWayCustomerId = \"91901390\"; /* test account */\n\t\t\t\t$eWayTotalAmount = 100; /* 1$ = 100 cent */\n\t\t\t\t$directXML = \"<ewaygateway>\".\n\t\t\t\t\"<ewayCustomerID>\".$eWAYCustomerID.\"</ewayCustomerID>\".\n\t\t\t\t\"<ewayTotalAmount>\".$eWayTotalAmount.\"</ewayTotalAmount>\".\n\t\t\t\t\"<ewayCustomerFirstName>\".$ewayCustomerFirstName.\"</ewayCustomerFirstName>\".\n\t\t\t\t\"<ewayCustomerLastName>\".$ewayCustomerLastName.\"</ewayCustomerLastName>\".\n\t\t\t\t\"<ewayCustomerEmail>\".$ewayCustomerEmail.\"</ewayCustomerEmail>\".\n\t\t\t\t\"<ewayCustomerAddress>\".$ewayCustomerAddress.\"</ewayCustomerAddress>\".\n\t\t\t\t\"<ewayCustomerPostcode>\".$ewayCustomerPostcode.\"</ewayCustomerPostcode>\".\n\t\t\t\t\"<ewayCustomerInvoiceDescription>\".$ewayCustomerInvoiceDescription.\"</ewayCustomerInvoiceDescription>\".\n\t\t\t\t\"<ewayCustomerInvoiceRef>\".$ewayCustomerInvoiceRef.\"</ewayCustomerInvoiceRef>\".\n\t\t\t\t\"<ewayCardHoldersName>\".$ewayCardHoldersName.\"</ewayCardHoldersName>\".\n\t\t\t\t\"<ewayCardNumber>\".$ewayCardNumber.\"</ewayCardNumber>\".\n\t\t\t\t\"<ewayCardExpiryMonth>\".$ewayCardExpiryMonth.\"</ewayCardExpiryMonth>\".\n\t\t\t\t\"<ewayCardExpiryYear>\".$ewayCardExpiryYear.\"</ewayCardExpiryYear>\".\n\t\t\t\t\"<ewayCVN>\".$ewayCVN.\"</ewayCVN>\".\n\t\t\t\t\"<ewayTrxnNumber>\".$ewayTrxnNumber.\"</ewayTrxnNumber>\".\n\t\t\t\t\"<ewayOption1>\".$ewayOption1.\"</ewayOption1>\".\n\t\t\t\t\"<ewayOption2>\".$ewayOption2.\"</ewayOption2>\".\n\t\t\t\t\"<ewayOption3>\".$ewayOption3.\"</ewayOption3>\".\n\t\t\t\"</ewaygateway>\";\n\t\t\t //echo $directXML;\n\t\t\t //exit;\n\t\t\t\t$result = $this->makeCurlCall($testUrl, /* CURL URL */\"POST\", /* CURL CALL METHOD */\n\t\t\t\tarray( /* CURL HEADERS */\n\t\t\t\t\t\"Content-Type: text/xml; charset=utf-8\",\n\t\t\t\t\t\"Accept: text/xml\",\n\t\t\t\t\t\"Pragma: no-cache\",\n\t\t\t\t\t\"SOAPAction: \".$eWaySOAPActionURL,\n\t\t\t\t\t\"Content_length: \".strlen(trim($directXML))\n\t\t\t\t),\n\t\t\t\tnull, /* CURL GET PARAMETERS */\n\t\t\t\t$directXML /* CURL POST PARAMETERS AS XML */\n\t\t\t);\n\t\t\tif($result != null && isset($result[\"response\"])) {//$response = new SimpleXMLElement($result[\"response\"]);\n\t\t\t // $response = simpleXMLToArray($response);\n\t\t\t $result\t\t\t\t=\t$result[\"response\"];\n\t\t\t // exit;\n\t\t\t $ewayTrxnStatus\t\t=\t$this->getTextBetweenTags($result,'ewayTrxnStatus');\n\t\t\t if($ewayTrxnStatus)\n\t\t\t {\n\t\t\t\t\t$ewayTrxnNumber\t=\t $this->getTextBetweenTags($result,'ewayTrxnNumber');\n\t\t\t\t\t$ewayAuthCode\t=\t $this->getTextBetweenTags($result,'ewayAuthCode');\n\t\t\t\t\treturn array(\n\t\t\t\t\t\t\t\t\t\"ewayTrxnStatus\"=>$ewayTrxnStatus,\n\t\t\t\t\t\t\t\t\t\"ewayTrxnNumber\"=>$ewayTrxnNumber,\n\t\t\t\t\t\t\t\t\t\"ewayAuthCode\"=>$ewayAuthCode\n\t\t\t\t\t\t\t\t);\n\t\t\t }\n\t\t\t else\n\t\t\t {\n\t\t\t\t return 'error: Account creation fail';\n\t\t\t }\n\t\t\t}\n\t\t\tdie(\"\");\n\t}", "private function formFeeSuccessBmda ($irrigation_payment) {\n if ($irrigation_payment->payment_type_id == 1) {\n $FarSchApplication = FarmerSchemeApplication::find($irrigation_payment->far_application_id);\n $FarSchApplication->payment_status = 1;\n $FarSchApplication->save();\n }\n }", "public function bluepay_oneoff_payment($params)\n\t{\n\t\t$this->_api_method = 'SALE';\n\t\t$this->_request = $this->_build_request($params);\t\t\t\n\t\treturn $this->_handle_query();\n\t}", "public function withdrawRequestProcess($balanceType, $requestAmount, $account)\n{\n\t// return $balanceType;\n\t$availableBalance = Account::where('user_id', Auth::id())->first();\n\t$wbBalance = $availableBalance->balance - ( $requestAmount * .05 ); // Balance after deduct charge 5% of withdrawal request amount\n\t$roiBalance = $availableBalance->roi_balance - ( $requestAmount * .05 );\n\t$deductBalance = ( $requestAmount + $requestAmount * .05 );\n\n\t\t\n\n\n\t\tif( $balanceType == 1 )\n\t\t{\n\t\t\tif( $requestAmount > $wbBalance )\n\t\t\t\t{\n\t\t\t\t\treturn redirect()->back()->with('message', 'Insufficient Balance');\n\t\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$tnx_id = 'wwr_'.rand(1,99999999);\n\t\t\t\tWithdrawal::insert([\n\t\t\t\t\t'amount' \t\t=> $requestAmount,\n\t\t\t\t\t'wdrl_chrg'\t\t=> ($requestAmount * .05),\n\t\t\t\t\t'amount_type' \t=> $balanceType,\n\t\t\t\t\t'request_date'\t=> Carbon::now(),\n\t\t\t\t\t'user_id'\t\t=> Auth::id(),\n\t\t\t\t\t'withdraw_to' => $account,\n\t\t\t\t\t'tnx_id'\t\t=> $tnx_id\n\t\t\t\t\t]);\n\n\t\t\t\t Account::where('user_id', Auth::id())\n\t\t\t\t ->decrement('balance', $deductBalance);\n\n\t\t\t\t Transaction::insert(\n\t\t\t\t\t[\n\t\t\t\t\t'tnx_id' => $tnx_id,\n\t\t\t\t\t'amount' => $requestAmount+($requestAmount*.05),\n\t\t\t\t\t'sign' => '-',\n\t\t\t\t\t'purpose' => 2,\n\t\t\t\t\t// 'proce_fee'=> ($requestAmount*.05),\n\t\t\t\t\t'date' => Carbon::now(), \n\t\t\t\t\t'user_id' => Auth::user()->id,\n\t\t\t\t\t// 'related_id' =>22\n\t\t\t\t\t]);\t\n\n\t\t\t\t\treturn redirect()->back()->with('smessage', 'Your withdrawal request submitted. Please allow us 24 hours to process your request.');\t\t\n\t\t\t};\n\t\t}\n\t\telse\n\t\t{\t\n\n\t\t\tif( $requestAmount > $roiBalance )\n\t\t\t\t{\n\t\t\t\t\treturn redirect()->back()->with('message', 'Insufficient balance.');\n\n\t\t\t\t}\n\t\t\telse{\n\n\t\t\t\t$tnx_id = 'rwr_'.rand(1,99999999);\n\n\t\t\t\tWithdrawal::insert([\n\t\t\t\t\t'amount' \t\t=> $requestAmount,\n\t\t\t\t\t'wdrl_chrg'\t\t=> ($requestAmount * .05),\n\t\t\t\t\t'amount_type' \t=> $balanceType,\n\t\t\t\t\t'request_date'\t=> Carbon::now(),\n\t\t\t\t\t// 'response_date' => 0\n\t\t\t\t\t'user_id'\t\t=> Auth::id(),\n\t\t\t\t\t// 'status'\t\t=> 0\n\t\t\t\t\t'withdraw_to' => $account,\n\t\t\t\t\t'tnx_id'\t\t=> $tnx_id\n\t\t\t\t\t]);\n\n\t\t\t\t Account::where('user_id', Auth::id())\n\t\t\t\t ->decrement('roi_balance', $deductBalance);\n\n\t\t\t\t Transaction::insert(\n\t\t\t\t\t[\n\t\t\t\t\t'tnx_id' => $tnx_id,\n\t\t\t\t\t'amount' => $requestAmount+($requestAmount * .05),\n\t\t\t\t\t'sign' => '-',\n\t\t\t\t\t'purpose' => 15,\n\t\t\t\t\t// 'proce_fee'=> ($requestAmount*.05),\n\t\t\t\t\t'date' => Carbon::now(), \n\t\t\t\t\t'user_id' => Auth::user()->id,\n\t\t\t\t\t// 'related_id' =>22\n\t\t\t\t\t]);\n\n\t\t\t\t\treturn redirect()->back()->with('smessage', 'Your withdrawal request submitted. Please allow us 24 hours to process your request.');\t\t\t\t \n\t\t\t\t\t\n\t\t\t};\n\n\t\t}\n\n\n\n}", "public function makePayment(Request $request){\n //iniatilize constants\n $email = $request->p_email;\n $amount = $request->amount;\n $password = $request->p_password;\n $getter = User::where('email', 'awazoneinfo@gmail.com')->get();\n\n //check the users balance\n $check = User::where('email', $email)->where('password', $password)->get();\n if(count($check)< 1){\n\n return response( ['message' => 'User not found'], 404);\n\n }else{\n //subtract the amount from users balance\n //check balance\n if(($check[0]->balance) >= $amount){\n $subtract = $check[0]->balance - $amount;\n User::where('email', $email)->update(['balance'=> $subtract]);\n \n //input into transaction history\n $transaction = new TransactionsHistory;\n\n $transaction->amount = $amount;\n $transaction->description = \"Awazone.net Payment \";\n $transaction->time = now();\n $transaction->user_id = $check[0]->id;\n\n $saved = $transaction->save();\n\n if($saved){\n //add payment to awazone\n $add = $getter[0]->balance + $amount;\n User::where('email', 'awazoneinfo@gmail.com')->update(['balance' => $add]);\n $receiver = new TransactionsHistory;\n $receiver->amount = $amount;\n $receiver->description = $check[0]->username.\" Payment from Awazone\";\n $receiver->time = now();\n $receiver->user_id = $getter[0]->id;\n $save = $receiver -> save();\n if($save){\n return response(['message'=> 'Payment made Successfully', 'status'=> 'ok'], 200);\n }else{\n return response(['message' => 'An error occur'], 417);\n }\n \n }else{\n return response(['message' => 'An error occur'], 501);\n }\n\n\n }else{\n return response(['message'=> 'Insufficient Balance'], 402);\n }\n \n }\n }", "public function getFee(): float;", "public function postBankDeposit(Request $request) {\n $validator = \\Validator::make($request->all(), \\Solunes\\Payments\\App\\OnlineBankDeposit::$rules_send);\n $sale_payment_id = $request->input('sale_payment_id');\n if(!$validator->passes()){\n return redirect($this->prev)->with('message_error', 'Debe llenar todos los campos obligatorios.')->withErrors($validator)->withInput();\n } else {\n $sale_payment = \\Solunes\\Sales\\App\\SalePayment::find($sale_payment_id);\n $sale = $sale_payment->sale;\n if($sale_payment->status=='holding'&&$sale = \\Solunes\\Sales\\App\\Sale::findId($sale_payment->parent_id)->checkOwner()->first()){\n $cancel_url = url('');\n $transaction = \\BankDeposit::generateSalePayment($sale_payment->payment, $cancel_url);\n if($sale_payment->online_bank_deposit){\n $online_bank_deposit = $sale_payment->online_bank_deposit;\n } else {\n $online_bank_deposit = new \\Solunes\\Payments\\App\\OnlineBankDeposit;\n $online_bank_deposit->sale_payment_id = $sale_payment->id;\n $online_bank_deposit->status = 'holding';\n }\n $online_bank_deposit->parent_id = $request->input('online_bank_id');\n $online_bank_deposit->transaction_id = $transaction->id;\n $online_bank_deposit->file = \\Asset::upload_file($request->file('file'), 'online-bank-deposit-file');\n $online_bank_deposit->save();\n if(config('payments.cash_params.redirect')&&config('payments.cash_params.redirect_url')){\n if(config('payments.notify_agency_on_payment')&&$sale->agency){\n \\FuncNode::make_email('verify-payment', [$sale->agency->email], []);\n }\n return redirect(config('payments.cash_params.redirect_url'))->with('message_success', 'Su pago fue recibido, deberá ser confirmado en las próximas horas y le enviaremos un email confirmando la recepción del pago. ¡Muchas gracias!');\n } else {\n return redirect($this->prev)->with('message_success', 'Su pago fue recibido, deberá ser confirmado en las próximas horas y le enviaremos un email confirmando la recepción del pago. ¡Muchas gracias!');\n }\n } else {\n return redirect($this->prev)->with('message_error', 'Hubo un error al encontrar su pago.');\n }\n }\n }", "function charge_v1_vtdirect_payment( $order_id )\n {\n global $woocommerce;\n $order_items = array();\n\n // Check token id\n if( $_POST['veritrans_token_id'] == '' ) {\n throw new Exception( __('Invalid Token ID', 'woocommerce') );\n }\n\n $endpoint_url = 'https://payments.veritrans.co.id/vtdirect/v1/charges';\n $server_key = $this->server_key;\n $server_key = base64_encode($server_key . ':');\n $token_id = $_POST['veritrans_token_id'];\n\n $order = new WC_Order( $order_id );\n \n $shipping_address = array();\n $billing_address = array();\n\n // Order Items\n if( sizeof( $order->get_items() ) > 0 ) {\n foreach( $order->get_items() as $item ) {\n $order_items[] = array(\n 'id' => $item['product_id'],\n 'name' => substr($item['name'], 0, 20),\n 'qty' => $item['qty'] / 1,\n 'price' => ceil( $order->get_item_subtotal( $item, false ) )\n );\n }\n }\n\n // Shipping Fee\n if( $order->get_total_shipping() > 0 ) {\n $order_items[] = array(\n 'id' => 'shippingfee',\n 'name' => 'Shipping Fee',\n 'qty' => 1,\n 'price' => ceil( $order->get_total_shipping() )\n );\n }\n\n // Tax\n if( $order->get_total_tax() > 0 ) {\n $order_items[] = array(\n 'id' => 'taxfee',\n 'name' => 'Tax',\n 'qty' => 1,\n 'price' => ceil($order->get_total_tax())\n );\n }\n\n // Fees\n if ( sizeof( $order->get_fees() ) > 0 ) {\n $fee_counter = 0;\n foreach ( $order->get_fees() as $item ) {\n $fee_counter++;\n $order_items[] = array(\n 'id' => 'feeitem' . $fee_counter,\n 'name' => 'Fee Item ' . $fee_counter,\n 'qty' => 1,\n 'price' => ceil( $item['line_total'] )\n );\n }\n }\n\n // Shipping Address\n $shipping_address['first_name'] = $order->shipping_first_name;\n $shipping_address['last_name'] = $order->shipping_last_name;\n $shipping_address['address1'] = $order->shipping_address_1;\n $shipping_address['address2'] = $order->shipping_address_2;\n $shipping_address['city'] = $order->shipping_city;\n $shipping_address['postal_code'] = $order->shipping_postcode;\n $shipping_address['phone'] = $order->billing_phone;\n\n // Billing Address\n $billing_address['first_name'] = $order->billing_first_name;\n $billing_address['last_name'] = $order->billing_last_name;\n $billing_address['address1'] = $order->billing_address_1;\n $billing_address['address2'] = $order->billing_address_2;\n $billing_address['city'] = $order->billing_city;\n $billing_address['postal_code'] = $order->billing_postcode;\n $billing_address['phone'] = $order->billing_phone;\n\n // Body that will be send to Veritrans\n $body = array(\n 'token_id' => $token_id,\n 'order_id' => $order_id,\n 'order_items' => $order_items,\n 'gross_amount' => ceil( $order->order_total ),\n 'email' => $order->billing_email,\n 'shipping_address' => $shipping_address,\n 'billing_address' => $billing_address\n );\n\n $headers = array( \n 'Authorization' => 'Basic ' . $server_key,\n 'content-type' => 'application/json'\n ); \n\n $response = wp_remote_post( $endpoint_url, array(\n 'body' => json_encode($body),\n 'headers' => $headers,\n 'timeout' => 20,\n 'sslverify' => false\n ) );\n\n // If wp_remote_post failed\n if( is_wp_error( $response ) ) {\n throw new Exception( $response->get_error_message() );\n }\n\n $response_body = $response['body'];\n $response_body = json_decode( $response_body );\n\n // If response from Veritrans is failure\n if( $response_body->code != 'VD00' ) {\n throw new Exception( $response_body->message );\n }\n \n // Set order as complete\n $order->payment_complete();\n\n // Remove cart\n $woocommerce->cart->empty_cart();\n }", "public function testMessageFeeEmpty()\n {\n $message = new Message();\n // leave $message empty!\n\n $expectFee = 0;\n $actualFee = Fee::calculateForMessage($message);\n\n $this->assertEquals($expectFee, $actualFee);\n }", "function transfer_money(){\n\t\t$user_id=$_REQUEST['user_id'];\n\t\t$mobile=country_code.$_REQUEST['mobile_no'];\n\t\t$amount=$_REQUEST['amount'];\n\t\t$mobile_no=$_REQUEST['mobile_no'];\n\t \n\t\t\n\t\t//$transaction_id= mt_rand( 10000000, 99999999);\n\t\t$wallet_type_main=2;// amount debit in user self\n\t\t$wallet_type_frnd=1;// amount credit in frnd\n\t\t$wallet_category_to=5;// transfer money to\n\t\t$wallet_category_from=10;// transfer money from\n\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\tif(!empty($mobile)){\n\t\t\t$user_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\tif(!empty($user_records)){\n\t\t\t$main_wallet=$user_records['0']['wallet_amount'];\n\t\t\t$contact_number_main=substr($user_records['0']['user_contact_no'],4); // main user mobile number\n\t\t\tif($main_wallet>=$amount){\n\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_contact_no', $mobile);\n\t\t\t\tif(!empty($records)){\n\t\t\t\t$contact_number_frnd=substr($records['0']['user_contact_no'],4); // frnd mobile number\n\t\t\t\t$frnd_wallet=$records['0']['wallet_amount']; \n\t\t\t\t$frnd_id=$records['0']['user_id'];\n\t\t\t\tif($frnd_id !=$user_id){\n\t\t\t\t\t// amount transfer to another\n\t\t\t$transaction_id1= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t$w_to_desc=\"Amount transfer to \".$contact_number_frnd;\n\t\t\t\t\t\t$wallet_to_transfer = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_to . '\",\"' .$transaction_id1 . '\",\"' . $w_to_desc . '\",\"' . $contact_number_frnd . '\"');\n\t\t\t\t\t\tif(!empty($wallet_to_transfer)){\n\t\t\t\t\t\t\t//amount recieved by transfer\n\t\t\t\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t$w_by_desc=\"Amount transfer from \".$contact_number_main;\n\t\t\t\t\t\t$wallet_by_transfer = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $frnd_id . '\",\"' . $current_date . '\",\"' . $wallet_type_main . '\",\"' . $amount . '\",\"' . $wallet_category_from . '\",\"' .$transaction_id . '\",\"' . $w_by_desc . '\",\"' . $contact_number_main . '\"');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!empty($wallet_by_transfer)){\n\t\t\t\t\t\t\t\t$main_wallet_money=$main_wallet-$amount;\n\t\t\t\t\t\t\t\t$frnd_wallet_money=$frnd_wallet+$amount;\n\t\t\t\t\t\t\t\t// update main user wallet\n\t\t\t\t\t\t\t\t$data['wallet_amount']=$main_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user_id, $data);\n\t\t\t\t\t\t\t\t// update frnd wallet//\n\t\t\t\t\t\t\t\t$data1['wallet_amount']=$frnd_wallet_money;\n\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$frnd_id, $data1);\n\t\t\t\t\t\t\t\t\t$post=array('status'=>'true','message'=>'Transfer money successfully','main_user_id'=>$user_id,'main_wallet'=>$main_wallet_money,'frnd_wallet'=>$frnd_wallet_money,'frnd_id'=>$frnd_id,'transfer_mobile'=>$mobile_no,'transfer_amount'=>$amount,'transaction_id'=>$transaction_id1,'transfer_date'=>$current_date);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Error in transfering amount\");\n\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Please enter another user number\");\n\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"This user is not exist of given number\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Wallet amount is not sufficent to transfer money\");\n\t\t\t}\n\t\t\t}else{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"invalid user\",'user_id'=>$user_id);\n\t\t}\n\t\t\t\n\t\t}else{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"missing parameter\",'user_id'=>$user_id,'amount'=>$amount,'mobile'=>$moble);\n\t\t}\necho $this -> json($post);\n\t}", "public function get_translation_fee()\n {\n $this->load->model('cases_model', 'cases');\n $this->load->model('currencies_model', 'currencies');\n $this->load->model('estimates_model', 'estimates');\n $case_number = $this->input->post('case_number');\n $number_words = $this->input->post('number_words');\n $country_id = $this->input->post('country_id');\n $translation_rate = $this->input->post('translation_rate');\n $estimate_fee_level = $this->input->post('estimate_fee_level');\n $estimate_currency = $this->input->post('estimate_currency');\n $translation_fee = 0;\n $currency_sign = '$';\n if (!is_null($case = $this->cases->find_case_by_number($case_number))) {\n $estimate_countries = $this->estimates->get_estimate_countries($case['id'], $case['user_id'], $estimate_fee_level);\n if (!is_null($customer_fees = $this->estimates->get_customer_fees_by_countries($case['user_id'], $case['case_type_id'], $case['case_number'], $estimate_countries, $case['entity']))) {\n $translation_fee = ceil($translation_rate * $number_words + $customer_fees[$country_id]['translation_rates_for_claims'] * $case['number_words_in_claims']);\n\n if ($estimate_currency == 'euro') {\n $currency_sign = '€';\n $euro_exchange_rate = $this->currencies->get_currency_rate_by_code('EUR');\n\n $translation_fee = ceil($translation_fee / $euro_exchange_rate);\n }\n }\n }\n echo $currency_sign . $translation_fee;\n }", "public function paidInFull()\n {\n $payment = $this->getPayment(1);\n\n return $payment && $payment->total == $this->getTotal();\n }", "public function markAsExpressShipping(Order $draftOrder): bool;", "function handleChannelFeesForTenantERP(\n $tid, $created, $serialnumber, $paymentmethod_id, $amount\n ) {\n debug_print(\"Entry: handleChannelFeesForTenantERP ( tid = $tid )\");\n\n debug_print(\"Creating debtor transaction record\");\n\n $paymentmethod = loadPaymentMethod($paymentmethod_id);\n if ($paymentmethod === false)\n return false;\n\n $meter = loadMeterInformation($serialnumber);\n if ($meter === false)\n return false;\n\n $account = loadAccount($meter['account_id']);\n if ($account === false)\n return false;\n\n $branch = loadCustomerBranch($account['customerbranch_id']);\n if ($branch === false)\n return false;\n\n $branchcode = $branch['code'];\n $new_date = date('Y-m-d', strtotime($created));\n $period_id = fgetPeriod_id($new_date, __FILE__, __LINE__);\n $reference = substr($paymentmethod['code'], 0, 7) . ' ' . $tid;\n $salesorder_id = 0;\n $gst = 0.00;\n $freight = 0.00;\n $rate = 1.00;\n $invtext = '';\n $settled = 0;\n $discount = 0;\n $invtext = 'ReceivedMeter:' . $serialnumber . '(' . $branchcode . ')';\n $invtextevent = 'Received';\n $invtextserialnumber = $serialnumber;\n $invtextbranchcode = $branchcode;\n $meter_id = $meter['meter_id'];\n $posted = 1;\n\n $dtid = insertDebtorTrans(\n $tid, $paymentmethod['transactiontype_id'], $account['customerbranch_id'], $created, $period_id, $reference, $salesorder_id, $amount, $gst, $freight, $rate, $invtext, $settled, $discount, $invtextevent, $invtextserialnumber, $invtextbranchcode, $meter_id\n );\n\n\n $dtid = insertDebtorTrans(\n $tid, $paymentmethod['transactiontype_id'], $paymentmethod['customerbranch_id'], $created, $period_id, $reference, $salesorder_id, (-$amount), $gst, $freight, $rate, $invtext, $settled, $discount, $invtextevent, $invtextserialnumber, $invtextbranchcode, $meter_id\n );\n\n // Line to be invoiced\n $dtid = insertDebtorTrans(\n $tid, 4, $paymentmethod['customerbranch_id'], $created, $period_id, $reference, $salesorder_id, $amount, $gst, $freight, $rate, $invtext, $settled, $discount, $invtextevent, $invtextserialnumber, $invtextbranchcode, $meter_id\n );\n\n\n debug_print(\"Creating GL transaction records\");\n\n $vatapplicable_id = 5;\n\n if (doesGlExist($paymentmethod['erpglaccountcredit']) &&\n doesGlExist($paymentmethod['erpglaccountdebit'])) {\n $rc = insertGLTrans(\n $paymentmethod['transactiontype_id'], $tid, $new_date, $period_id, $invtext, $posted, $vatapplicable_id, $postings = array(\n array($paymentmethod['erpglaccountcredit'] => $amount),\n array($paymentmethod['erpglaccountcredit'] => -$amount)\n )\n );\n }\n\n\n debug_print(\"Returning transaction id $tid\");\n debug_print(\"Exit: handleChannelFeesForTenantERP\");\n return $tid;\n }", "public function getReceivedByAddress($bitcoinaddress, $minconf = 1);", "public function paystackCallbackURL(Request $request)\n {\n $reference = $request->get('reference');\n $paymentDetails = $this->paystackVerifyPayment($reference);\n if ($paymentDetails['status']===true) {\n $amount_paid= $paymentDetails['data']['amount'] / 100;\n\n try{\n\n DB::beginTransaction();\n //Create the record in the deposit table for the user\n $deposit = Deposit::create([\n 'amount'=> $amount_paid,\n 'user_id'=>auth()->id(),\n 'paystack_reference'=>$paymentDetails['data']['reference']\n ]);\n\n //Create the record on the transactions table with the Deposit Model\n $deposit->transactions()->create([\n 'user_id'=>auth()->id(),\n 'type'=>'+',\n 'amount'=>$amount_paid\n ]);\n\n //Check if the user already have a wallet, if yes update the balance column, if no, create a Wallet record for the user\n $user= auth()->user();\n $wallet= $user->wallet;\n $wallet==null ?\n $balance= $amount_paid : $balance= $wallet->balance + $amount_paid;\n Wallet::updateOrCreate(\n ['user_id' => auth()->user()->id],\n ['balance' =>$balance]\n );\n DB::commit();\n\n //Send Email to the user and queue it\n mail::to($user->email)->queue(new DepositWasSuccessful($deposit));\n return new DepositResource($deposit);\n\n }catch(\\Throwable $e){\n DB::rollBack();\n return response()->json([\n 'status'=>false,\n 'message'=> 'Ops, something went wrong, your balance will be updated very soon'.$e->getMessage()\n ], 400);\n\n }\n\n }else{\n\n return response()->json([\n 'status'=>false,\n 'message'=>'Fund deposit was not completed'\n ], 400);\n }\n\n\n }", "public static function update_stripe_fee( $order = null, $amount = 0.0 ) {\n\t\tif ( is_null( $order ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();\n\n\t\tWC_Stripe_Helper::is_wc_lt( '3.0' ) ? update_post_meta( $order_id, self::META_NAME_FEE, $amount ) : $order->update_meta_data( self::META_NAME_FEE, $amount );\n\t}", "function sendPaymentProof(Transaction $transaction,$payment_proof_url)\n {\n $transaction->payment_url = $payment_proof_url;\n $this->transactionRepo->save($transaction);\n //if the last status is not \"need checking\", change it\n $transactionStatus = $this->transactionStatusRepo->findByTransactionMostRecent($transaction);\n if (!$transactionStatus->isNeedChecking()){\n $transactionStatus = $this->addStatus($transaction,TransactionStatus::STATUS_NEED_CHECKING,null);\n }\n return $transactionStatus;\n }", "public function estimateFeeFromAccount($priority, $payment_address_id, $destination, $quantity, $asset, $account='default', $unconfirmed=false, $dust_size=null) {\n $body = [\n 'destination' => $destination,\n 'quantity' => $quantity,\n 'asset' => $asset,\n 'sweep' => false,\n 'unconfirmed' => $unconfirmed,\n 'account' => $account,\n ];\n if ($dust_size !== null) { $body['dust_size'] = $dust_size; }\n\n $result = $this->newAPIRequest('POST', '/estimatefee/'.$payment_address_id, $body);\n if (isset($result['fees'][$priority])) {\n return new Quantity($result['fees'][$priority.'Sat']);\n }\n\n return new Quantity(intval($priority) * $result['size']);\n }", "function withdrawal($account, $amount, $id_user) {\r\n\r\n //Crear la conexión\r\n $base = conection();\r\n\r\n //Verificar que el usuario tenga disponible ese dinero\r\n $sql = \"SELECT balance, pending FROM users WHERE id = :id_user\";\r\n\r\n //Preparar consulta\r\n $result = $base->prepare($sql);\r\n\r\n //Ejecutar consulta\r\n $result->execute(array(\":id_user\"=>$id_user));\r\n\r\n //Contar registros encontrados\r\n $count = $result->rowCount();\r\n \r\n //Verificar si se ingresó el registro\r\n if ($count > 0) {\r\n\r\n while ($row=$result->fetch(PDO::FETCH_ASSOC)) {\r\n $balance = $row[\"balance\"];\r\n $pending = $row[\"pending\"];\r\n }\r\n\r\n if ($balance >= $amount) {\r\n\r\n //Restamos el dienro al usuario\r\n $new_balance = $balance - $amount;\r\n $new_pending = $pending + $amount;\r\n \r\n //Actualizamos el balance del usuario y agregamos el dinero pendiente\r\n $sql_new_balance = \"UPDATE `users` SET `balance`= :balance, `pending`= :pending WHERE id = :id_user\";\r\n\r\n //Preparar consulta\r\n $result_new_balance = $base->prepare($sql_new_balance);\r\n\r\n //Ejecutar consulta\r\n $result_new_balance->execute(array(\":balance\"=>$new_balance, \":pending\"=>$new_pending, \":id_user\"=>$id_user));\r\n\r\n //Actualizamos el balance del usuario y agregamos el dinero pendiente\r\n $sql_withdrawal = \"INSERT INTO `withdrawal`(`account`, `amount`, `date`, `id_user`) VALUES (:account, :amount , NOW(), :id_user)\";\r\n\r\n //Preparar consulta\r\n $result_withdrawal = $base->prepare($sql_withdrawal);\r\n\r\n //Ejecutar consulta\r\n $result_withdrawal->execute(array(\":account\"=>$account, \":amount\"=>$amount, \":id_user\"=>$id_user));\r\n\r\n $count_withdrawal = $result_withdrawal->rowCount();\r\n\r\n if ($count_withdrawal > 0) {\r\n\r\n //Enviar email\r\n $msg = \"The user with the id $id_user has requested a withdrawal in the amount of $amount for their Payeer account $account\";\r\n \r\n mail(\"medinahildegar1@gmail.com\", \"New Withdrawal request - $id_user\", $msg);\r\n\r\n return \"<b>Your withdrawal request has been sent</b>\\nIn less than 24 hours your order will be processed\";\r\n }\r\n\r\n }else {\r\n return \"You don't have enough funds\";\r\n }\r\n \r\n }else {\r\n return \"fatal error 3\";\r\n }\r\n\r\n}", "function payment($userid = 0, $invoiceid = 0, $invoicetype = 'subscription', $amount = 0, $method = 'account', $gateway = '', $gatewaytxn = '', $isrefund = false, $originalgatewaytxn = '', $silentmode = false)\n {\n global $ilance, $show, $phrase, $page_title, $area_title, $ilconfig, $ilpage;\n\t\t$selectextrafields = '';\n\n ($apihook = $ilance->api('process_debit_payment_start')) ? eval($apihook) : false;\n \n // #### INSTANT PAYMENT NOTIFICATION HANDLER ###########################\n if ($method == 'ipn')\n {\n $sql = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, isenhancementfee, transactionid, projectid\" . $selectextrafields. \"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"',\n paymethod = '\" . $ilance->db->escape_string($gateway) . \"',\n custommessage = '\" . $ilance->db->escape_string($gatewaytxn) . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n if ($res_invoice['isif'] == '1')\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '1' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isenhancementfeepaid', $res_invoice['projectid']) == '0' AND fetch_auction('enhancementfeeinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" , featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n }\n else if ($res_invoice['isenhancementfee'] == '1')\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if (fetch_auction('status', $res_invoice['projectid']) == 'frozen' AND ((fetch_auction('isifpaid', $res_invoice['projectid']) == '1' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) != '0') OR (fetch_auction('isifpaid', $res_invoice['projectid']) == '0' AND fetch_auction('ifinvoiceid', $res_invoice['projectid']) == '0') ))\n {\n $sql_date = '';\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date\n FROM \" . DB_PREFIX . \"projects\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE project_id = '\" . intval($res_invoice['projectid']) . \"'\n \", 0, null, __FILE__, __LINE__);\n \t$ilance->referral->update_referral_action('postauction', $userid);\n \t$cid = fetch_auction('cid', intval($res_invoice['projectid']));\n \t$state = fetch_auction('project_state', intval($res_invoice['projectid']));\n \t$ilance->categories->build_category_count($cid, 'add', \"insert_\" . $state . \"_auction(): adding increment count category id $cid\");\n }\n } \n else if ($res_invoice['isfvf'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['isescrowfee'] == '1')\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n \n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_ipn_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND orderid = '\" . $res_invoice['buynowid'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n $resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC);\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $res_invoice['buynowid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => fetch_user('username', intval($userid)),\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n $ilance->email->send();\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n $ilance->email->mail = fetch_user('email', intval($userid));\n $ilance->email->slng = fetch_user_slng(intval($userid));\n $ilance->email->send();\n return true;\n }\n return false;\n }\n // #### ONLINE ACCOUNT HANDLER #########################################\n else if ($method == 'account')\n {\n $sql_balance = $ilance->db->query(\"\n\t\t\t\tSELECT available_balance, total_balance\n\t\t\t\tFROM \" . DB_PREFIX . \"users\n\t\t\t\tWHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_balance) > 0)\n {\n $res_balance = $ilance->db->fetch_array($sql_balance, DB_ASSOC);\n if ($res_balance['available_balance'] >= $amount)\n {\n $avail_balance = $res_balance['available_balance'];\n $total_balance = $res_balance['total_balance'];\n $avail_balance_after = ($avail_balance - $amount);\n $total_balance_after = ($total_balance - $amount);\n $sql_invoice = $ilance->db->query(\"\n SELECT invoiceid, invoicetype, description, amount, paid, duedate, paiddate, createdate, isif, isfvf, isescrowfee, projectid, buynowid, transactionid, isenhancementfee\" . $selectextrafields .\"\n FROM \" . DB_PREFIX . \"invoices\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND status = 'unpaid'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_invoice) > 0)\n {\n $res_invoice = $ilance->db->fetch_array($sql_invoice, DB_ASSOC);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET paid = '\" . $ilance->db->escape_string($amount) . \"',\n status = 'paid',\n paiddate = '\" . DATETIME24H . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($userid) . \"'\n AND invoicetype = '\" . $ilance->db->escape_string($invoicetype) . \"'\n \", 0, null, __FILE__, __LINE__);\n $res_invoice['paiddate'] = DATETIME24H;\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"users\n SET available_balance = '\" . $ilance->db->escape_string($avail_balance_after) . \"',\n total_balance = '\" . $ilance->db->escape_string($total_balance_after) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($res_invoice['isif'])\n {\n // this is an insertion fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isifpaid = '1'\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isenhancementfeepaid, enhancementfeeinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isenhancementfeepaid'] == '1' AND $res['enhancementfeeinvoiceid'] != '0') OR ($res['isenhancementfeepaid'] == '0' AND $res['enhancementfeeinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE ifinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isenhancementfee'])\n {\n // this is an enhancements fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isenhancementfeepaid = '1'\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $sql = $ilance->db->query(\"\n SELECT date_starts, date_end, featured_date, status, isifpaid, ifinvoiceid, cid, project_state\n FROM \" . DB_PREFIX . \"projects\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $res = $ilance->db->fetch_array($sql, DB_ASSOC);\n if ($res['status'] == 'frozen' AND (($res['isifpaid'] == '1' AND $res['ifinvoiceid'] != '0') OR ($res['isifpaid'] == '0' AND $res['ifinvoiceid'] == '0') ))\n {\n $sql_date = '';\n if (strtotime($res['date_starts']) < strtotime(DATETIME24H))\n {\n $date_starts = strtotime($res['date_starts']);\n $date_end = strtotime($res['date_end']);\n $auction_time = $date_end - $date_starts;\n $date_starts = DATETIME24H;\n $date_end = date(\"Y-m-d H:i:s\", strtotime(DATETIME24H) + $auction_time);\n $sql_date = \" ,date_starts = '\" . $date_starts .\"', date_end = '\" . $date_end .\"'\";\n $sql_date .= ($res['featured_date'] != '0000-00-00 00:00:00') ? \" ,featured_date = '\" . DATETIME24H . \"'\" : \"\";\n }\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET status = 'open'\n $sql_date\n WHERE enhancementfeeinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->referral->update_referral_action('postauction', $userid);\n $ilance->categories->build_category_count($res['cid'], 'add', \"insert_\" . $res['project_state'] . \"_auction(): adding increment count category id \" . $res['cid']);\n }\n }\n if ($res_invoice['isfvf'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects\n SET isfvfpaid = '1'\n WHERE fvfinvoiceid = '\" . intval($invoiceid) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n if ($res_invoice['isescrowfee'])\n {\n // this is a final value fee.. update auction listing table\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfeepaid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND feeinvoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"projects_escrow\n SET isfee2paid = '1'\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n AND fee2invoiceid = '\" . $invoiceid . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n \n ($apihook = $ilance->api('process_debit_payment_account_start')) ? eval($apihook) : false;\n \n // this could also be a payment from the \"seller\" for an unpaid \"buy now\" escrow fee OR unpaid \"buy now\" fvf.\n // let's check the buynow order table to see if we have a matching invoice to update as \"ispaid\"..\n // this scenerio would kick in once a buyer or seller deposits funds, this script runs and tries to pay the unpaid fees automatically..\n // at the same time we need to update the buy now order table so the presentation layer knows what's paid, what's not.\n $buynowcheck = $ilance->db->query(\"\n SELECT orderid, escrowfeeinvoiceid, escrowfeebuyerinvoiceid, fvfinvoiceid, fvfbuyerinvoiceid\n FROM \" . DB_PREFIX . \"buynow_orders\n WHERE project_id = '\" . $res_invoice['projectid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($buynowcheck) > 0)\n {\n while ($resbuynow = $ilance->db->fetch_array($buynowcheck, DB_ASSOC))\n {\n if ($res_invoice['invoiceid'] == $resbuynow['escrowfeeinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeepaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['escrowfeebuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now escrow fee\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isescrowfeebuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfinvoiceid'])\n {\n // invoice being paid is from seller paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else if ($res_invoice['invoiceid'] == $resbuynow['fvfbuyerinvoiceid'])\n {\n // invoice being paid is from buyer paying a buy now fvf\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"buynow_orders\n SET isfvfbuyerpaid = '1'\n WHERE orderid = '\" . $resbuynow['orderid'] . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n }\n }\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $amount), 'credit');\n $ilance->template->templateregistry['customquestions'] = $res_invoice['description'];\n $description = $ilance->template->parse_template_phrases('customquestions');\n $existing = array(\n '{{provider}}' => $_SESSION['ilancedata']['user']['username'],\n '{{invoice_id}}' => intval($invoiceid),\n '{{invoice_amount}}' => $ilance->currency->format($amount),\n '{{duedate}}' => print_date($res_invoice['duedate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{datepaid}}' => print_date($res_invoice['paiddate'], $ilconfig['globalserverlocale_globaltimeformat'], 0, 0),\n '{{description}}' => $description,\n '{{transactionid}}' => $res_invoice['transactionid'],\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('debit_fee_paid_online_account_admin');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n $ilance->email->mail = $_SESSION['ilancedata']['user']['email'];\n $ilance->email->slng = $_SESSION['ilancedata']['user']['slng'];\n $ilance->email->get('debit_fee_paid_online_account');\t\t\n $ilance->email->set($existing);\n if ($silentmode == false)\n {\n $ilance->email->send();\n }\n if ($silentmode)\n {\n return true;\n }\n $area_title = '{_invoice_payment_complete_menu}';\n $page_title = SITE_NAME . ' - {_invoice_payment_complete_menu}';\n print_notice('{_invoice_payment_complete}', '{_your_invoice_has_been_paid_in_full}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n $page_title = SITE_NAME . ' - {_invoice_payment_menu_denied_payment_does_not_belong_to_user}';\n print_notice('{_invoice_error}', '{_were_sorry_this_invoice_does_not_exist}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n else\n {\n if ($silentmode)\n {\n return false;\n }\n $area_title = '{_funds_not_available}';\n $page_title = SITE_NAME . ' - {_funds_not_available}';\n print_notice('{_invoice_payment_warning_insufficient_funds}', '{_were_sorry_this_invoice_can_not_be_paid_due_to_insufficient_funds}'.\"<br /><br />\".'{_please_contact_customer_support}', $ilpage['accounting'], '{_my_account}');\n exit();\n }\n }\n }\n return false;\n }", "public static function get_stripe_fee( $order = null ) {\n\t\tif ( is_null( $order ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$order_id = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? $order->id : $order->get_id();\n\n\t\t$amount = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, self::META_NAME_FEE, true ) : $order->get_meta( self::META_NAME_FEE, true );\n\n\t\t// If not found let's check for legacy name.\n\t\tif ( empty( $amount ) ) {\n\t\t\t$amount = WC_Stripe_Helper::is_wc_lt( '3.0' ) ? get_post_meta( $order_id, self::LEGACY_META_NAME_FEE, true ) : $order->get_meta( self::LEGACY_META_NAME_FEE, true );\n\n\t\t\t// If found update to new name.\n\t\t\tif ( $amount ) {\n\t\t\t\tself::update_stripe_fee( $order, $amount );\n\t\t\t}\n\t\t}\n\n\t\treturn $amount;\n\t}", "protected function makePayment(){\n\t \n $receiver = Input::get('number');\n $amounttosend = Input::get('amount');\n $currency = Input::get('currency');\n $destinationProvider = Input::get('target');\n $charges = new PlatformCharges($amounttosend, $currency, $destinationProvider);\n $desc = $charges->getReceiverType($destinationProvider);\n $user = User::find(Auth::user()->id);\n \n $transaction = [\n 'Customer' => [\n 'FirstName' => Auth::user()->name,\n 'Street1' => 'Level 5',\n 'Country' => 'US',\n 'Mobile' => Auth::user()->number,\n 'Email' => Auth::user()->email\n ],\n 'Items' => [\n [\n 'SKU' => mt_rand(),\n 'Description' => 'Hybrid Transfer from EWAY to '.$desc.' user',\n 'Quantity' => 1,\n 'UnitCost' => $charges->convertCurrency($currency, 'AUD',$charges->getDueAmount('ew', $destinationProvider)),\n 'Tax' => 100, //$1 applied as charge to every transaction irrespective of the amount transfered\n // Total is calculated automatically\n ]\n ],\n 'Options' => [\n [\n 'Value' => $desc,//Receipient's payement system\n ],\n [\n 'Value' => $receiver, //receiver's details to which to make the due transfer\n ],\n [\n 'Value' => 'AUD', // currency used to make the transfer when sending to the receipient\n ],\n [\n 'Value' =>(0.01 * $amounttosend)\n ]\n ],\n 'Payment' => [\n 'TotalAmount' => $charges->convertCurrency($currency, 'AUD',$charges->getDueAmount('ew', $destinationProvider)) * 100, //$amounttosend,\n 'CurrencyCode' => 'AUD'\n ],\n 'Method' => 'ProcessPayment',\n 'RedirectUrl' => URL::route('dashboard').'/ewayconfirm',\n 'CancelUrl' => URL::route('dashboard').'/ewaycancel',\n 'PartnerID' => EwayController::$_EWAY_CUSTOMER_ID,\n 'TransactionType' => \\Eway\\Rapid\\Enum\\TransactionType::PURCHASE, //normally would be PURCHASE. Modes are MOTO, Recurring\n 'Capture' => true,\n 'LogoUrl' => 'https://izepay.iceteck.com/public/images/logo.png',\n 'HeaderText' => 'Izepay Money Transfer',\n 'Language' => 'EN',\n 'CustomView' => 'BootstrapCerulean', //Bootstrap, BootstrapAmelia, BootstrapCerulean, BootstrapCosmo, BootstrapCyborg, BootstrapFlatly, BootstrapJournal, BootstrapReadable, BootstrapSimplex, BootstrapSlate, BootstrapSpacelab, BootstrapUnited\n 'VerifyCustomerEmail' => true,\n 'Capture' => true,\n 'CustomerReadOnly' => false\n ];\n try{\n $response = $this->client->createTransaction(\\Eway\\Rapid\\Enum\\ApiMethod::RESPONSIVE_SHARED, $transaction);\n //var_dump($response);\n// echo $response->SharedPaymentUrl;\n //sleep(20);\n }catch(Exception $ex){\n return Redirect::route('dashboard')\n\t\t\t \t->with('alertError', 'Debug Error: '.$ex->getMessage());\n }\n //manage response\n \n if (!$response->getErrors()) {\n // Redirect to the Responsive Shared Page\n header('Location: '.$response->SharedPaymentUrl);\n //die();\n } else {\n foreach ($response->getErrors() as $error) {\n //echo \"Response Error: \".\\Eway\\Rapid::getMessage($error).\"<br>\";\n return Redirect::route('dashboard')\n\t\t\t \t ->with('alertError', 'Error! '.\\Eway\\Rapid::getMessage($error));\n }\n }\n\t}", "function sendsms_franchise_shipments($invoices='',$d_total=0)\r\n\t{\r\n\t\t\r\n\t\t$sql_trans = \"select inv.invoice_no,a.id,e.franchise_id,a.itemid,group_concat(b.name) as itemname,concat(b.print_name,'-',b.pnh_id) as print_name,i_orgprice,login_mobile1,i_price,i_coup_discount,i_discount,group_concat(a.quantity) as qty,c.menuid,a.transid,f.franchise_id,f.franchise_name\r\n\t\t\t\t\t\t\tfrom king_invoice inv\r\n\t\t\t\t\t\t\tjoin king_orders a on a.id=inv.order_id\r\n\t\t\t\t\t\t\tjoin king_dealitems b on a.itemid = b.id\r\n\t\t\t\t\t\t\tjoin king_deals c on b.dealid = c.dealid \r\n\t\t\t\t\t\t\tjoin pnh_menu d on d.id = c.menuid \r\n\t\t\t\t\t\t\tjoin king_transactions e on e.transid = a.transid\r\n\t\t\t\t\t\t\tjoin pnh_m_franchise_info f on f.franchise_id = e.franchise_id \r\n\t\t\t\t\t\t\twhere inv.invoice_no in ($invoices)\r\n\t\t\t\t\t\t\tgroup by inv.invoice_no\";\r\n\t\t\r\n\t\t$res_trans = $this->db->query($sql_trans);\r\n\t\r\n\t\t$sms_msg = '';\r\n\t\t$datetime = new DateTime('tomorrow');\r\n\t\t\r\n\t\tif($res_trans->num_rows())\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$fran_shipment_sms = array();\r\n\t\t\t$fran_det = array();\r\n\t\t\t\r\n\t\t\tforeach($res_trans->result_array() as $row_trans)\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\tif(!isset($fran_shipment_sms[$row_trans['franchise_id']]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$fran_shipment_sms[$row_trans['franchise_id']] = array();\r\n\t\t\t\t\t$fran_det[$row_trans['franchise_id']] = array($row_trans['franchise_name'],$row_trans['login_mobile1']);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t$fran_shipment_sms[$row_trans['franchise_id']][] = \" invoice no(\".$row_trans['invoice_no'].\") with \".$row_trans['print_name'].\" products and \".$row_trans['qty'].\" qty \";\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tforeach($fran_shipment_sms as $fr_id=>$fr_sms_list)\r\n\t\t\t{\r\n\t\t\t\t$sms_msg=\"Dear \".$row_trans['franchise_name'].\", your \".implode(',',$fr_sms_list).\" is shipped successfully, please expect delivery on \".$datetime->format('d/m/Y');\r\n\t\t\t\t$this->erpm->pnh_sendsms($fran_det[$fr_id][1],$sms_msg,$fr_id,0,12);\t\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// Send Notification to TM about Shipment.\r\n\t\t\r\n\t\t$sql = \"select d.employee_id,e.name,d.territory_id,b.franchise_id,franchise_name,contact_no,group_concat(distinct a.invoice_no order by a.invoice_no) as invoices \r\n\t\t\t\t\t\t\tfrom king_invoice a\r\n\t\t\t\t\t\t\tjoin king_transactions b on a.transid = b.transid \r\n\t\t\t\t\t\t\tjoin pnh_m_franchise_info c on c.franchise_id = b.franchise_id \r\n\t\t\t\t\t\t\tjoin m_town_territory_link d on d.territory_id = c.territory_id and d.town_id = 0\r\n\t\t\t\t\t\t\tjoin m_employee_info e on e.employee_id = d.employee_id and job_title = 4 \r\n\t\t\t\t\t\t\twhere invoice_no in ($invoices) \r\n\t\t\t\t\t\tgroup by employee_id,franchise_id \";\r\n\t\t \r\n\t\t\r\n\t\t$res = $this->db->query($sql);\r\n\t\tif($res->num_rows())\r\n\t\t{\r\n\t\t\t\r\n\t\t\t$emp_sms_det = array();\r\n\t\t\t\r\n\t\t\tforeach($res->result_array() as $row)\r\n\t\t\t{\r\n\t\t\t\t//tm employee id \r\n\t\t\t\t\r\n\t\t\t\tlist($emp_mobno,$emp_mobno2) = explode(',',$row['contact_no']); \r\n\t\t\t\t$invlist = explode(',',$row['invoices']);\r\n\t\t\t\t\r\n\t\t\t\t$invlist = array_filter($invlist);\r\n\t\t\t\t$franid = $row['franchise_id'];\r\n\t\t\t\t\r\n\t\t\t\tif(!count($invlist))\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(!isset($emp_sms_det[$row['employee_id']]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']] = array();\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']]['employee_id'] = $row['employee_id'];\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']]['name'] = $row['name'];\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']]['contact_no'] = $emp_mobno;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'] = array();\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid] = array();\r\n\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid]['fname'] = $row['franchise_name'];\r\n\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid]['trans'] = array();\r\n\t\t\t\t\r\n\t\t\t\tforeach($invlist as $inv)\r\n\t\t\t\t{\r\n\t\t\t\t\t$transid = $this->db->query(\"select transid from king_invoice where invoice_no = ? \",$inv)->row()->transid;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$unshipped_items = @$this->db->query(\"select group_concat(trim(item),' x ',qty) as items from (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tselect a.transid,f.franchise_id,franchise_name,concat(c.print_name,'-',pnh_id) as item,sum(a.quantity) as qty \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfrom king_orders a\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin (\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tselect distinct transid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfrom shipment_batch_process_invoice_link a \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin proforma_invoices b on a.p_invoice_no = b.p_invoice_no \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere invoice_no in (\".$inv.\") \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) as b on a.transid = b.transid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin king_dealitems c on c.id = a.itemid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin king_deals d on d.dealid = c.dealid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin king_transactions e on e.transid = a.transid \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tjoin pnh_m_franchise_info f on f.franchise_id = e.franchise_id \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\twhere a.status = 0 \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgroup by a.transid,a.itemid ) as g\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgroup by franchise_id\")->row()->items;\r\n\t\t\t\t\tif(!isset($emp_sms_det[$row['employee_id']]['fran'][$franid]['trans'][$transid]))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid]['trans'][$transid] = array('inv_list'=>array(),'unshipped'=>'');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid]['trans'][$transid]['inv_list'][] = $inv;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($unshipped_items)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$emp_sms_det[$row['employee_id']]['fran'][$franid]['trans'][$transid]['unshipped'] = $unshipped_items;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tforeach($emp_sms_det as $emp_id=>$emp_ship_det)\r\n\t\t\t{\r\n\t\t\t\t$emp_id = $emp_ship_det['employee_id'];\r\n\t\t\t\t$emp_name = $emp_ship_det['name'];\r\n\t\t\t\t$emp_mob_no = $emp_ship_det['contact_no'];\r\n\t\t\t\t$emp_territory_id = $emp_ship_det['territory_id'];\r\n\t\t\t\t\r\n\t\t\t\t$sms_msg = array();\r\n\t\t\t\t\r\n\t\t\t\tforeach($emp_ship_det['fran'] as $fid=>$fran_trans_det)\r\n\t\t\t\t{\r\n\t\t\t\t\t$total_invoices = 0;\r\n\t\t\t\t\t$fran_inv_list = array();\r\n\t\t\t\t\tforeach($fran_trans_det['trans'] as $transid => $trans_ship_det)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$t_inv_list = array_values($trans_ship_det['inv_list']);\r\n\t\t\t\t\t\t$total_invoices += count($t_inv_list);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$inv_sms = implode(',',$t_inv_list);\r\n\t\t\t\t\t\tif($trans_ship_det['unshipped'])\r\n\t\t\t\t\t\t\t$inv_sms .= ':'.$trans_ship_det['unshipped'];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$fran_inv_list[] = $inv_sms;\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\t$sms_msg[] = \"Shipped \".$total_invoices.\" Invoices for \".($fran_trans_det['fname']).\" (\".implode(',',$fran_inv_list).\")\";\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(count($sms_msg))\r\n\t\t\t\t{\r\n\t\t\t\t\t$sms_text .= implode(',',$sms_msg).\",Storeking\";\r\n\t\t\t\t\t\r\n\t\t\t\t\t//echo $sms_text;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->erpm->pnh_sendsms($emp_mob_no,$sms_text,0,$emp_id);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t//\techo $emp_mob_no,$sms_msg;\r\n\t\t\t\t\t$log_prm=array();\r\n\t\t\t\t\t$log_prm['emp_id']=$emp_id;\r\n\t\t\t\t\t$log_prm['contact_no']=$emp_mob_no;\r\n\t\t\t\t\t$log_prm['type']=4;\r\n\t\t\t\t\t$log_prm['territory_id']=$emp_territory_id;\r\n\t\t\t\t\t$log_prm['town_id']=0;\r\n\t\t\t\t\t$log_prm['grp_msg']=$sms_text;\r\n\t\t\t\t\t$log_prm['created_on']=cur_datetime();\r\n\t\t\t\t\t$this->erpm->insert_pnh_employee_grpsms_log($log_prm);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function callbackhostedpaymentAction()\n {\n $boError = false;\n $formVariables = array();\n $model = Mage::getModel('paymentsensegateway/direct');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $session = Mage::getSingleton('checkout/session');\n $szPaymentProcessorResponse = '';\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n $boCartIsEmpty = false;\n \n try\n {\n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $formVariables['HashDigest'] = $this->getRequest()->getPost('HashDigest');\n $formVariables['MerchantID'] = $this->getRequest()->getPost('MerchantID');\n $formVariables['StatusCode'] = $this->getRequest()->getPost('StatusCode');\n $formVariables['Message'] = $this->getRequest()->getPost('Message');\n $formVariables['PreviousStatusCode'] = $this->getRequest()->getPost('PreviousStatusCode');\n $formVariables['PreviousMessage'] = $this->getRequest()->getPost('PreviousMessage');\n $formVariables['CrossReference'] = $this->getRequest()->getPost('CrossReference');\n $formVariables['Amount'] = $this->getRequest()->getPost('Amount');\n $formVariables['CurrencyCode'] = $this->getRequest()->getPost('CurrencyCode');\n $formVariables['OrderID'] = $this->getRequest()->getPost('OrderID');\n $formVariables['TransactionType'] = $this->getRequest()->getPost('TransactionType');\n $formVariables['TransactionDateTime'] = $this->getRequest()->getPost('TransactionDateTime');\n $formVariables['OrderDescription'] = $this->getRequest()->getPost('OrderDescription');\n $formVariables['CustomerName'] = $this->getRequest()->getPost('CustomerName');\n $formVariables['Address1'] = $this->getRequest()->getPost('Address1');\n $formVariables['Address2'] = $this->getRequest()->getPost('Address2');\n $formVariables['Address3'] = $this->getRequest()->getPost('Address3');\n $formVariables['Address4'] = $this->getRequest()->getPost('Address4');\n $formVariables['City'] = $this->getRequest()->getPost('City');\n $formVariables['State'] = $this->getRequest()->getPost('State');\n $formVariables['PostCode'] = $this->getRequest()->getPost('PostCode');\n $formVariables['CountryCode'] = $this->getRequest()->getPost('CountryCode');\n \n if(!PYS_PaymentFormHelper::compareHostedPaymentFormHashDigest($formVariables, $szPassword, $hmHashMethod, $szPreSharedKey))\n {\n $boError = true;\n $szNotificationMessage = \"The payment was rejected for a SECURITY reason: the incoming payment data was tampered with.\";\n Mage::log(\"The Hosted Payment Form transaction couldn't be completed for the following reason: [\".$szNotificationMessage. \"]. Form variables: \".print_r($formVariables, 1));\n }\n else\n {\n $paymentsenseOrderId = Mage::getSingleton('checkout/session')->getPaymentsensegatewayOrderId();\n $szOrderStatus = $order->getStatus();\n $szStatusCode = $this->getRequest()->getPost('StatusCode');\n $szMessage = $this->getRequest()->getPost('Message');\n $szPreviousStatusCode = $this->getRequest()->getPost('PreviousStatusCode');\n $szPreviousMessage = $this->getRequest()->getPost('PreviousMessage');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n \n if($szOrderStatus != 'pys_paid' &&\n $szOrderStatus != 'pys_preauth')\n {\n $checkout->saveOrderAfterRedirectedPaymentAction(true,\n $this->getRequest()->getPost('StatusCode'),\n $this->getRequest()->getPost('Message'),\n $this->getRequest()->getPost('PreviousStatusCode'),\n $this->getRequest()->getPost('PreviousMessage'),\n $this->getRequest()->getPost('OrderID'),\n $this->getRequest()->getPost('CrossReference'));\n }\n else \n {\n // cart is empty\n $boCartIsEmpty = true;\n $szPaymentProcessorResponse = null;\n \n // chek the StatusCode as the customer might have just clicked the BACK button and re-submitted the card details\n // which can cause a charge back to the merchant\n $this->_fixBackButtonBug($szOrderID, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage);\n }\n }\n }\n catch (Exception $exc)\n {\n $boError = true;\n $szNotificationMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_183;\n Mage::logException($exc);\n }\n \n $szPaymentProcessorResponse = $session->getPaymentprocessorresponse();\n if($boError)\n {\n if($szPaymentProcessorResponse != null &&\n $szPaymentProcessorResponse != '')\n {\n $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;\n }\n \n $model->setPaymentAdditionalInformation($order->getPayment(), $this->getRequest()->getPost('CrossReference'));\n //$order->getPayment()->setTransactionId($this->getRequest()->getPost('CrossReference'));\n \n if($nVersion >= 1410)\n {\n if($order)\n {\n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Hosted Payment Failed'));\n $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);\n $order->save();\n }\n }\n if($nVersion == 1324 || $nVersion == 1330)\n {\n Mage::getSingleton('checkout/session')->addError($szNotificationMessage);\n }\n else \n {\n Mage::getSingleton('core/session')->addError($szNotificationMessage);\n }\n $order->save();\n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n else\n {\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\n if($boCartIsEmpty == false)\n {\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n if($nVersion >= 1410)\n {\n // TODO : no need to remove stock item as the system will do it in 1.6 version\n if($nVersion < 1600)\n {\n $model->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szPaymentProcessorResponse);\n }\n \n if($nVersion != 1324 && $nVersion != 1330)\n {\n if($szPaymentProcessorResponse != '')\n {\n Mage::getSingleton('core/session')->addSuccess($szPaymentProcessorResponse);\n }\n }\n }\n \n $this->_redirect('checkout/onepage/success', array('_secure' => true));\n }\n }", "public function testDepositFund($accNumber, $amount, $expected)\n {\n return $this->_testMethod(\n 'depositFund',\n [$amount],\n $expected,\n $accNumber,\n ['balance']\n );\n }", "public function processPayment();", "function user_update_wallent_balance_confirmation_mail($send_data)\n {\n $to_email_address = $send_data['sender_email'];\n $subject = \"Update Wallet Balance Confirmation E-mail\";\n $message = 'Hi, '.ucfirst($send_data['sender_name']).' <span style=\"font-size:24px\"><b>$'.$send_data['amount'].'</b></span> '.$send_data['message'];\n $data['msg'] = $message;\n $mess = $this->load->view('mailer/email_template', $data, true);\n $result_dfee = $this->common_model->sendEmails($to_email_address, $subject, $mess);\n\n if ($result_dfee) {\n return true;\n } else {\n return false;\n }\n }", "function handleFuturePayPayment(&$input, &$ids, &$objects) {\r\n $recur =& $objects['contributionRecur'];\r\n \r\n // make sure the invoice ids match\r\n // make sure the invoice is valid and matches what we have in the contribution record\r\n if ( $recur->invoice_id != $input['invoice'] ) {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Failure : Invoice values dont match between database and IPN request\");\r\n return false;\r\n }\r\n\r\n $now = date( 'YmdHis' );\r\n \r\n // fix dates that already exist\r\n $dates = array( 'create', 'start', 'end', 'cancel', 'modified' );\r\n foreach ( $dates as $date ) {\r\n $name = \"{$date}_date\";\r\n if ( $recur->$name ) {\r\n $recur->$name = CRM_Utils_Date::isoToMysql( $recur->$name );\r\n }\r\n }\r\n\r\n //contribution_status_id:\r\n //0=Completed,1=Pending,2=Cancelled,3=Overdue,4=Failed,5=InProgress\r\n if ($input['transStatus']=='Y') {//rawAuthMessage=Authorised\r\n // futurepay payment accepted\r\n if ($input['rawAuthMessage']!='Authorised') {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Warning futurepay transStatus=\".$input['transStatus'].\" but rawAuthMessage=\".$input['rawAuthMessage']);\r\n }\r\n if (_getContributionCount($recur)>=$recur->installments) {\r\n // final installement\r\n $recur->contribution_status_id=0;//0=Completed\r\n $recur->end_date=$now;\r\n }\r\n else {\r\n $recur->contribution_status_id=5;//5=In Progress\r\n $recur->modified_date = $now;\r\n }\r\n }\r\n else if ($input['transStatus']=='N') {//rawAuthMessage=Declined\r\n // futurepay payment declined\r\n $recur->contribution_status_id=4;//4=Failed\r\n $recur->end_date = $now;\r\n if ($input['rawAuthMessage']!='Declined') {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Warning futurepay transStatus=\".$input['transStatus'].\" but rawAuthMessage=\".$input['rawAuthMessage']);\r\n }\r\n $checkForEndOfAgreement=false;\r\n }\r\n else if ($input['futurePayStatusChange']=='Merchant Cancelled') {\r\n $recur->contribution_status_id=3;//3= cancelled\r\n $recur->cancel_date = $now;\r\n $input['reasonCode']='FuturePay cancelled by Merchant';\r\n }\r\n else if ($input['futurePayStatusChange']=='Customer Cancelled') {\r\n $recur->contribution_status_id=3;//3= cancelled\r\n $recur->cancel_date = $now;\r\n $input['reasonCode']='FuturePay cancelled by Donor';\r\n }\r\n else {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Unrecognized FuturePay operation. input=\".print_r($input,true));\r\n return false;\r\n }\r\n $recur->save();\r\n \r\n if ($input['transStatus']=='Y') {\r\n // create a new contribution for this recurring contribution\r\n $contributionType = $objects['contributionType'];\r\n $contribution = new CRM_Contribute_DAO_Contribution();\r\n $contribution->domain_id = CRM_Core_Config::domainID( );\r\n $contribution->contact_id = $ids[\"contact\"];\r\n $contribution->contribution_type_id = $contributionType->id;\r\n $contribution->contribution_page_id = $ids['contributionPage'];\r\n $contribution->contribution_recur_id = $ids['contributionRecur'];\r\n $contribution->receive_date = $now;\r\n $contribution->invoice_id = md5( uniqid( rand( ), true ) );\r\n $contribution->total_amount = $input[\"amount\"];\r\n $objects['contribution'] =& $contribution;\r\n \r\n require_once 'CRM/Core/Transaction.php';\r\n $transaction = new CRM_Core_Transaciton();\r\n $this->completeTransaction($input,$ids,$objects,$transaction,true);//true=recurring\r\n // completeTransaction handles the transaction commit\r\n return true;\r\n }\r\n }", "public function testTransactionRequestRejectedByPayerFsp()\n {\n $precondition = Factory::instance(\n 'TransactionRequestRejectedByPayerFsp'\n );\n\n $testdata = $precondition->getData();\n\n $this->assertTrue($testdata['amount'] == 10.1);\n }", "public function hasBoothfee(){\n return $this->_has(6);\n }", "public function verify()\n {\n /**\n * Make a signature temporary\n * Note: each paid has it's own specific signature\n */\n $signature = $this->generate_signature(\n $this->merchant_id,\n $this->bank_receipt,\n $this->invoice_number\n );\n \n // Make proper array of token params\n $params = [\n 'SaleConf_req' => [\n 'MID' => $this->enc($this->merchant_id),\n 'CRN' => $this->enc($this->invoice_number),\n 'TRN' => $this->enc($this->bank_receipt),\n 'SIGNATURE' => base64_encode($signature),\n ],\n ];\n \n // Send params to bank to get token\n $result = $this->call($this->transaction_reference_wsdl, 'sendConfirmation', $params);\n\n if ($result['RESCODE'] == -1)\n throw new BankException('امضا دیچیتال نا معتبر است', -1);\n elseif ($result['RESCODE'] == -2)\n throw new BankException('آدرس IP پذیرنده نا معتبر است', -2);\n elseif (!in_array($result['RESCODE'], [0, 101]))\n throw new BankException(null, $result['RESCODE']); // خطاهای تعریف شده دیگر\n\n\n $data = $result['RESCODE'] . $result['REPETETIVE'] . $result['AMOUNT'] . $result['DATE'] . $result['TIME'] . $result['TRN'] . $result['STAN'];\n\n // State whether signature is okay or not\n $verify_result = openssl_verify($data, base64_decode($result['SIGNATURE']), $this->key_resource);\n\n if ($verify_result == 0)\n throw new BankException('خطای امضای دیجیتال');\n elseif ($verify_result != 1)\n throw new BankException('عدم تطبیق امضا دیجیتال بانک');\n\n /**\n * Result Webservice Array\n * if you need special design for your website, please modify following codes\n */\n if (!empty($result['RESCODE'])) {\n // success\n if (($result['RESCODE'] == '00') && ($result['successful'] == true)) {\n return new SaderatResult(\n true, // success\n $this->getInvoiceNumber(),\n $this->getBankReceiptNumber(),\n false // repetitive\n );\n } // cancel\n elseif ($result['RESCODE'] == 101) {\n throw new RepetitiveException(\n $this->getInvoiceNumber(),\n $this->getBankReceiptNumber()\n );\n } // cancel\n elseif ($result['RESCODE'] == 200) {\n throw new BankException('تراکنش توسط کاربر کنسل شده است');\n } // cancel\n elseif ($result['RESCODE'] == 107) {\n throw new BankException(null, 107);\n } // other problem\n elseif (!empty($result['description']))\n throw new BankException($result['description']);\n\n } else\n throw new BankException('درخواست نامعتبر است');\n\n }", "function cf_order_valid_amount($params)\n\t{\n\t\t/* Insert: (grand_total - plan_total) < new_amount => error */\n\t\t/* Update: (grand_total - sum(plan_amount except current id)) < new_amount => error */\n\t\t$params = is_array($params) ? (object) $params : $params;\n\t\tif (! isset($params->order_id) && !$params->order_id)\n\t\t\treturn false;\n\t\t\n\t\t$id = isset($params->id) && $params->id ? 'and t2.id <> '.$params->id : '';\n\t\t$order_id = $params->order_id;\n\t\tif (isset($params->is_plan) && $params->is_plan) {\n\t\t\t// $str = \"SELECT grand_total,\n\t\t\t\t// (\n\t\t\t\t\t// select coalesce(sum(amount),0) from cf_order_plan t2 where t2.is_active = '1' and t2.is_deleted = '0' and t2.order_id = t1.id $id\n\t\t\t\t// ) as plan_total \n\t\t\t\t// from cf_order t1 where t1.id = $order_id\";\n\t\t\t$str = \"SELECT (grand_total - (select coalesce(sum(amount),0) from cf_order_plan t2 where t2.is_active = '1' and t2.is_deleted = '0' and t2.order_id = t1.id $id)) as amount \n\t\t\t\tfrom cf_order t1 where t1.id = $order_id\";\n\t\t}\n\t\t$row = $this->db->query($str)->row();\n\t\t// if ($row->grand_total - $row->plan_total - $params->amount < 0) {\n\t\tif ($row->amount - $params->amount < 0) {\n\t\t\t// $this->session->set_flashdata('message', $row->grand_total - $row->plan_total);\n\t\t\t$this->session->set_flashdata('message', $row->amount);\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t\t// if ($row->grand_total - $row->plan_total < $params->amount)\n\t}", "public function createExtern(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'receiver.account' => ['required', 'regex:/^[A-Z]{3}[0-9]{6}(DZD|EUR|USD)$/'],\n 'receiver.name' => 'required|max:255',\n 'receiver.bank' => 'required|regex:/^[A-Z]{3}$/|exists:banks,code',\n 'amount' => 'required|numeric|min:0',\n 'reason' => 'required|max:255',\n ]);\n $validator->sometimes('justification', 'required', function ($input) {//todo\n return $input->amount > 200000; // Amount \"Depasse\" 200 000\n });\n if ($validator->fails()) {\n return response($validator->errors(), config('code.BAD_REQUEST'));\n }\n\n\n $amount = $request->input('amount');\n $hasEnoughMoney = false;\n /**start transaction**/\n DB::beginTransaction();\n\n try {\n\n $senderAccount = $this->client()->accounts()\n ->courant()->first();//todo check methode first()\n\n\n //check the amount\n if (!$senderAccount->hasEnoughMoney($amount)) throw new \\Exception;\n $hasEnoughMoney = true;\n\n\n //create the transfer\n $commission = config('commission.SENDEXTBANK') * $amount;\n $now = \\Carbon\\Carbon::now();\n $virement_code = $senderAccount->number . $request->input('receiver.account') . $now->format('YmdHi');\n if ($amount > 200000) {\n $transferDate = null;\n $creationDate = $now->format('Y-m-d H:i:s');\n $status = 'traitement';\n } else {\n //generate the XML file that will be treated later equivalent to send money\n $xmlBody = View::make('xml_transfer_template', [\n \"code\" => $virement_code,\n \"date\" => $now->format('YmdHis'),\n \"senderName\" => $this->client()->firstname . ' ' . $this->client()->lastname,\n \"senderAccount\" => $senderAccount->number,\n \"receiverName\" => $request->input('receiver.name'),\n \"receiverBank\" => $request->input('receiver.bank'),\n \"receiverAccount\" => $request->input('receiver.account'),\n \"amount\" => $amount,\n \"reason\" => $request->input('reason'),\n ])->render();\n $xmlBody = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' . $xmlBody;\n\n Storage::disk('xml_out')->put($virement_code . '.xml', $xmlBody);\n\n $status = 'valide';\n $transferDate = $creationDate = $now->format('Y-m-d H:i:s');\n }\n ExternTransfer::create([\n 'code' => $virement_code,\n 'amount' => $amount,\n 'justification' => $request->input('justification'),\n 'reason' => $request->input('reason'),\n 'transferDate' => $transferDate,\n 'creationDate' => $creationDate,\n 'status' => $status,\n 'commission' => $commission,\n 'intern_account_id' => $senderAccount->number,\n 'direction' => 'out',\n 'extern_account_name' => $request->input('receiver.name'),\n 'extern_account_number' => $request->input('receiver.account'),\n 'extern_bank' => $request->input('receiver.bank'),\n ]);\n\n\n //todo send commission to Tharwa account\n //we retrieve the amount from the sender account\n $senderAccount->balance = $senderAccount->balance - $commission - $amount;\n $senderAccount->save();\n\n $nb = BalanceHistory::count();//todo fix this !all sol tested! re-migrate DB\n //sender history\n BalanceHistory::create([\n 'id' => $nb + 1,\n 'amount' => $amount + $commission,\n 'transaction_type' => 'transf',\n 'transaction_direction' => 'out',\n 'account_id' => $senderAccount->number,\n 'created_at' => $now->format('Y-m-d H:i:s'),\n 'updated_at' => $now->format('Y-m-d H:i:s')\n ]);\n\n// Mail::to($request->input('email'))\n// ->queue(new ClientRequestValidatedMail($acceptedClient->firstname.' '.$acceptedClient->lastname\n// , $request->input('code')));\n\n // all good\n /**commit - no problems **/\n DB::commit();\n return response([\"saved\" => true], config('code.CREATED'));\n\n } catch (\\Exception $e) {\n\n // something went wrong\n /**rollback every thing - problems **/\n DB::rollback();\n\n if (!$hasEnoughMoney)\n return response([\"amount\" => false], config('code.NOT_FOUND'));\n\n return response([\"saved\" => false], config('code.UNKNOWN_ERROR'));\n }\n\n }", "public function calculFrais()\n {\n $frais = $this->compteModel->calculTaxe($this->utils->securite_xss($_POST['montant']), $this->utils->securite_xss($_POST['service']));\n if ($frais > 0) echo $frais;\n else if ($frais == 0) echo 0;\n else echo -2;\n }", "public function confirm() {\r\n\r\n\t\t$json = array();\r\n\t\tif ($this->session->data['payment_method'] == 'coinremitter') {\r\n\t\t\t\r\n\t\t\tif($this->request->post['coin'] != ''){\r\n\r\n\t\t\t\t$this->load->model('extension/coinremitter/payment/coinremitter');\r\n\r\n\t\t\t\t/*** Get wallet data from 'oc_coinremitter_wallet' with use of `coin` ***/\r\n\t\t\t\t$coin = $this->request->post['coin'];\r\n\t\t\t\t$wallet_info = $this->model_extension_coinremitter_payment_coinremitter->getWallet($coin);\r\n\r\n\t\t\t\tif($wallet_info){\r\n\r\n\t\t\t\t\t$api_key = $wallet_info['api_key'];\r\n\t\t\t\t\t$api_password = $wallet_info['password'];\r\n\t\t\t\t\t$exchange_rate = $wallet_info['exchange_rate_multiplier'];\r\n\r\n\t\t\t\t\t$address_data =[\r\n\t\t\t\t\t\t'url' => 'get-new-address',\r\n\t\t\t\t\t\t'coin' => $coin,\r\n 'api_key' =>$api_key,\r\n 'password' => $api_password\r\n ];\r\n\t\t\t\t\t// print_r($this->obj_curl);\r\n\t\t\t\t\t// die;\r\n // die($this->obj_curl);\r\n $address_res = $this->obj_curl->commonApiCall($address_data);\r\n \r\n if(!empty($address_res) && isset($address_res['flag']) && $address_res['flag'] == 1){\r\n\r\n \t$this->load->model('checkout/order');\r\n\t\t\t\t\t\t$orderId = $this->session->data['order_id'];\r\n\t\t\t\t\t\t$order_cart = $this->model_checkout_order->getOrder($orderId);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Convert amount format in actual currency.\r\n\t\t\t\t\t\t/*** Opencart saves amount in USD only. So you need to covert amount for other currency. Below function converts amount in selected(base) currency. It also work for USD, so no need any other condition for USD ***/\r\n\t\t\t\t\t\t$order_total = $this->currency->format($order_cart['total'], $order_cart['currency_code'], $order_cart['currency_value'],false);\r\n\r\n\t\t\t\t\t\tif ($exchange_rate == 0 || $exchange_rate == '') {\r\n\t\t\t\t\t\t\t$exchange_rate = 1;\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t$amount = $order_total * $exchange_rate;\r\n\t\t\t\t\t\t$currency_type = $order_cart['currency_code'];\r\n\r\n \t//now convert order's fiat amount to crypto amount with use of get-fiat-to-crypto-rate api in coinremitter \r\n\r\n \t$fiat_amount_arr = [\r\n \t\t'url' => 'get-fiat-to-crypto-rate',\r\n \t\t'coin' => $coin,\r\n \t\t'api_key' =>$api_key,\r\n \t'password' => $api_password,\r\n \t'fiat_symbol' => $currency_type,\r\n \t'fiat_amount' => $amount\r\n \t];\r\n\r\n \t$fiat_to_crypto_res = $this->obj_curl->commonApiCall($fiat_amount_arr);\r\n\r\n \tif(!empty($fiat_to_crypto_res) && isset($fiat_to_crypto_res['flag']) && $fiat_to_crypto_res['flag'] == 1){\r\n\r\n \t\t\t$address_data = $address_res['data'];\r\n \t\t\t$fiat_to_crypto_res = $fiat_to_crypto_res['data'];\r\n\t\t \t$amountusd = $order_cart['total'];\r\n\t\t \t$crp_amount = $fiat_to_crypto_res['crypto_amount'];\r\n\t\t \t$address = $address_data['address'];\r\n\t\t \t$qr_code = $address_data['qr_code'];\r\n\r\n\t\t $order_data = array(\r\n\t\t \t'order_id' \t\t=> $orderId,\r\n\t\t \t'invoice_id' \t=> '' ,\r\n\t\t \t'amountusd' \t=> $amountusd,\r\n\t\t \t'crp_amount' \t=> $crp_amount,\r\n\t\t \t'payment_status'=> 'pending',\r\n\t\t \t'address' \t\t=> $address,\r\n\t\t \t'qr_code'\t\t=> $qr_code\r\n\t\t );\r\n\r\n\t\t \t/*** Now, insert detail in `oc_coinremitter_order` ***/\r\n\t\t \t$this->model_extension_coinremitter_payment_coinremitter->addOrder($order_data);\r\n\r\n\t\t \t/*** Now, insert detail in `oc_coinremitter_payment` ***/\r\n\t\t \t$invoice_expiry = (int)$this->config->get('payment_coinremitter_invoice_expiry');\r\n\r\n\t\t\t\t\t\t\t\tif($invoice_expiry == 0){\r\n\t\t\t\t\t\t\t\t\t$expire_on = '';\r\n\t\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t\t$newtimestamp = strtotime(date('Y-m-d H:i:s').' + '.$invoice_expiry.' minute');\r\n\t\t\t\t\t\t\t\t\t$expire_on = date('Y-m-d H:i:s', $newtimestamp);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t$total_amount = array(\r\n\t\t\t\t\t\t\t\t\t$coin => $crp_amount,\r\n\t\t\t\t\t\t\t\t\t'USD' => $amountusd,\r\n\t\t\t\t\t\t\t\t\t$order_cart['currency_code'] => $order_total\r\n\t\t\t\t\t\t\t\t);\r\n\t\t $payment_data = array(\r\n\t\t \t'order_id' \t\t=> \t$orderId,\r\n\t\t 'invoice_id'\t=>\t'',\r\n\t\t 'address'\t\t=> \t$address,\r\n\t\t 'invoice_name'\t=>\t'',\r\n\t\t 'marchant_name'\t=>\t'',\r\n\t\t 'total_amount'\t=>\tjson_encode($total_amount),\r\n\t\t 'paid_amount'\t=>\t'',\r\n\t\t 'base_currancy'\t=>\t$currency_type,\r\n\t\t 'description'\t=>\t'Order Id #'.$orderId,\r\n\t\t 'coin'\t\t\t=>\t$coin,\r\n\t\t 'payment_history'=> '',\r\n\t\t 'conversion_rate'=> '',\r\n\t\t 'invoice_url'\t=>\t'',\r\n\t\t 'status'\t\t=>\t'Pending',\r\n\t\t 'expire_on'\t\t=>\t$expire_on,\r\n\t\t 'created_at'\t=>\tdate('Y-m-d H:i:s')\r\n\t\t );\r\n\r\n\t\t $this->model_extension_coinremitter_payment_coinremitter->addPayment($payment_data);\r\n\r\n\t\t $enc_order_id = urlencode($this->obj_curl->encrypt($orderId)); // order id in encryption format\r\n\t\t $invoice_url = $this->url->link('extension/coinremitter/module/coinremitter_invoice|detail&order_id='.$enc_order_id,'',true);\r\n\r\n\t\t \t/*** Update order history status to pending, add comment ***/\r\n\t\t $comments = 'View order <a href=\"'.$invoice_url.'\">#' . $orderId . '</a> ';\r\n\t\t $is_customer_notified = true;\r\n\t\t $this->model_checkout_order->addHistory($orderId, 1, $comments, $is_customer_notified); \r\n\t\t \t\t\t\t\t\t\t\t\t\t\t\t\t// 1 = Pending\r\n\r\n\t\t\t\t\t\t\t\t$json = array();\r\n\t\t\t\t\t\t\t\t$json['flag'] = 1; \r\n\t\t\t\t\t\t\t\t$json['redirect'] = $invoice_url;\r\n\r\n \t}else{\r\n \t\t$msg = 'Something went wrong while converting fiat to crypto. Please try again later';\r\n\t \tif(isset($fiat_to_crypto_res['msg']) && $fiat_to_crypto_res['msg'] != ''){\r\n\t \t\t$msg = $fiat_to_crypto_res['msg'];\r\n\t \t}\r\n\t \t$json['flag'] = 0;\r\n\t\t\t\t\t\t\t$json['msg'] = $msg;\r\n \t}\r\n\r\n }else{\r\n \t$msg = 'Something went wrong while creating address. Please try again later';\r\n \tif(isset($address_res['msg']) && $address_res['msg'] != ''){\r\n \t\t$msg = $address_res['msg'];\r\n \t}\r\n \t$json['flag'] = 0;\r\n\t\t\t\t\t\t$json['msg'] = $msg;\r\n }\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t\t$json['msg'] = 'Selected wallet not found. Please try again later';\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t$json['flag'] = 0;\r\n\t\t\t\t$json['msg'] = 'Selected coin not found. Please try again later';\t\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$json['flag'] = 0;\r\n\t\t\t$json['msg'] = 'Please select Coinremitter as payment method';\r\n\t\t}\r\n\t\t$this->response->addHeader('Content-Type: application/json');\r\n\t\t$this->response->setOutput(json_encode($json));\t\t\r\n\t}", "public function actionSendToHub()\n {\n $paymentAddresses = PaymentAddressQueryLibrary::getWithFunds();\n\n $paymentAddressService = new PaymentAddressService();\n foreach ($paymentAddresses as $paymentAddress) {\n try {\n if ($paymentAddressService->sendToHub($paymentAddress)) {\n $this->stdout('Funds transferred from temporary address to hub address. | ID: ' . $paymentAddress->id . \" | Hex: \" . $paymentAddressService->getTransactionHex() . \" |\\n\" . PHP_EOL, Console::FG_YELLOW);\n }\n }\n catch (Exception $exception) {\n $this->stdout('Error occurred. | ID: ' . $paymentAddress->id . \" |\\n\" . PHP_EOL, Console::FG_RED);\n }\n }\n return true;\n }", "function process_payment($order_number, $order_total, &$d) {\n return true;\n }", "public function get_restaurant_list_fees () {\n\t\t\n\t\t$restaurantIDString = $this->get_param('post.restaurant_id_list');\n\t\t$deliveryRegionID = $this->get_param('post.delivery_region_id');\n\t\t\n\t\t$extraFee = M('restaurant')\n\t\t\t->where('`id` in (' . $restaurantIDString . ')')\n\t\t\t->field('sum(`extra_fee`) as extra_fee')\n\t\t\t->find();\n\t\t\n\t\tif (!$extraFee) {\n\t\t\t$extraFee = \"0\";\n\t\t} else {\n\t\t\t$extraFee = $extraFee['extra_fee'];\n\t\t}\n\t\t\n\t\t\n\t\t$deliveryFee = M('restaurant_deliver_fee')\n\t\t\t->where(\"`region_id` = $deliveryRegionID and `restaurant_id` in ( $restaurantIDString ) \")\n\t\t\t->select();\n\t\t\n\t\t$this->return_data(['extra_fee' => $extraFee, 'delivery_fee' => $deliveryFee]);\n\t}", "function cf_cashbank_valid_amount($params)\n\t{\n\t\t/* Update: (grand_total - sum(plan_amount except current id)) < new_amount => error */\n\t\t$params = is_array($params) ? (object) $params : $params;\n\t\t// debug($params);\n\t\t\n\t\t$id = isset($params->id) && $params->id ? 'and t2.id <> '.$params->id : '';\n\t\t$invoice_id = $params->invoice_id;\n\t\t$str = \"SELECT (net_amount - (select coalesce(sum(amount),0) from cf_cashbank_line t2 where t2.is_active = '1' and t2.is_deleted = '0' and t2.invoice_id = t1.id $id)) as amount \n\t\t\tfrom cf_invoice t1 where t1.id = $invoice_id\";\n\t\t$row = $this->db->query($str)->row();\n\t\tif ($row->amount - $params->amount < 0) {\n\t\t\t$this->session->set_flashdata('message', $row->amount);\n\t\t\treturn FALSE;\n\t\t}\n\t\treturn TRUE;\n\t}", "public function testXEMFeeComputation()\n {\n // sending 250000 XEM reaches the maximum fee\n $amount = new Amount([\"amount\" => 260*1000]);\n\n $expectFee = Fee::MAX_AMOUNT_FEE;\n $actualFee = Fee::calculateForXEM($amount->toMicro());\n\n $this->assertEquals(260000, $amount->toMicro());\n $this->assertEquals($expectFee, $actualFee);\n }", "public function testGetContractFees(): void\n {\n $apiManager = $this->createApiManager(\n [\n 'action' => 'debit',\n 'created_at' => '2019-02-25T05:43:31Z',\n 'currency' => 'AUD',\n 'ewallet' => [\n 'created_at' => '2019-02-24T23:34:11Z',\n 'currency' => 'AUD',\n 'id' => '6e967a8e9971aab24d2db4e932ca1a06',\n 'pan' => 'Y...K8Y7',\n 'primary' => true,\n 'reference' => 'YNGANFK8Y7',\n 'type' => 'ewallet',\n 'updated_at' => '2019-02-24T23:34:11Z',\n 'user' => [\n 'created_at' => '2019-02-24T23:34:11Z',\n 'email' => 'examples@user.test',\n 'id' => '3T93F7TXCVGX4ZV7AFW2',\n 'updated_at' => '2019-02-24T23:34:11Z',\n ],\n ],\n 'fixed_fee' => '0.02',\n 'group' => 'Mastercard',\n 'type' => 'contract',\n 'updated_at' => '2019-02-26T03:19:03Z',\n 'user' => [\n 'created_at' => '2019-02-24T23:34:11Z',\n 'email' => 'examples@user.test',\n 'id' => '3T93F7TXCVGX4ZV7AFW2',\n 'updated_at' => '2019-02-24T23:34:11Z',\n ],\n 'variable_rate' => '0.10',\n ],\n 201\n );\n\n /** @var \\EoneoPay\\PhpSdk\\Endpoints\\Users\\Contract $contract */\n $contract = $apiManager->findOneBy(\n Contract::class,\n (string)\\getenv('PAYMENTS_API_KEY'),\n ['userId' => '3T93F7TXCVGX4ZV7AFW2']\n );\n\n self::assertSame('0.10', $contract->getVariableRate());\n self::assertSame('Mastercard', $contract->getGroup());\n self::assertSame('AUD', $contract->getCurrency());\n self::assertSame('0.02', $contract->getFixedFee());\n self::assertSame('debit', $contract->getAction());\n self::assertInstanceOf(User::class, $contract->getUser());\n self::assertInstanceOf(Ewallet::class, $contract->getEwallet());\n }", "public function pay($moneyBookersTransactionId, $toEmail, $amount){\n if($this->prepearePayment($moneyBookersTransactionId, $toEmail, $amount)){\n return $this->transfer();\n }else {\n return false;\n }\n }", "public function sendConfirmed($payment_address_id, $destination, $quantity, $asset, $fee=null, $dust_size=null, $request_id=null) {\n return $this->sendFromAccount($payment_address_id, $destination, $quantity, $asset, 'default', false, $fee, $dust_size, $request_id);\n }", "private function depositToWallet() {\n # there is not api_limited_quota/cashier_quota msg\n # transfer function has to return error_code and error_msg\n }", "public function calculateshipping(Request $request)\n {\n $pickUp = $request->pickup;\n $pickupState = $request->pickupState;\n $dropOff = $request->dropoff;\n $dropoffState = $request->dropoffState;\n $totalShipping = 0;\n $finalShipping = 0;\n if (!empty($pickUp)) {\n $PickUpresult = DB::table($this->DBTables['Shipping'].' as shp')\n ->join($this->DBTables['Regions'].' as reg', 'reg.id', '=', 'shp.region_id')\n ->where([['reg.stateid', '=', $pickupState],['shp.postcode', '=', $pickUp]])\n ->select('shp.id', 'shp.postcode', 'shp.shipping_cost', 'shp.suburb', 'reg.region')\n ->get();\n if (count($PickUpresult) > 0) {\n $totalShipping = $totalShipping + $PickUpresult[0]->shipping_cost;\n }else{\n $totalShipping = $totalShipping + 50;\n }\n }\n if (!empty($dropOff)) {\n $DropOffresult = DB::table($this->DBTables['Shipping'].' as shp')\n ->join($this->DBTables['Regions'].' as reg', 'reg.id', '=', 'shp.region_id')\n ->where([['reg.stateid', '=', $dropoffState],['shp.postcode', '=', $dropOff]])\n ->select('shp.id', 'shp.postcode', 'shp.shipping_cost', 'shp.suburb', 'reg.region')\n ->get();\n if (count($DropOffresult) > 0) {\n $totalShipping = $totalShipping + $DropOffresult[0]->shipping_cost;\n }else{\n $totalShipping = $totalShipping + 50;\n }\n }\n $freightPrice = Config::get('constants.FreightPrice');\n if ($totalShipping > $freightPrice) {\n $finalShipping = $totalShipping - $freightPrice;\n }\n return $finalShipping;\n }", "public function order_paid_callback()\n {\n\n $query = $this->db->get('paid_orders_cache');\n if ($query->num_rows() == 0)\n return FALSE;\n\n $paid = $query->result_array();\n $coin = $this->bw_config->currencies[0];\n\n $this->load->model('transaction_cache_model');\n $this->load->model('accounts_model');\n\n foreach ($paid as $record) {\n $order = $this->get($record['order_id']);\n $vendor_address = $order['vendor_payout'];\n $admin_address = BitcoinLib::public_key_to_address($order['public_keys']['admin']['public_key'], $coin['crypto_magic_byte']);\n\n // Create the transaction outputs\n $tx_outs = array($admin_address => (string)number_format(($order['fees'] + $order['extra_fees'] - 0.0001), 8),\n $vendor_address => (string)number_format(($order['price'] + $order['shipping_costs'] - $order['extra_fees']), 8));\n\n $create_spend_transaction = $this->create_spend_transaction($order['address'], $tx_outs, $order['redeemScript']);\n if ($create_spend_transaction == TRUE) {\n $next_progress = ($order['vendor_selected_escrow'] == '1') ? '4' : '3';\n $this->progress_order($order['id'], '2', $next_progress, array('paid_time' => time()));\n } else {\n //$this->log_model->\n }\n $this->transaction_cache_model->delete_finalized_record($order['id']);\n }\n }" ]
[ "0.6560082", "0.58329386", "0.5730458", "0.5706593", "0.56614304", "0.56612515", "0.5517962", "0.55143636", "0.5509087", "0.55081344", "0.5475901", "0.54524195", "0.5444463", "0.5439588", "0.5416456", "0.54126275", "0.53508604", "0.5336904", "0.53266513", "0.5297512", "0.52916634", "0.5273698", "0.5270664", "0.52665794", "0.52569276", "0.5255285", "0.5250797", "0.52474827", "0.5240295", "0.5225742", "0.51699924", "0.51694864", "0.5168643", "0.5166548", "0.51584214", "0.5152022", "0.5137251", "0.51352316", "0.5133421", "0.5124046", "0.51179236", "0.5105172", "0.5096731", "0.5095927", "0.5094306", "0.50936806", "0.50927603", "0.5084486", "0.5074209", "0.5062469", "0.50521266", "0.50505173", "0.5048128", "0.5046081", "0.50434804", "0.5042787", "0.50421864", "0.5036182", "0.5035058", "0.502764", "0.50184953", "0.5007607", "0.5006835", "0.50032735", "0.49958086", "0.49839786", "0.49820077", "0.49813822", "0.49799", "0.49783552", "0.49698615", "0.49668264", "0.4966531", "0.49624294", "0.4961617", "0.4959979", "0.4958668", "0.49555308", "0.4950979", "0.49503022", "0.49476236", "0.49471104", "0.4943079", "0.4943072", "0.49428225", "0.49417925", "0.4935099", "0.49346167", "0.49342227", "0.49302334", "0.4927013", "0.4923503", "0.492266", "0.4922606", "0.49191248", "0.49171835", "0.4907045", "0.48988932", "0.48962322", "0.489481", "0.4893347" ]
0.0
-1
Read data from database to show data in sub_admin page
public function read_Vendor_information($mobile_no) { $condition = "mobile_no =" . "'" . $mobile_no . "'"; $this->db->select('*'); $this->db->from('vendor'); $this->db->where($condition); $this->db->limit(1); $query = $this->db->get(); if ($query->num_rows() == 1) { return $query->result(); } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function read(){\n\t\t\t$recordPerPage = 25;\n\t\t\t//tinh so trang\n\t\t\t$numPage = ceil($this->modelTotal()/$recordPerPage);\n\t\t\t//goi ham de lay du lieu\n\t\t\t$listRecord = $this->modelRead($recordPerPage);\n\t\t\t//load view\n\t\t\tinclude \"Views/BlogsView.php\";\n\t\t}", "public function get_data();", "public function action_read(){\t\t\n\t\t$result = '';\t\t\n//\t\tLog::instance()->add(Log::NOTICE, Debug::vars($this->request->param('table_name')));\n//\t\t$obj = new stdClass;\n//\t\t$obj->username = \"This is the content\";\n\t\tif ($this->request->method() === Request::POST)\n\t\t{\n\t\t\tlist($navigation,) = array_values(Arr::extract(\n\t\t\t\t\t$this->request->post(), array(\n\t\t\t\t\t\t'navigation'\n\t\t\t\t\t)));\n//\t\t\tLog::instance()->add(Log::NOTICE, Debug::vars(Route::get($this->request->directory()->uri(\n//\t\t\t\tarray('controller'=> $this->request->controller())\n//\t\t\t))));\n\t\t\t$this->request->redirect(Route::get($this->request->directory())->uri(\n\t\t\t\tarray(\n\t\t\t\t\t'controller'=> $this->request->controller(),\n\t\t\t\t\t'action'=>'read'\n\t\t\t\t)\n\t\t\t).'/'.$navigation);\n\t\t\n\t\t}\n\t\t$table_name = $this->request->param('table_name');\n\t\tif($table_name){\n\t\t\t$datalog = $this->_get_datalog($table_name);\n\t\t\t$result = View::factory('datalog')\n\t\t\t\t->set('show_table',TRUE)\n\t\t\t\t->set('datalog',$datalog);\n\t\t}\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t$this->view->result = $result;\n\n//\t\t$this->template->content = Message::display();\n// Log::instance()->add(Log::NOTICE, Route::url('admin'));\n// $this->request->redirect('admin/news');\n// $this->response->body('admin');\n }", "function read(){\n\n\n\t\t\t\t$servername = \"localhost\";\n\t\t\t\t$username = \"root\";\n\t\t\t\t$password = \"\";\n\t\t\t\t$dbname = \"CS230\";\n\t\t\t\t$conn = mysqli_connect($servername, $username, $password, $dbname);\n\t\t\t\tif($conn){\n\t\t\t\t//echo \"Connection OK\";\n\t\t\t\t}else{\n\t\t\t\t\tdie(\"The Connection has failed: \" .mysqli_connect_error());\n\t\t\t\t}\n\t\t\t\t$sql = \"SELECT * FROM eBook_MetaData\";\n\t\t\t\t$values = $conn->query($sql);\n\n\n\t\t\t\t\tif($values->num_rows>=0){\n\t\t\t\t\t\techo \"<table id='dataBase'>\n\t\t\t\t\t\t\t\t<caption class='bold' id='caption'>eBook_MetaData</caption>\n\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t<th class='bold'>id</th>\n\t\t\t\t\t\t\t\t\t<th class='bold'>creator</th>\n\t\t\t\t\t\t\t\t\t<th class='bold'>title</th>\n\t\t\t\t\t\t\t\t\t<th class='bold'>type</th>\n\t\t\t\t\t\t\t\t\t<th class='bold'>identifier</th>\n\t\t\t\t\t\t\t\t\t<th class='bold'>date</th>\n\t\t\t\t\t\t\t\t\t<th class='bold'>language</th>\n\t\t\t\t\t\t\t\t\t<th class='bold'>description</th>\n\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t\t\twhile($row = $values->fetch_assoc()){\n\t\t\t\t\t\t\techo \"<tr>\n\t\t\t\t\t\t\t\t\t<td>\" .$row['id'].\"</td>\n\t\t\t\t\t\t\t\t\t<td>\" .$row['creator'].\"</td>\n\t\t\t\t\t\t\t\t\t<td>\" .$row['title'].\"</td>\n\t\t\t\t\t\t\t\t\t<td>\" .$row['type'].\"</td>\n\t\t\t\t\t\t\t\t\t<td>\" .$row['identifier'].\"</td>\n\t\t\t\t\t\t\t\t\t<td>\" .$row['date'].\"</td>\n\t\t\t\t\t\t\t\t\t<td>\" .$row['language'].\"</td>\n\t\t\t\t\t\t\t\t\t<td>\" .$row['description'].\"</td>\n\t\t\t\t\t\t\t\t</tr>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo \"</table>\";\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//echo \"Test No\";\n\t\t\t\t\t\techo \"<br> The Database is Empty\";\n\t\t\t\t\t}\n\t\t\t\t$conn = null;\n\t\t\t\t}", "function read(){\r\n \r\n // select all query\r\n $query = \"SELECT\r\n rul.reg_user_luggage_id as UserLuggageId,\r\n rul.reg_user_id as UserId,\r\n rul.luggage_check_in as CheckIn,\r\n rul.luggage_check_out as CheckOut,\r\n rul.luggage_status as lStatus,\r\n rul.luggage_image as LuggageImage\r\n FROM\r\n \" . $this->table_name . \" rul \";\r\n \r\n // prepare query statement\r\n $stmt = $this->conn->prepare($query);\r\n \r\n // execute query\r\n $stmt->execute();\r\n \r\n return $stmt;\r\n }", "public function loadData(){\r\n\t\t\t $pseudo = addslashes($this -> getPseudo()) ;\r\n\r\n\t\t if(! empty($pseudo)){\r\n\t\t\t$q = \"select * from UserTab where User_pseudo='\".$pseudo.\"'\";\r\n\t\t\t$r = execute($q);\r\n\t\t\twhile( $l = mysql_fetch_assoc($r) ){\r\n\t\t\t\t$this -> setFields($l);//Affectation aux champs de l'objet UserTab \r\n\t\t\t}\r\n\t\t }\r\n\r\n\t }", "private function getData(){\n\t\tdb::getAdapter();\n\t\t\n\t\t$counter=0;\n\t\t$arrayFieldQuery=array();\n\t\tforeach($this->fields as $field){\n\t\t\t$arrayFieldQuery[$field]=$this->types[$counter];\n\t\t\t$counter++;\n\t\t}\n\t\t\n\t\t$counter=0;\n\t\t$arrayFilters=array();\n\t\tforeach($this->filters as $filter){\n\t\t\t$arrayFilters[$this->fields[$filter[0]]]=array(\"type\"=>$this->types[$filter[0]],\"value\"=>$filter[1]);\n\t\t}\n\t\t\n\t\tif(db::getFields($this->table,$arrayFieldQuery,$arrayFilters,$this->orderQuery,$this->limit,true)){\n\t\t\t$this->pages=ceil(((int)db::getCalculatedRows())/((int)$this->maxRowsPerPage));\n\t\t\t$this->maxRows=(int)db::getCalculatedRows();\n\t\t\twhile($row=db::fetch(db::$FETCH_TYPE_ASSOC)){\n\t\t\t\t$this->addRow($row);\n\t\t\t}\n\t\t}\n\t}", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public function get_data()\n {\n }", "public function read(){\n\t\t\t//quy dinh so ban ghi tren mot trang\n\t\t\t$recordPerPage = 20;\n\t\t\t//tinh so trang\n\t\t\t$numPage = ceil($this->totalRecord()/$recordPerPage);\n\t\t\t//goi ham ModelRead tu class UsersModel de lay ket qua\n\t\t\t$listRecord = $this->ModelRead($recordPerPage);\n\t\t\t//load view\n\t\t\tinclude \"Views/CategoriesRead.php\";\n\t\t}", "private function load()\r\n {\r\n $this->dbFields = MySQL::fetchRecord(MySQL::executeQuery('SELECT * FROM training_slideshow WHERE ts_id='.(int)$this->id),MySQL::fmAssoc);\r\n }", "public function readAdmins(){\r\n $results = array();\r\n\r\n if ( null !== $this->getDB() ) {\r\n $dbs = $this->getDB()->prepare('select * from admin');\r\n\r\n if ( $dbs->execute() && $dbs->rowCount() > 0 ) {\r\n $results = $dbs->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n } \r\n return $results;\r\n }", "public function admin_index() {\r\n\t\t$this->data = $this->{$this->modelClass}->find('all');\r\n }", "public function ambildata_admin(){\n\t\t$query=$this->db->query(\"SELECT * FROM tb_admin\");\n\t\treturn $query->result_array();\n\t}", "private function getContents() {\n $sql = \"\n SELECT data FROM {$this->persisterTableName}\n WHERE id=1\n \";\n $data = $this->getDbConnection()->createCommand($sql)->queryScalar();\n return $data === false ? '' : $data;\n\n }", "public function getAdminData($name)\n {\n $this->db->where('admin_name', $name);\n \n $query = $this->db->get('admin');\n \n return $query->row();\n \n }", "public function read(){\n $query = \"SELECT ordine.id_ordine, ordine.id_fornitore, fornitore.nome as fornitore, ordine.articolo, articolo.taglia, ordine.stato \n FROM \" . $this->table_name . \" LEFT JOIN fornitore ON ordine.id_fornitore = fornitore.id_fornitore INNER JOIN articolo ON ordine.id_ordine = articolo.id_ordine\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "private function read(){\n\t\t$result = $this->clsAccessPermission->toRead();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to reade!\");\n\t\t\treturn;\n\t\t}\n\t\t// Take the id from session.\n\t\tif(!empty($_SESSION ['PK']['ACCESSCRUD'])){\n\t\t\t$id = $_SESSION ['PK']['ACCESSCRUD'];\n\t\t\t$this->objAccessCrud->readOne ( $id );\n\t\t}\n\n\t\t$this->fieldValue[\"cl_id_access_profile\"] = $this->objAccessCrud->getIdAccessProfile();\n\t\t$this->fieldValue[\"cl_id_access_page\"] = $this->objAccessCrud->getIdAccessPage();\n\n\t\t$this->fieldValue[\"cl_crud\"] = $this->objAccessCrud->getCread();\n\t\t$this->fieldValue[\"cl_read\"] = $this->objAccessCrud->getRead();\n\t\t$this->fieldValue[\"cl_update\"] = $this->objAccessCrud->getUpdate();\n\t\t$this->fieldValue[\"cl_delete\"] = $this->objAccessCrud->getDelete();\n\n\t\t$this->fieldValue[\"cl_date_insert\"] = $this->objAccessCrud->getDateInsert();\n\t\t$this->fieldValue[\"cl_date_update\"] = $this->objAccessCrud->getDateUpdate();\n\n\t\treturn;\n\t }", "private function getData()\n\t{\n\t\t// get the record\n\t\t$this->record = (array) BackendBannersModel::get($this->id);\n\n\t\t// no item found, throw an exceptions, because somebody is fucking with our URL\n\t\tif(empty($this->record)) $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');\n\t}", "public function admin_load()\n {\n }", "function readReal(){ \n\t\t$query = \"SELECT * FROM \" . $this->table_name . \" WHERE id=1 LIMIT 0,1\";\n\n\t\t$stmt = $this->conn->prepare( $query );\n\t\t$stmt->bindParam(1, $this->id);\n\t\t$stmt->execute();\n\n\t\t$row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n\t\t$this->id = $row['id'];\n\t\t$this->nmp = $row['nama_pondok'];\n\t\t$this->almt = $row['alamat_pondok'];\n\t\t$this->komp = $row['komputer_pondok'];\n\t\t$this->sms = $row['no_sms_gateway'];\n\t}", "function readDB() {\n\n\t\t// READ FROM MYSQL, kh_mod 0.3.0, add\n\t\treturn ($this->sqldatabase)?\n\t\t\t\t $this->readDBSQL()\n\t\t\t\t :\n\t\t\t\t $this->readDBFlatfile();\n\t}", "public function get_data()\n\t\t{\t\t// Should there be a common method for this?\n\t\t}", "private function retrieveData(){\n\t\t\n\t\t$dbo=new DB();\n\t\t$db=$dbo->db;\n\t\t$stmt = $db->prepare(\t'SELECT `description`, '.\n\t\t\t\t\t\t\t\t\t\t'`duration` '.\n\t\t\t\t\t\t\t\t'FROM `status` '.\t\t\n\t\t\t\t\t\t\t\t'WHERE `status` = ? '.\n\t\t\t\t\t\t\t\t'LIMIT 1'\n\t\t\t\t\t\t\t\t);\n\t $stmt->bind_param(\"s\", $this->id);\n\t $stmt->bind_result($this->description,$this->duration);\n\t $stmt->execute();\n\t $stmt->fetch();\n \t\t$stmt->close();\n \t\t\n\t}", "function read()\n\t{\n\t\tglobal $ilDB;\n\n\t\tif(!isset($this->data_record))\n\t\t{\n\t\t\t$query = \"SELECT * FROM tax_node WHERE obj_id = \".\n\t\t\t\t$ilDB->quote($this->id, \"integer\");\n\t\t\t$obj_set = $ilDB->query($query);\n\t\t\t$this->data_record = $ilDB->fetchAssoc($obj_set);\n\t\t}\n\t\t$this->setType($this->data_record[\"type\"]);\n\t\t$this->setTitle($this->data_record[\"title\"]);\n\t\t$this->setOrderNr($this->data_record[\"order_nr\"]);\n\t\t$this->setTaxonomyId($this->data_record[\"tax_id\"]);\n\t}", "function read()\n\t\t{\n\t\t\t$conn = getConnection();\n\t\t\t$query = \"SELECT * FROM student WHERE ID='\".$this->ID.\"'\";\n\t\t\t$result = mysql_query($query);\n\t\t\t\n\t\t\tif(!$result)return;\n\t\t\telse\n\t\t\t{\n\t\t\t\t$member = mysql_fetch_array($result);\n$this->setMainID(trim($member['mainID']));\t\t\n$this->setRollNo(trim($member['rollno']));\t\t\n$this->setGRno(trim($member['grno']));\n$this->setFirstName(trim($member['firstname']));\n$this->setLastName(trim($member['lastname']));\n$this->setFname(trim($member['Fname']));\n$this->setBatchObj(getBatch($member['batchID']));\n$this->setExamYear(trim($member['examyear']));\n$this->setActiveFlag(trim($member['activeflag']));\n$this->setClassObj(getBatchClass($member['classID']));\n$this->BranchObj=(getBranch($this->getBatchObj()->getID()));\n$this->setLoginFlag(trim($member['loginflag']));\n$this->setPhoneStu(trim($member['phone_stu']));\n$this->setPhoneFather(trim($member['phone_father']));\n$this->setPhoneMother(trim($member['phone_mother']));\n$this->setPicUrl(trim($member['picurl']));\n\t\t\t}\n\n\t\t}", "public function get_res_info(){\n $data = M('resources')->where('state = 0 and uid ='.$_SESSION['admin']['id'].' and ocode ='.$_SESSION['admin']['school_id'])->field('id,uptime,size,title,srctitle')->select();\n $this->successajax('',$data);\n }", "private function _get_info() {\n\n\t\t/* Grab the basic information from the catalog and return it */\n\t\t$sql = \"SELECT * FROM `access_list` WHERE `id`='\" . Dba::escape($this->id) . \"'\";\n\t\t$db_results = Dba::query($sql);\n\n\t\t$results = Dba::fetch_assoc($db_results);\n\n\t\treturn $results;\n\n\t}", "protected function read_object_from_database() {\n\t\t$this->data_store = WC_Data_Store::load( 'pos_host_outlet' );\n\n\t\tif ( $this->get_id() > 0 ) {\n\t\t\t$this->data_store->read( $this );\n\t\t}\n\t}", "function read()\n{\n $statement = selectFromDB('SELECT * FROM projecten WHERE id = ?', [$_GET['id']]);\n $content = '<table>';\n while ($data = $statement->fetch(PDO::FETCH_ASSOC)) {\n $content .=\n '<tr>' .\n '<td>' . $data['name'] . '</td>' .\n '<td>' . $data['date'] . '</td>' .\n '<td><a href=\"?page=project&function=edit&id=' . $data['id'] . '\">' . $data['date'] . '</td>' .\n '<td>' . $data['date'] . '</td>' .\n '<tr>';\n }\n return page_show($content);\n}", "public function _loadData()\n\t{\n\t\t$this->username = $this->_admin->username;\n\t\t$this->oldPassword = '';\n\t\t$this->last_name = $this->_admin->last_name;\n\t\t$this->first_name = $this->_admin->first_name;\n\t}", "public function get_data()\n {\n return $this->retrieve('SELECT * FROM isys_import LIMIT 1000;');\n }", "function read()\n\t\t{\n\t\t\t$conn = getConnection();\n\t\t\t$query = \"SELECT * FROM student WHERE ID='\".$this->ID.\"'\";\n\t\t\t$result = mysql_query($query);\n\t\t\t\n\t\t\tif(!$result)return;\n\t\t\telse\n\t\t\t{\n\t\t\t\t$member = mysql_fetch_array($result);\n$this->setMainID(trim($member['mainID']));\t\t\n$this->setRollNo(trim($member['rollno']));\t\t\n$this->setGRno(trim($member['grno']));\n$this->setFirstName(trim($member['firstname']));\n$this->setLastName(trim($member['lastname']));\n$this->setFname(trim($member['Fname']));\n$this->setBatchID($member['batchID']);\n$this->setExamYear(trim($member['examyear']));\n$this->setActiveFlag(trim($member['activeflag']));\n$this->setClassID($member['classID']);\n\n$this->setLoginFlag(trim($member['loginflag']));\n$this->setPhoneStu(trim($member['phone_stu']));\n$this->setPhoneFather(trim($member['phone_father']));\n$this->setPhoneMother(trim($member['phone_mother']));\n$this->setPicUrl(trim($member['picurl']));\n\t\t\t}\n\n\t\t}", "public function get_data()\n {\n\n\n }", "public static function readAll() {\n $tab_p = ModelProduit::selectAll();\n $controller = \"produit\";\n $view = \"listProduit\";\n $pagetitle = \"Liste des produits\";\n require File::build_path(array('view', 'view.php'));\n }", "public function all_choose_us_info_for_admin(){\r\n $query = \"SELECT * FROM tbl_aboutus_choose_us\";\r\n if(mysqli_query($this->db_connect, $query)){\r\n $query_result = mysqli_query($this->db_connect, $query);\r\n return $query_result;\r\n }else{\r\n die(\"Query Problem! \".mysqli_error($this->db_connect));\r\n }\r\n }", "public function selectdata(){\n$this->autoRender=false;\n$data=$this->connection->execute(\"select * from users\")->fetchAll();\nprint_r($data);\n}", "private function _readSubTableData() {}", "public function Individualgetdata();", "public function adminActionGet() : object\n {\n $page = $this->app->page;\n $title = \"Redigera Inlägg\";\n $db = $this->app->db;\n $id = null;\n $doDelete = null;\n $doEdit = null;\n $db->connect();\n $sql = \"SELECT * FROM content;\";\n $resultset = $db->executeFetchAll($sql);\n\n $data = [\n \"resultset\" => $resultset ?? null,\n \"id\" => $id ?? null,\n \"doEdit\" => $doEdit ?? null,\n \"doDelete\" => $doDelete ?? null,\n \"content\" => $resultset\n ];\n \n $page->add(\"cms/header\");\n $page->add(\"cms/admin\", $data);\n \n return $page->render([\n \"title\" => $title\n ]);\n }", "public function view_subadmin()\n\t{\n\t\tif ($this->checkLogin('A') == '') \n\t\t{\n\t\t\tredirect('admin');\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$this->data['heading'] = 'View Sub-Admin';\n\t\t\t$adminid = $this->uri->segment(4, 0);\n\t\t\t$condition = array('id' => $adminid);\n\t\t\t$sortArr1 = array('field' => 'created', 'type' => 'desc');\n\t\t\t$sortArr = array($sortArr1);\n\t\t\t$this->data['admin_details'] = $this->subadmin_model->get_all_details(SUBADMIN, $condition, $sortArr);\n\t\t\tif ($this->data['admin_details']->num_rows() == 1) \n\t\t\t{\n\t\t\t\t$this->data['privArr'] = unserialize($this->data['admin_details']->row()->privileges);\n\t\t\t\tif (!is_array($this->data['privArr']))\n\t\t\t\t{\n\t\t\t\t\t$this->data['privArr'] = array();\n\t\t\t\t}\n\n\t\t\t\t$this->load->view('admin/subadmin/view_subadmin', $this->data);\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\tredirect('admin');\n\t\t\t}\n\t\t}\n\t}", "public function getAdminpage() {\n\t\t // $result = mysqli_query($this->connect(), $sql);\n\t\t\t// return $result;\n\t\t}", "private function get_data()\n\t{\n\t\treturn $this->member_model->get_data();\n\t}", "public function display_sub_admin()\n\t{\n\t\tif ($this->checkLogin('A') == '') \n\t\t{\n\t\t\tredirect('admin');\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$this->data['heading'] = 'Sub-Admin Users';\n\t\t\t$condition = array('admin_rep_code' => '', 'admin_rep_type' => 'Normal');\n\t\t\t$sortArr1 = array('field' => 'id', 'type' => 'desc');\n\t\t\t$sortArr = array($sortArr1);\n\t\t\t$this->data['admin_users'] = $this->subadmin_model->get_all_details(SUBADMIN, $condition, $sortArr);\n\t\t\t\n\t\t\t$this->load->view('admin/subadmin/display_subadmin', $this->data);\n\t\t}\n\t}", "protected function load(){\r\n\t\r\n\t$qq1 = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->tableName.\" WHERE \".$this->fieldName.\" = \".(int)$this->id);\r\n\t$this->profileData = count($qq1)>0 ? $qq1[0]: null; \r\n\t\r\n\tif($this->metaUse){\r\n\t\t$qq2 = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->metaTypesTableName.\" WHERE active = 1 ORDER BY public_ord, id\");\r\n\t\t$this->metaData = count($qq2)>0 ? $qq2: array(); \r\n\t}\r\n}", "function readMenu() {\n\t\t\t\n\t\t \t\t// Let's cache a DB content very frecuently \n\t\t $tmpZip = $this->memCache->get(\"CFEditObjects\".$this->super->getOrganizationDefault());\n\t\t\t if(!strlen($tmpZip) || isset($_REQUEST['nocache'])) {\n\t\t\t\t unset($_CloudFrameWorkData);\n\t\t\t\t\tif($this->super->getOrganizationDefault() == 1) {\n\t\t\t \t\t$_CloudFrameWorkData['DirectoryObjects'] = \"%\"; \n\t\t\t\t\t\tif(isset($_GET['dbdebug'])) _print(\"INIT QUERY to retrieve Directory Objects: Calling query from menuObjects.php\"); \n\t\t\t\t\t $tmp = $this->db->CloudFrameWork(\"getRecords\",$_CloudFrameWorkData);\n\t\t\t\t\t} else { \n\t\t\t\t\t\tif(isset($_GET['dbdebug'])) _print(\"INIT QUERY to retrieve Directory Objects: Calling query from menuObjects.php\"); \n\t\t\t \t\t$_CloudFrameWorkData['DirectoryOrganization_Id'] = $this->super->getOrganizationDefault(); \n\t\t\t\t\t $tmp = $db->CloudFrameWork(\"getRecords\",$_CloudFrameWorkData,'Rel_DirectoryObjects_DirectoryOrganizations');\n\t\t\t\t\t}\n\t\t\t\t\t$this->memCache->set(\"CFEditObjects\".$this->super->getOrganizationDefault(),gzcompress(serialize($tmp)));\n\t\t\t } else {\n\t\t\t \t$tmp = unserialize(gzuncompress($tmpZip));\n\t\t\t }\n\t\t\t\t\n\t\t\t\t$this->objects['_title_'] = 'Select an object to Edit'; // Default title for objets\n\t\t\t\t\n\t\t\t\t$_found = false;\n\t\t for ($i=0,$j=0,$tr=count($tmp); $i < $tr; $i++) {\n\t\t $key = $tmp[$i]['DirectoryObject_Name'];\n\t\t\n\t\t\t\t\t// If the urlObject is include in the current objects\n\t\t if($this->urlObject == $key) {\n\t\t $_found=true;\n\t\t $this->objects['_title_'] = $tmp[$i]['DirectoryObject_LangEN'];\n\t\t\t\t\t\t\n\t\t\t\t\t\t// get from caché las version\n\t\t\t\t\t\t$tmpZip = $this->memCache->get(\"CFEditObject_\".$tmp[$i]['DirectoryObject_LangEN'].'_'.$this->super->getOrganizationDefault());\n\t\t\t\t\t\tif(!strlen($tmpZip) || isset($_REQUEST['nocache'])) {\n\t\t\t\t\t\t\t$this->selectedObject =$tmp[$i];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Read from DB Field Types\n\t\t\t\t\t\t\t$this->selectedObject['fieldDBTypes'] = $this->db->CloudFrameWork(\"getFieldTypes\",array($this->urlObject=>\"%\"));\n\t\t\t\t\t\t\t$this->processObjecFields();\n\t\t\t\t\t\t\t//_printe($this->selectedObject);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Split Labels for the object \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Put in cachñe the results..\n\t\t\t\t\t\t\t$this->memCache->set(\"CFEditObject_\".$tmp[$i]['DirectoryObject_LangEN'].'_'.$this->super->getOrganizationDefault(),gzcompress(serialize($this->selectedObject)));\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->selectedObject = unserialize(gzuncompress($tmpZip));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t $_active = true;\n\t\t } else $_active = false;\n\t\t \n\t\t // If level 0 \n\t\t if( !strlen($tmp[$i]['DirectoryObject_DirectoryObject_Id'])\n\t\t || (strlen($tmp[$i]['DirectoryObject_DirectoryObject_Id']) && $tmp[$i]['DirectoryObject_DirectoryObject_Id'] == $tmp[$i]['DirectoryObject_Id']) ) {\n\t\t\n\t\t $this->objects['_keys_'][] = $key; \n\t\t $this->objects[$key]['id'] = $key;\n\t\t $this->objects[$key]['name'] = $tmp[$i]['DirectoryObject_LangEN'];\n\t\t $this->objects[$key]['groupname'] = $tmp[$i]['DirectoryObjectsGroup_Name']; \n\t\t if(!$this->objects[$key]['active'])\n\t\t $this->objects[$key]['active'] = $_active;\n\t\t $j++; \n\t\t // level 1 asociated to DirectoryObject_DirectoryObject_Id \n\t\t } else {\n\t\t $this->objects[$tmp[$i]['DirectoryObject_DirectoryObject_Name']]['submenu'][] = array(\"id\"=>$key\n\t\t ,\"name\"=>$tmp[$i]['DirectoryObject_LangEN']\n\t\t ,\"groupname\"=>$tmp[$i]['DirectoryObjectsGroup_Name']\n\t\t ,\"active\"=>$_active\n\t\t ,\"parent\"=>$tmp[$i]['DirectoryObject_DirectoryObject_Name']\n\t\t );\n\t\t if($_active) $this->objects[$tmp[$i]['DirectoryObject_DirectoryObject_Name']]['active'] = $_active;\n\t\t \n\t\t }\n\t\t }\n\t\t\t\t\n\t\t\t\t// Deativate $this->urlObject if not found\n\t\t\t\tif(!$_found ) $this->urlObject = null;\n\t\t\t\tunset($tmp);\t\n\t\t\t\t\t\t\n\t\t\t\n\t\t}", "public function readAll2()\n {\n show_view('views/admin/post/create.php', ['bodyParts' => BodyPart::all()]);\n }", "function getData()\r\n\t{\r\n\t\t// Lets load the data if it doesn't already exist\r\n\t\tif (empty( $this->_data ))\r\n\t\t{\r\n\t\t\t$query = $this->_buildQuery();\r\n\t\t\t$this->_db->setQuery( $query );\r\n\r\n\t\t\t//$this->_data = $this->_getList( $query );\r\n\t\t\t$this->_data = $this->_db->loadObject();\r\n\r\n\t\t}\r\n\r\n\t\treturn $this->_data;\r\n\t}", "public function view_reader(){\n\t\t$result = $this->con()->query(\"Select * from req ORDER BY tdate DESC\");\n\t\treturn $result;\n\t}", "public function selectAllAdmin(){\n return $this->connect->getData(\"SELECT * FROM `tbl_admin`\");\n }", "function read(){\n $query = \"SELECT\n pantry_item_id, item_name, user_id\n FROM\n \" . $this->table_name . \";\";\n\n // prepare query statement\n $stmt = $this->conn->prepare($query);\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "public function get_adminlist(){\n \n \t\t$sql4=\"SELECT * FROM admin\";\n\t $result4 = mysqli_query($this->db,$sql4);\n\t while($adminlist_data = mysqli_fetch_array($result4)){\n echo '<tr>\n <td>'.$adminlist_data[\"admin_id\"].'</td>\n <td>'.$adminlist_data[\"name\"].'</td>\n <td>'.$adminlist_data[\"password\"].'</td>\n <td>'.$adminlist_data[\"admin_type\"].'</td>\n <td>'.$adminlist_data[\"journal_id\"].'</td>\n <td class=\"text-center\">\n <a href=\"about_admin.php?admin_id='.$adminlist_data[\"admin_id\"].'\" title=\"Edit\"><i class=\"fa fa-edit\"></i></a>\n </td>\n <td class=\"text-center\">\n <a href=\"delete.php?admin_id='.$adminlist_data[\"admin_id\"].'&type=admin\" title=\"Delete\"><i class=\"fa fa-trash-o\"></i></a>\n </td>\n </tr>';\n }\n return true;\n \t}", "function read(){\n \n // select all query\n $query = \"SELECT inv.`id`, inv.`local_id`, loc.`nombre` as local_nom, inv.`producto_id`, \n pro.`codigo`, pro.`nombre`, inv.`cantidad`, inv.`minimo_stock`\n FROM `inventario_local` as inv\n JOIN `locales` as loc ON (loc.`id` = inv.`local_id`)\n JOIN `productos` as pro ON (pro.`id` = inv.`producto_id`)\n WHERE loc.`empresa_id` = 1\";\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "public function fetchData() {\n \n $this->readMainDomain($this->base . \"/userdata/main\");\n $main[$this->mainDomain] = $this->mainDomain;\n\n $this->readAddOnDomains($this->base . \"/addons\");\n $this->readParkedDomains($this->base . \"/pds\");\n $this->readSubDomains($this->base . \"/sds2\");\n\n $this->allDomains = array_merge($this->addOnDomains, $this->subDomains);\n $this->allDomains = array_merge($this->allDomains, $this->parkedDomains);\n $this->allDomains = array_merge($this->allDomains, $main);\n\n $this->readMail($this->base . \"/homedir/.cpanel/email_accounts.yaml\");\n\n $this->readMySQL();\n $this->readUserConfig();\n $this->readHomeDir();\n }", "public function read(){\n \n //select all data\n $query = \"SELECT\n id, id, num_compte, cle_rib, duree_epargne, frais, solde, created\n FROM\n \" . $this->table_name . \"\n ORDER BY\n created\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "public function read_single(){\n $query='SELECT * FROM '.$this->table.' WHERE id=?';\n\n $stmt = $this->conn->prepare($query);\n\n $stmt->bindparam(1,$this->id);\n\n $stmt->execute();\n\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n $this->name=$row['name'];\n $this->email=$row['email'];\n $this->status=$row['status'];\n \n }", "function read()\n\t\t{\n\t\t\t$conn = getMainConnection();\n\t\t\t$query = \"SELECT * FROM student WHERE ID='\".$this->ID.\"'\";\n\t\t\t$result = mysql_query($query);\n\t\t\t\n\t\t\tif(!$result)return;\n\t\t\telse\n\t\t\t{\n\t\t\t\t$member = mysql_fetch_array($result);\n\n$this->setFirstName(trim($member['firstname']));\n$this->setLastName(trim($member['lastname']));\n$this->setPhoneStu(trim($member['phone_stu']));\n$this->setPhoneFather(trim($member['phone_father']));\n$this->setLoginFlag(trim($member['loginflag']));\n$this->setExamYear(trim($member['examyear']));\n$this->setActiveFlag(trim($member['activeflag']));\n$this->setActid(trim($member['actid']));\n$this->setDateOfBirth(trim($member['dateofbirth']));\n$this->setParentPass(trim($member['parentpass']));\n$this->setStudentPass(trim($member['studentpass']));\n$this->setLastLogin(trim($member['lastlogin']));\n$this->setInstituteIDs(trim($member['instituteIDs']));\n$this->setLoginIP(trim($member['loginip']));\n\t\t\t}\n\n\t\t}", "public function read()\n {\n // select all data\n $query = \"SELECT `id`,`name` from `\" . $this->table_name . \"` order by `name`;\";\n // $stmt = $this->conn->prepare($query);\n // var_dump($stmt);\n $q= 'select * from `categories`;';\n $stmt = ($this->conn)->query($q);\n \n $stmt->execute();\n \n return $stmt;\n }", "public function listdataAdmAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('ADMINISTRASI SYSTEM');\n }", "protected function AdminPage() {\n\t$oMenu = fcApp::Me()->GetHeaderMenu();\n\t\n\t\t\t // ($sGroupKey,$sKeyValue=TRUE,$sDispOff=NULL,$sDispOn=NULL,$sPopup=NULL)\n $oMenu->SetNode($ol = new fcMenuOptionLink('show','all','show all',NULL,'show inactive as well as active'));\n\t $doAll = $ol->GetIsSelected();\n \n\tif ($doAll) {\n\t $rs = $this->SelectRecords(NULL,'Sort');\n\t} else {\n\t $rs = $this->ActiveRecords();\n\t}\n\treturn $rs->AdminRows();\n }", "public function get_admindetails($uid){\n \n \t\t$sql3=\"SELECT * FROM admin WHERE admin_id =$uid\";\n\t $result3 = mysqli_query($this->db,$sql3);\n\t $admin_data = mysqli_fetch_array($result3);\n\t $this->a_name= $admin_data['name'];\n $this->a_password= $admin_data['password'];\n $this->a_type= $admin_data['admin_type'];\n $this->a_journal_id= $admin_data['journal_id'];\n return true;\n \t}", "public function displaydosen()\r\n {\r\n $query = \"select * from data_dosen\";\r\n return $this->db->query($query);\r\n }", "public function readAll()\n {\n show_view('views/admin/bodyparts/readAll.php', ['bodyParts' => BodyPart::all()]);\n }", "public function readall(){ //read\r\n\r\n $sql=\"select * from proveedor\";\r\n $resul=mysqli_query($this->con(),$sql);\r\n while($row=mysqli_fetch_assoc($resul)){\r\n $this->proveedores[]=$row;\r\n }\r\n return $this->proveedores;\r\n }", "public function readerdata()\n {\n \n if ($_GET['type'] == \"cierres\"){\n $xr8_data = $this->Querys->metalesRead();\n }else if ($_GET['type'] == \"one\"){\n $xr8_data = $this->Querys->metalesReadOne();\n }else if ($_GET['type'] == \"entregas\"){\n $xr8_data = $this->Querys->metalesReadEntregas();\n }else {\n $xr8_data = array(\"Error\" => 101);\n }\n\n\n $this->output->set_content_type('application/json')->set_output(json_encode($xr8_data));\n }", "private function readAll(){\r\n $results = array();\r\n \r\n if ( null !== $this->getDB() ) {\r\n $dbs = $this->getDB()->prepare('select * from about_page');\r\n \r\n if ( $dbs->execute() && $dbs->rowCount() > 0 ) {\r\n $results = $dbs->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n \r\n } \r\n return $results;\r\n }", "public function listdataAction() {\n $this->view->dataList = $this->adm_listdata_serv->getDataList('%');\n }", "function datos_subarea($id_subarea) {\n\t\n\t\t$query = \"SELECT material_subarea.*\n\t\tFROM material_subarea\n\t\tWHERE id_subac_material='$id_subarea'\";\n\n $connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\t$row=mysql_fetch_array($result);\n\t\tmysql_close($connection);\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $row;\n\t\t}\n\t}", "public function read()\n {\n // without an id we just redirect to the error page as we need the post id to find it in the database\n if (!isset($_GET['id'])) {\n call('pages', 'error'); //redirect changes the url, so call is better because we can see the id in the url\n return;\n }\n\n try {\n show_view('views/admin/bodyparts/read.php', ['product' => BodyPart::find($_GET['id'])]);\n } catch (Exception $ex) {\n call('pages', 'error');\n }\n }", "public function read(){\n //create query\n $query = 'SELECT\n c.category_name as category_name,\n l.language_name as language_name,\n i.name as instructor_name,\n p.id,\n p.title,\n p.category_id,\n p.description,\n p.language_medium_id,\n p.image,\n p.instructor_id,\n p.created_at\n \n \n FROM\n ' .$this->table . ' p\n LEFT JOIN course_categories c ON p.category_id = c.id \n LEFT JOIN users i ON p.instructor_id = i.id \n LEFT JOIN language_mediums l ON p.language_medium_id = l.id\n ORDER BY p.created_at DESC'; \n \n\n //prepare statement\n $stmt = $this->conn->prepare($query);\n //execute query\n $stmt->execute();\n\n return $stmt;\n\n }", "function _read($id) {\n $result = ee()->db->select('data')\n ->where('id', $id)\n ->get($this->table_name);\n\n if (!$result->num_rows()) {\n return '';\n }\n\n return $result->row()->data;\n }", "function field(){\n\t\t\t$this->aah->check_access();\n\n\t\t\t$nav_id = $this->aah->get_nav_id(__CLASS__.'/field');\n\t\t\t$read_access = $this->aah->check_privilege('read',$nav_id);\n\t\t\t$add_access = $this->aah->check_privilege('add',$nav_id);\n\n\t\t\tif($read_access)\n\t\t\t{\n\t\t\t\t$this->global_model->reinitialize_dao();\n\t\t\t\t$dao = $this->global_model->get_dao();\n\t\t\t\t$data['active_url'] = str_replace('::','/',__METHOD__);\n\t\t\t\t$data['dt2_rows'] = $dao->execute(0,\"SELECT * FROM ref_dt2 WHERE provinsi_id='\".$this->_SYS_PARAMS[1].\"'\")->result_array();\n\t\t\t\t$data['form_id'] = \"search-school-form\";\n\t\t\t\t$data['active_controller'] = $this->active_controller;\n\t\t\t\t$data['containsTable'] = true;\n\t\t\t\t$data['add_access'] = $add_access;\n\t\t\t\t$this->backoffice_template->render($this->active_controller.'/field/index',$data);\n\t\t\t}else{\n\t\t\t\t$this->error_403();\n\t\t\t}\n\t\t}", "public function staffAllDataShow()\n\t\t{\n\t\t\t$sql = \"SELECT * FROM staffs\";\n\t\t\t$data = parent::dbConnection() -> query($sql);\n\t\t\treturn $data;\n\t\t}", "public function getData(){\n\t\t$db = new Database();\n\t\t$dbConnect = $db->connect();\n\t\t$sql = \"SELECT * FROM user\";\n\t\t$data = $dbConnect->query($sql);\n\t\t$dbConnect = $db->close();\n\t\treturn $data;\n\t}", "function readSearchView(){\n\t\t// fe_user access management can read \n\t\t$rec = $this->model->get_fecruserid($this->rec_id); \n\t\t$access = $this->accessObj->checkAccess($rec,'pageSearch','read');\n\t\tif(!(bindec($access) & bindec('0100'))){\n\t\t\t$this->cmd = 'canNotRead';\n\t\t\t// Get the FORM\n\t\t\t$content = $this->get_include_contents('view_canNotAccess.php');\n\t\t\treturn $content; \n\t\t}\n\t\t$queryConf['startingPoint'] = $this->startingPoint;\t\n\t\t// template for the view\n\t\t$lot = $this->model->select($this->rec_id,$queryConf);\n\t\tif($lot){ \n\t\t\t// fe_user access management\n\t\t\t$access = $this->accessObj->checkAccess($lot[$this->rec_id],'pageSearch','read');\n\t\t\tif(!(bindec($access) & bindec('0100'))){\n\t\t\t\t$this->cmd = 'readForbidden';\n\t\t\t\t$this->data = '';\t\t\t\n\t\t\t}else{\n\t\t\t\t$this->cmd = 'read';\n\t\t\t\t$this->data = $lot[$this->rec_id];\n\t\t\t}\n\t\t}\n\t\t$content = $this->get_include_contents('view_searchDetails.php');\n\t\t\n\t\treturn $content;\n\t}", "protected function loadData()\n\t{\n\t\t$delimiter = \"|||---|||---|||\";\n\t\t$command = 'show --pretty=format:\"%an'.$delimiter.'%ae'.$delimiter.'%cd'.$delimiter.'%s'.$delimiter.'%B'.$delimiter.'%N\" ' . $this->hash;\n\n\t\t$response = $this->repository->run($command);\n\n\t\t$parts = explode($delimiter,$response);\n\t\t$this->_authorName = array_shift($parts);\n\t\t$this->_authorEmail = array_shift($parts);\n\t\t$this->_time = array_shift($parts);\n\t\t$this->_subject = array_shift($parts);\n\t\t$this->_message = array_shift($parts);\n\t\t$this->_notes = array_shift($parts);\n\t}", "public function show_slider_detail()\n\t{\n\t\t$sql=\"select * from slider\";\n\t\t$result=$this->db->query($sql);\n\t\twhile($data=$result->fetch_array())\n\t\t{\n\t\t\techo \"<li><h3>$data[title]</h3><p>$data[description]</p></li>\";\n\t\t}\n\t}", "public function showData(){\n\t\t//$sql = \"SELECT * FROM EC_GR_STATUS WHERE LOT_NUMBER = 66\";\n\n\t\t//$sql = \"UPDATE EC_GR_STATUS SET STATUS=1 WHERE STATUS = 4\";\n\t\t//$sql = \"UPDATE EC_GR_LOT SET STATUS=1 WHERE STATUS = 4\";\n\t\t//$data = $this->db->query($sql);\n\n\t\t//$sql = \"SELECT * FROM EC_ROLE_ACCESS WHERE ROLE_AS = 'APPROVAL GR LVL 1' AND OBJECT_AS = 'LEVEL'\";\n\t\t//$sql = \"UPDATE EC_ROLE_ACCESS SET VALUE='1,4' WHERE ROLE_AS = 'APPROVAL GR LVL 1' AND OBJECT_AS = 'LEVEL'\";\n\t\t//$data = $this->db->query($sql)->result_array();\n\t\tvar_dump($this->session->userdata);\n\t}", "public function getData()\n\t{\n\t\t$dataReader = (new Query())->select(['vtiger_module_dashboard.*', 'vtiger_links.linklabel'])\n\t\t\t->from('vtiger_module_dashboard')\n\t\t\t->innerJoin('vtiger_module_dashboard_blocks', 'vtiger_module_dashboard_blocks.id = vtiger_module_dashboard.blockid')\n\t\t\t->innerJoin('vtiger_links', 'vtiger_links.linkid = vtiger_module_dashboard.linkid')\n\t\t\t->where([\n\t\t\t\t'vtiger_module_dashboard_blocks.dashboard_id' => $this->dashboardType,\n\t\t\t\t'vtiger_module_dashboard_blocks.tabid' => Module::getModuleId($this->moduleName),\n\t\t\t\t'vtiger_module_dashboard_blocks.authorized' => $this->application,\n\t\t\t])\n\t\t\t->createCommand()->query();\n\t\t$widgets = [];\n\t\twhile ($row = $dataReader->read()) {\n\t\t\t$row['linkid'] = $row['id'];\n\t\t\tif ('Mini List' === $row['linklabel']) {\n\t\t\t\t$minilistWidgetModel = new \\Vtiger_MiniList_Model();\n\t\t\t\t$minilistWidgetModel->setWidgetModel(\\Vtiger_Widget_Model::getInstanceFromValues($row));\n\t\t\t\t$headers = $records = [];\n\t\t\t\t$headerFields = $minilistWidgetModel->getHeaders();\n\t\t\t\tforeach ($headerFields as $fieldName => $fieldModel) {\n\t\t\t\t\t$headers[$fieldName] = Language::translate($fieldModel->getFieldLabel(), $fieldModel->getModuleName());\n\t\t\t\t}\n\t\t\t\tforeach ($minilistWidgetModel->getRecords('all') as $recordModel) {\n\t\t\t\t\tforeach ($headerFields as $fieldName => $fieldModel) {\n\t\t\t\t\t\t$records[$recordModel->getId()][$fieldName] = $recordModel->getDisplayValue($fieldName, $recordModel->getId(), true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$widgets[] = [\n\t\t\t\t\t'type' => $row['linklabel'],\n\t\t\t\t\t'data' => [\n\t\t\t\t\t\t'title' => \\App\\Language::translate($minilistWidgetModel->getTitle(), $minilistWidgetModel->getTargetModule()),\n\t\t\t\t\t\t'modulename' => $minilistWidgetModel->getTargetModule(),\n\t\t\t\t\t\t'headers' => $headers,\n\t\t\t\t\t\t'records' => $records\n\t\t\t\t\t]\n\t\t\t\t];\n\t\t\t} elseif ('ChartFilter' == $row['linklabel']) {\n\t\t\t\t$chartFilterWidgetModel = new \\Vtiger_ChartFilter_Model();\n\t\t\t\t$chartFilterWidgetModel->setWidgetModel(\\Vtiger_Widget_Model::getInstanceFromValues($row));\n\t\t\t\t$widgets[] = [\n\t\t\t\t\t'type' => $row['linklabel'],\n\t\t\t\t\t'data' => [\n\t\t\t\t\t\t'title' => $chartFilterWidgetModel->getTitle(),\n\t\t\t\t\t\t'modulename' => $chartFilterWidgetModel->getTargetModule(),\n\t\t\t\t\t\t'stacked' => $chartFilterWidgetModel->isStacked() ? 1 : 0,\n\t\t\t\t\t\t'colorsFromDividingField' => $chartFilterWidgetModel->areColorsFromDividingField() ? 1 : 0,\n\t\t\t\t\t\t'filterIds' => $chartFilterWidgetModel->getFilterIds(),\n\t\t\t\t\t\t'typeChart' => $chartFilterWidgetModel->getType(),\n\t\t\t\t\t\t'widgetData' => $chartFilterWidgetModel->getChartData(),\n\t\t\t\t\t]\n\t\t\t\t];\n\t\t\t}\n\t\t}\n\t\treturn $widgets;\n\t}", "function ambil_data_on_going()\n\t{\n\t\t\n\t\t$sql=\"SELECT * FROM irena_view_sbsn_on_going\";\n\t\treturn $this->db->query($sql);\n\t}", "private function getData()\n\t{\n\t\t// get the gallery record\n\t\t$this->record = BackendSlideshowModel::getImage($this->id);\n\t\t$this->record2 = BackendSlideshowModel::getGallery($this->galleryId);\n\t\t\n\t}", "public static function readOrga(){\n if(ModelBenevole::isValide($_SESSION['login'], $_GET['IDFestival'])){\n $tab_b = ModelBenevole::readAllOrga($_GET['IDFestival']); //appel au modèle pour gerer la BD\n $controller = 'benevole';\n $view = 'list';\n $pagetitle = 'Liste des organisateurs';\n require_once (File::build_path(array('view','view.php'))); //\"redirige\" vers la vue\n }else{\n $controller = 'benevole';\n $view = 'error';\n $pagetitle = 'Vous n\\'avez pas les droits ';\n }\n }", "public function get_data()\n\t{\n\t\t//get administrators\n\t\t$record_set = $this->connection->query\n\t\t(\"\n\t\t\tselect\n\t\t\t\tAdministratorID as ID, \" .\n\n\t\t\t\t$this->nullsafe_concat\n\t\t\t\t(\n\t\t\t\t\t\"FirstName\", \"' '\",\n\t\t\t\t\t\"concat(left(MiddleName, 1), '. ')\",\n\t\t\t\t\t\"LastName\", \"' '\",\n\n\t\t\t\t) . \" as selection\n\n\t\t\tfrom Administrator\n\t\t\");\n\t\t$records = $record_set->fetchAll();\n\n\t\treturn $records;\n\n\t}", "public function hapusDataAdmin($id)\n\t{\n\t\treturn $this->db->get($id);\n\t}", "function einstellungen_data ()\n\t{\n\t\t$sql = sprintf(\"SELECT * FROM %s WHERE bgalset_id='1'\",\n\t\t\t$this->db_praefix.\"ecard_einstellungen\"\n\t\t);\n\t\t$temp_return = $this->db->get_row($sql, ARRAY_A);\n\t\treturn $temp_return;\n\t}", "public function readTable()\n {\n $sql = \"SELECT Cubans.Id, FirstName, LastName, Gender, YearOfBirth, \n `Name`, IsInGroup FROM Cubans\n JOIN Genre ON Cubans.IdGenre=Genre.id\";\n $statement = $this->connect->prepare($sql);\n $statement->execute();\n return $statement->fetchAll();\n }", "function user_details ()\n\t\t{\n\t\t $query = \"select * from user_details\" ; \n\t\t\t$data = mysql_query($query) ;\n\t\t\treturn $data ; \n\t\t}", "protected function getAdminData ():CRUDDatas{\n\t\treturn new CRUDDatas();\n\t}", "public static function read(){\n $v = ModelVoiture::select($_GET['IdV']);\n if ($v){\n $controller = 'voiture';\n $view = 'detail';\n $pagetitle = 'Votre voiture';\n require file::build_path(array(\"view\",\"view.php\"));\n }\n else {\n $controller = 'voiture';\n $view = 'pasVoiture';\n $pagetitle = 'erreur';\n require file::build_path(array(\"view\", \"view.php\"));\n }\n }", "public function entry() {\n $arr_set = $this->opm->arr_settings;\n $arr_tmp = array();\n // Get value id\n $iditem = $this->get_id();\n if ($iditem == '')\n $iditem = $this->get_last_id();\n\n $this->set('iditem', $iditem);\n //Load record by id\n if ($iditem != '') {\n $arr_tmp = $this->opm->select_one(array('_id' => new MongoId($iditem)));\n foreach ($arr_set['field'] as $ks => $vls) {\n foreach ($vls as $field => $values) {\n if (isset($arr_tmp[$field])) {\n $arr_set['field'][$ks][$field]['default'] = $arr_tmp[$field];\n if (preg_match(\"/_date$/\", $field) && is_object($arr_tmp[$field]))\n $arr_set['field'][$ks][$field]['default'] = date('m/d/Y', $arr_tmp[$field]->sec);\n if (in_array($field, $arr_set['title_field']))\n $item_title[$field] = $arr_tmp[$field];\n if ($field == 'contact_name' && isset($arr_tmp['contact_last_name'])) {\n $arr_set['field'][$ks][$field]['default'] = $arr_tmp[$field] . ' ' . $arr_tmp['contact_last_name'];\n $item_title['contact_name'] = $arr_tmp[$field] . ' ' . $arr_tmp['contact_last_name'];\n }\n }\n }\n }\n\n $arr_set['field']['panel_1']['mongo_id']['default'] = $iditem;\n $this->Session->write($this->name . 'ViewId', $iditem);\n\n //BEGIN custom\n if (isset($arr_set['field']['panel_1']['code']['default']))\n $item_title['code'] = $arr_set['field']['panel_1']['code']['default'];\n else\n $item_title['code'] = '1';\n $this->set('item_title', $item_title);\n\n //END custom\n $this->set('address_lock', '1');\n //END custom\n //show footer info\n $this->show_footer_info($arr_tmp);\n\n\n //add, setup field tự tăng\n }else {\n $nextcode = $this->opm->get_auto_code('code');\n $arr_set['field']['panel_1']['code']['default'] = $nextcode;\n $this->set('item_title', array('code' => $nextcode));\n }\n\n $this->set('arr_settings', $arr_set);\n $this->sub_tab_default = 'general';\n $this->sub_tab('', $iditem);\n parent::entry();\n }", "function getDataAdminAccount() {\r\n\t\t\t$query = $this->pdo->prepare('select * from admin_account');\r\n\t\t\t$query->execute();\r\n\t\t\treturn $query->fetchAll();\r\n\t\t}", "function readInputData() {\n\t\t$this->readUserVars(array('title', 'description', 'journalPath', 'enabled'));\n\t\t$this->setData('enabled', (int)$this->getData('enabled'));\n\n\t\tif (isset($this->journalId)) {\n\t\t\t$journalDao =& DAORegistry::getDAO('JournalDAO');\n\t\t\t$journal =& $journalDao->getById($this->journalId);\n\t\t\t$this->setData('oldPath', $journal->getPath());\n\t\t}\n\t}", "public function adminProduct()\n {\n $this->db->connect();\n $sql = \"SELECT * FROM $this->table;\";\n $resultset = $this->db->executeFetchAll($sql);\n return $resultset;\n }", "function userpage_getfield($id, $display, $uid)\r\n{\r\n\tglobal $AVE_DB, $AVE_Template;\r\n\r\n\t$sql_a = $AVE_DB->Query(\"\r\n\t\tSELECT *\r\n\t\tFROM \" . PREFIX . \"_modul_userpage_items\r\n\t\tWHERE active = '1'\r\n\t\tAND id = '\" . $id . \"'\r\n\t\");\r\n\t$row_a = $sql_a->FetchRow();\r\n\r\n\t$sql_b = $AVE_DB->Query(\"\r\n\t\tSELECT *\r\n\t\tFROM \" . PREFIX . \"_modul_userpage_values\r\n\t\tWHERE uid = '\" . $uid . \"'\r\n\t\");\r\n\t$row_b = $sql_b->FetchRow();\r\n\r\n\t$show = true;\r\n\r\n\tif ($row_a->type == 'dropdown')\r\n\t{\r\n\t\t$fid = 'f_' . $row_a->Id;\r\n\t\t$drop = explode(',', $row_a->value);\r\n\r\n\t\t$titel = $row_a->title;\r\n\t\t$wert = $drop[$row_b->$fid];\r\n\r\n\t\tif ($wert == '') $show = false;\r\n\t}\r\n\telseif ($row_a->type == 'multi')\r\n\t{\r\n\t\t$fid = 'f_' . $row_a->Id;\r\n\t\t$titel = $row_a->title;\r\n\t\t$drop = explode(',', $row_a->value);\r\n\t\t$values = explode(',', $row_b->$fid);\r\n\r\n\t\tif ($row_b->$fid == '') $show = false;\r\n\r\n\t\t$wert = '<ul>';\r\n\r\n\t\tforeach ($values as $item)\r\n\t\t{\r\n\t\t\t$wert .= '<li>' . $drop[$item] . '</li>';\r\n\t\t}\r\n\r\n\t\t$wert .= '</ul>';\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$fid = 'f_' . $row_a->Id;\r\n\t\t$titel = $row_a->title;\r\n\t\t$wert = $row_b->$fid;\r\n\r\n\t\tif ($wert == '') $show = false;\r\n\t}\r\n\r\n\tif ($show != false)\r\n\t{\r\n\t\t$wert = nl2br(preg_replace(\"/\\[([\\/]?)([biuBIU]{1})\\]/\", \"<\\$1\\$2>\", $wert));\r\n \t\t$AVE_Template->assign('titel', $titel);\r\n\t\t$AVE_Template->assign('wert', $wert);\r\n\t\t$AVE_Template->display(BASE_DIR . '/modules/userpage/templates/felder-' . $display . '.tpl');\r\n\t}\r\n}", "public function getInfoFromDatabase() {\n $db = \\Helper::getDB();\n $db->join('users u', 'd.ownerId = u.id', 'LEFT');\n $db->where('d.id', $db->escape((int) $this->getId()));\n // Prevent getting a document with a presentation ID or some other wrong combination\n if($this->getType() != '') {\n $db->where('d.type', $db->escape($this->getType()));\n }\n $result = $db->getOne('documents d', '*, d.id AS documentId, u.id AS userId');\n\n if($result) {\n $this->title = $result['title'];\n $this->type = $result['type'];\n $this->creationDate = $result['creationDate'];\n $this->modificationDate = $result['modificationDate'];\n $this->user = new \\Models\\User($result['userId'], $result['username'], $result['email'], $result['firstName'], $result['lastName'], $result['lastLogin']);\n $this->file = $result['file'];\n } else {\n throw new \\Exception('Document not found', 5);\n }\n }", "function getAdminDetails($id) {\r\n $query = $this->db->get_where('nc_poll_detail', array('id' => $id));\r\n\r\n if ($query->num_rows() == 0) {\r\n return 0;\r\n } else {\r\n return $query->row();\r\n }\r\n }", "function bacaDataadmin($field, $id_admin_agt) {\n $query = \"SELECT * FROM admin WHERE id_admin = '$id_admin_agt'\";\n $hasil = mysql_query($query);\n $data = mysql_fetch_array($hasil);\n if ($field == 'username')\n return $data['username'];\n else if ($field == 'password')\n return $data['password'];\n }", "function read($a_force_db = false)\n\t{\n\t\tparent::read($a_force_db);\n\t\t$this->loadFromDb();\n\t}", "function read(){\n //select all data\n $query = \"SELECT * FROM \" . $this->table_name . \" ORDER BY id\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }" ]
[ "0.6297483", "0.62365234", "0.61806744", "0.61239374", "0.610616", "0.6102039", "0.6079167", "0.6063426", "0.6063426", "0.6063426", "0.6062703", "0.6044234", "0.60383993", "0.6034122", "0.6012618", "0.6010886", "0.59998375", "0.5981118", "0.5964753", "0.59631574", "0.5928864", "0.5926604", "0.59004635", "0.5887592", "0.5883624", "0.58825", "0.5875983", "0.5862619", "0.58393735", "0.5837621", "0.5830526", "0.58231175", "0.5816739", "0.58132696", "0.5806852", "0.58044755", "0.5795173", "0.5770326", "0.575891", "0.5754", "0.57443064", "0.5739132", "0.5737934", "0.57371956", "0.57367224", "0.5729933", "0.57259804", "0.5718533", "0.5708109", "0.56894344", "0.5688916", "0.5687904", "0.5684201", "0.5679814", "0.56761956", "0.56715685", "0.56654507", "0.56570685", "0.5648597", "0.56425667", "0.56423503", "0.5641799", "0.5641131", "0.5634572", "0.56316537", "0.5630446", "0.5630002", "0.56293464", "0.5628782", "0.56216884", "0.5621552", "0.5618035", "0.5614434", "0.561227", "0.5605701", "0.5602897", "0.56009525", "0.5599541", "0.5599536", "0.55985725", "0.5592418", "0.5591966", "0.5590872", "0.5590463", "0.558915", "0.55850464", "0.55813026", "0.55777603", "0.5576134", "0.5574362", "0.55743307", "0.5573806", "0.5570836", "0.55657893", "0.55647254", "0.5560615", "0.5553389", "0.55520624", "0.5549925", "0.5548499", "0.55451804" ]
0.0
-1
$condition = "vendor.anoti = 0";
public function GetNewVendorsDataNoti() { $this->db->select('*,city.city_name,area.area_name'); $this->db->from('vendor'); $this->db->join('city','city.city_id=vendor.city_id','left'); $this->db->join('area','area.area_id=vendor.area_id','left'); $this->db->where('vendor.verified',0); //$this->db->where($condition); $query = $this->db->get(); return $query->result(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wcfmgs_group_manager_enquery_filter( $sql ) {\r\n \t\r\n \tif( !wcfm_is_vendor() && empty( $_POST['enquiry_vendor'] ) ) {\r\n \t\t$is_marketplace = wcfm_is_marketplace();\r\n\t\t\tif( $is_marketplace ) {\r\n\t\t\t\t$allow_vendors = $this->wcfmgs_group_manager_allow_vendors_list( array(0), $is_marketplace );\r\n\t\t\t\t$sql .= \" AND `vendor_id` IN (\" . implode( ',', $allow_vendors ) . \")\";\r\n\t\t\t}\r\n \t}\r\n \t\r\n \treturn $sql;\r\n }", "public function buildConditionQuery()\n\t\t\t{\n\t\t\t\t$this->sql_condition = ' user_id='.$this->CFG['user']['user_id'];\n\t\t\t}", "function get_filter_condition($conditional_symbol) {\n //explicitly prevent filters from beign automatically applied to the report query\n return '';\n }", "function product_novendor()\n\t{\n\t\tglobal $log;\n\t\t$log->debug(\"Entering product_novendor() method ...\");\n\t\t$query = \"SELECT ec_products.productname, ec_products.deleted\n\t\t\tFROM ec_products\n\t\t\tWHERE ec_products.deleted = 0\n\t\t\tAND ec_products.vendor_id is NULL\";\n\t\t$result=$this->db->query($query);\n\t\t$log->debug(\"Exiting product_novendor method ...\");\n\t\treturn $this->db->num_rows($result);\n\t}", "private function getSQLCondition() {\n\t\t// the manager can see everyone in the department\n\t\t// the admin and everybody else can see everyone in the company.\n\t\tswitch ($this->page->config['user_level']) {\n\t\t\tcase lu_manager:\n\t\t\tcase lu_employee:\n\t\t\tcase lu_admin:\n\t\t\t\t$sql = 'WHERE 1 = 2';\n\t\t\t\tbreak;\t//nobody below GM can access this subject\n\t\t\tcase lu_gm:\n\t\t\tcase lu_owner:\n\t\t\t\t$sql = ' WHERE c.company_id = '.$this->page->company['company_id'];\n\t\t}\n\t\treturn $sql;\n\t}", "function s_m_put_get_condition($ref_id_db_arr, $ref_data){\r\n $where = \"\";\r\n for($i = 0; $i < count($ref_id_db_arr); $i++){\r\n $where .= $ref_id_db_arr[$i] . \"='\" . $ref_data[$i] . \"'' AND \";\r\n }\r\n return substr($where, 0, strlen($where) - 5);\r\n}", "public function getCondition() { \n \t\treturn $this->condition . tx_newspaper::enableFields(tx_newspaper::getTable($this)); \n \t}", "public function testConditionOverride() {\n\t\t$products = $this->productsManager->filter(Attr::id()->lt(3))->find(Attr::category()->eq('Clothes'));\n\t\t$this->assertCount(3, $products);\n\t}", "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 getConditions($form = null) {\n\t\treturn 'messageTable.isDeleted = 0 AND messageTable.isDisabled = 0';\n\t}", "public function testConditionClause()\n {\n $condition = $this->getConnection()\n ->condition()\n (\"WHERE blog_id = :id\");\n return $this->assertEquals($condition, \"WHERE blog_id = :id\");\n }", "protected function user_where_clause() {}", "function getJoinCondition() ;", "public function getViaTableCondition();", "private function getSQLCondition() {\n\t\t// the manager can see everyone in the department\n\t\t// the admin and everybody else can see everyone in the company.\n\t\tswitch ($this->page->config['user_level']) {\n\t\t\tcase lu_manager:\n\t\t\tcase lu_employee:\n\t\t\tcase lu_admin:\n\t\t\tcase lu_gm:\n\t\t\tcase lu_owner:\n\t\t\t\t$sql = ' WHERE l.company_id = '.$this->page->company['company_id'];\n\t\t}\n\t\treturn $sql;\n\t}", "function filter($value) {\n return strpos('vendors', $value) === false ? true : false;\n }", "function beforeFind($queryData) {\r\n\t\t\t\t\tif (is_array($queryData['conditions'])) {\r\n\t\t\t\t\t\t$queryData['conditions']['Auction.deleted']=0;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$queryData['conditions'].=' AND Auction.deleted=0';\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn $queryData;\r\n\t\t\t\t}", "function fn_product_condition_get_product_data($product_id, &$field_list, $join, $auth, $lang_code, $condition) {\r\n $field_list .= 'condition';\r\n}", "private function conditions(DBConnection $conn, Peer $peer) {\n $cond= '';\n foreach ($this->conditions as $condition) $cond.= $condition->asSql($conn, $peer).' and ';\n return substr($cond, 0, -5);\n }", "public function ifProduitexiste($condition){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t$existe=$this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\tif($existe != null)\n\t\t\t\t\t {\n\t\t\t\t\t return 1;\n\t\t\t\t\t } \n\t\t\t\t\treturn 0;\n\t\t\t\t\t }", "protected function _buildWhere(&$query)\r\n {\r\n\r\n\r\n \t//if($this->_checkin!=null)\r\n \t//{\r\n \t//\t$query->where('ltap.ltap_qdatu = \"'.$this->_confdate.'\"');\r\n \t//}\r\n return $query;\r\n }", "public function getSystemIds()\r\n{\r\n $query_string = \"SELECT systemid FROM voting_system \";\r\n $query_string .= \"WHERE systemname = :systemname AND systemid != :systemid\";\r\n\r\n return $query_string;\r\n\r\n}", "function beforeFind($queryData) {\n\t\t\tif (is_array($queryData['conditions'])) {\n\t\t\t\t$queryData['conditions']['Product.deleted']=0;\n\t\t\t} else {\n\t\t\t\t$queryData['conditions'].=' AND Product.deleted=0';\n\t\t\t}\n\t\t\treturn $queryData;\n\t\t}", "public function zero()\n {\n $this->assertFalse($this->orCriterion->hasCriterion());\n $this->orCriterion->toSQL();\n }", "function neworder_where(){\n\t\treturn false;\n\t}", "function whereQuery() {\n // $arrDate1 = explode(\"-\", $bulantahunpenggajian);\n // $date1 = $arrDate1[0].'-'.$arrDate1[1].'-01';\n // $date2 = $arrDate1[0].'-'.$arrDate1[1].'-'.cal_days_in_month(CAL_GREGORIAN, $arrDate1[1], $arrDate1[0]);\n \n // $wer = \" A.MONTH = '\".$arrDate1[1].\"' AND A.YEAR = \".$arrDate1[0].\"\";\n \n // return $wer;\n return '';\n }", "public function getCondition();", "public function getCondition();", "public function getCondition();", "protected function _getUpdateCondition($tableName)\r\n\t{\r\n\t\treturn 'resource_purchased_id = ' . $this->_db->quote($this->getExisting('resource_purchased_id'));\r\n\t}", "public function condition(): string\r\n {\r\n return (string) $this->condition;\r\n }", "private function _buildWhereClause($select)\n {\n global $zdb, $login;\n\n try {\n if ( $this->_start_date_filter != null ) {\n $d = new \\DateTime($this->_start_date_filter);\n $select->where('date_debut_cotis >= ?', $d->format('Y-m-d'));\n }\n\n if ( $this->_end_date_filter != null ) {\n $d = new \\DateTime($this->_end_date_filter);\n $select->where('date_debut_cotis <= ?', $d->format('Y-m-d'));\n }\n\n if ( $this->_payment_type_filter != null ) {\n $select->where('type_paiement_cotis = ?', $this->_payment_type_filter);\n }\n\n if ( $this->_from_transaction !== false ) {\n $select->where(\n Transaction::PK . ' = ?',\n $this->_from_transaction\n );\n }\n\n if ( $this->_max_amount !== null && is_int($this->_max_amount)) {\n $select->where(\n '(montant_cotis <= ' . $this->_max_amount .\n ' OR montant_cotis IS NULL)'\n );\n }\n $sql = $select->__toString();\n\n if ( !$login->isAdmin() && !$login->isStaff() ) {\n //non staff members can only view their own contributions\n $select->where('p.' . Adherent::PK . ' = ?', $login->id);\n } else if ( $this->_filtre_cotis_adh != null ) {\n $select->where('p.' . Adherent::PK . ' = ?', $this->_filtre_cotis_adh);\n }\n if ( $this->_filtre_transactions === true ) {\n $select->where('a.trans_id ?', new \\Zend_Db_Expr('IS NULL'));\n }\n $qry = $select->__toString();\n Analog::log(\n \"Query was:\\n\" . $qry,\n Analog::DEBUG\n );\n } catch (\\Exception $e) {\n /** TODO */\n Analog::log(\n __METHOD__ . ' | ' . $e->getMessage(),\n Analog::WARNING\n );\n }\n }", "public function isFromVendor(): bool;", "function data_term_condition() {\n return $this->db->get('t_page_term_condition');\n }", "function where_verified($status = 1) {\n\t\t$this->db->where(array('PPR_STTVER' => $status));\n\t}", "public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}", "public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}", "protected function getCondition(array $data) : string {\n\n\t\t\treturn implode(' AND ', array_filter($this->config->castArray($data, true)));\n\t\t}", "function stockremove_check_license_use()\n {\n $q = $this->db->where('action_type', 'install')\n ->where('license', $this->input->post('license_num'))\n ->where('company_id', $this->session->userdata('company_id'))\n ->limit(1)->get('software');\n\n if ($q->num_rows == 1)\n {\n return true;\n\n } else {\n\n return false;\n }\n\n }", "public function testOrCondition() {\n\t\t$products = $this->productsManager->find(Q::orfilter(Attr::id()->eq(5), Attr::id()->eq(3)));\n\t\t$this->assertCount(2, $products);\n\t}", "public function clearCondition(){\n\t\t$this->where=\"\";\n\t}", "public function setViaTableCondition($value);", "function simplenews_build_subscription_filter_query(SelectQueryInterface $query) {\n if (isset($_SESSION['simplenews_subscriptions_filter'])) {\n foreach ($_SESSION['simplenews_subscriptions_filter'] as $key => $value) {\n switch ($key) {\n case 'list':\n if ($value != 'all') {\n list($key, $value) = explode('-', $value, 2);\n $query->condition('su.' . $key, $value);\n }\n break;\n case 'email':\n if (!empty($value)) {\n $query->condition('sn.mail', '%' . $value . '%', 'LIKE');\n }\n break;\n }\n }\n }\n}", "function carton_exclude_order_comments_from_feed_where( $where ) {\n\tglobal $wpdb;\n\n if ( $where )\n \t$where .= ' AND ';\n\n\t$where .= \" $wpdb->posts.post_type NOT IN ('shop_order') \";\n\n return $where;\n}", "public function count_condition($param = 0)\n\t{\n\t\t$query = $this->db->query(\"SELECT kondisi FROM tb_inventori_item WHERE kondisi = ?\", array($param));\n\t\treturn $query->num_rows();\n\t}", "private function grup_sql()\n\t{\n\t\tif ($this->session->grup == 4)\n\t\t{\n\t\t\t$kf = $this->session->user;\n\t\t\t$filter_sql= \" AND a.id_user = $kf\";\n\t\t\treturn $filter_sql;\n\t\t}\n\t}", "function accesrestreint_rubriques_accessibles_where($primary,$not='NOT', $_publique=''){\r\n\tif (!$_publique) $_publique = \"!test_espace_prive()\";\r\n\treturn \"sql_in('$primary', accesrestreint_liste_rubriques_exclues($_publique), '$not')\";\r\n}", "public function ifV_article_en_stockexiste($condition){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t$existe=$this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\tif($existe != null)\n\t\t\t\t\t {\n\t\t\t\t\t return 1;\n\t\t\t\t\t } \n\t\t\t\t\treturn 0;\n\t\t\t\t\t }", "public function rawFilter($filter) {\n\t\t$query = InventorySummary::orderBy('Client_SKU', 'asc');\n\t\tif(isset($filter['objectID']) && strlen($filter['objectID']) > 3) {\n\t\t\t$query = $query->where('objectID', 'like', $filter['objectID'] . '%');\n\t\t}\n\t\tif(isset($filter['Client_SKU']) && strlen($filter['Client_SKU']) > 3) {\n\t\t\t$query = $query->where('Client_SKU', 'like', $filter['Client_SKU'] . '%');\n\t\t}\n\t\tif(isset($filter['Description']) && strlen($filter['Description']) > 3) {\n\t\t\t$query = $query->where('Description', 'like', $filter['Description'] . '%');\n\t\t}\n\n /*\n * Pick face quantity choices\n */\n if(isset($filter['pickQty_rb'])) {\n if($filter['pickQty_rb'] == 'zero') {\n $query = $query->where('pickQty', '=', '0');\n } elseif($filter['pickQty_rb'] == 'belowMin') {\n $query = $query->where('pickQty', '<', '3');\n } elseif($filter['pickQty_rb'] == 'aboveMin') {\n $query = $query->where('pickQty', '>', '2');\n }\n }\n\n /*\n * Activity location quantity choices\n */\n if(isset($filter['actQty_rb'])) {\n if($filter['actQty_rb'] == 'zero') {\n $query = $query->where('actQty', '=', '0');\n } elseif($filter['actQty_rb'] == 'aboveZero') {\n $query = $query->where('actQty', '>', '0');\n }\n }\n\n /*\n * Reserve quantity choices\n */\n if(isset($filter['resQty_rb'])) {\n if($filter['resQty_rb'] == 'zero') {\n $query = $query->where('resQty', '=', '0');\n } elseif($filter['resQty_rb'] == 'aboveZero') {\n $query = $query->where('resQty', '>', '0');\n }\n }\n\n /*\n * Replen Priority choices\n */\n if(isset($filter['replenPrty_cb_noReplen'])\n or isset($filter['replenPrty_cb_20orBelow'])\n or isset($filter['replenPrty_cb_40orBelow'])\n or isset($filter['replenPrty_cb_60orBelow'])) {\n $query->where(function ($query) use ($filter) {\n if (isset($filter['replenPrty_cb_noReplen']) && $filter['replenPrty_cb_noReplen'] == 'on') {\n $query->orWhereNull('replenPrty')\n ->orWhere('replenPrty', '=', '0');\n }\n if (isset($filter['replenPrty_cb_20orBelow']) && $filter['replenPrty_cb_20orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['1', '20']);\n }\n if (isset($filter['replenPrty_cb_40orBelow']) && $filter['replenPrty_cb_40orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['21', '40']);\n }\n if (isset($filter['replenPrty_cb_60orBelow']) && $filter['replenPrty_cb_60orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['41', '60']);\n }\n });\n }\n //dd(__METHOD__.\"(\".__LINE__.\")\", compact('filter', 'query'));\n\n\t\tif(isset($filter['created_at']) && strlen($filter['created_at']) > 1) {\n\t\t\t$query = $query->where('created_at', 'like', $filter['created_at'] . '%');\n\t\t}\n\t\tif(isset($filter['updated_at']) && strlen($filter['updated_at']) > 1) {\n\t\t\t$query = $query->where('updated_at', 'like', $filter['updated_at'] . '%');\n\t\t}\n return $query;\n }", "function plain_where($base) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $GLOBALS[$base][\"conj_\".$i]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $v = \"%\".$GLOBALS[$base][\"input_\".$i].\"%\";\r\n else\r\n $v = $GLOBALS[$base][\"input_\".$i];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $GLOBALS[$base][\"sel_\".$i],\r\n $GLOBALS[$base][\"comp_\".$i],\r\n $v);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "public function ifEtat_compteexiste($condition){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t$existe=$this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\tif($existe != null)\n\t\t\t\t\t {\n\t\t\t\t\t return 1;\n\t\t\t\t\t } \n\t\t\t\t\treturn 0;\n\t\t\t\t\t }", "private function getShopgateCondition()\n {\n return [\n 'label' => __('Shopgate Mobile App'),\n 'value' => ShopgateOrder::class,\n ];\n }", "function not_active_productos()\n {\n $query = $this->db->get_where('productos', array('eliminado' => 'SI'));\n if($query->num_rows()>0) {\n return $query;\n } else {\n return FALSE;\n }\n }", "protected function _getUpdateCondition($tableName)\r\n {\r\n return 'bible_id = ' . $this->_db->quote($this->getExisting('bible_id'));\r\n }", "function voirCommandeDomicileenLivraison(){\n\t$conditions = array();\n\tarray_push($conditions, array('nameChamps'=>'modeLivraison','type'=>'=','name'=>'modeLivraison','value'=>'1'));\n\tarray_push($conditions, array('nameChamps'=>'statutCommande','type'=>'=','name'=>'statutCommande','value'=>'2'));\n\t$req = new myQueryClass('commande',$conditions);\n\t$r = $req->myQuerySelect();\n\treturn $r;\n}", "function testFilteredQuery()\n {\n $q1 = MysqlQueryFactory::getInstance(array(\n \"parameters\" => array(\n \"simple\" => array(\"TYPE\" => \"String\"),\n \"number\" => array(\"TYPE\" => \"Integer\"),\n \"number2\" => array(\"TYPE\" => \"Integer\")\n ),\n \"base\" => \"SELECT * FROM MiTest WHERE [[%filter%]] \"\n ));\n $q1->setConnection($this->connection);\n $g=new StorageEngineGetParams(array(\"query\"=>\"test\",\"filter\"=>array(\"FIELD\"=>\"simple\",\"OPERATOR\"=>\"EQUALS\",\"VALUE\"=>\"Ho'la\")));\n $composed=$q1->parse($g);\n $this->assertEquals(\"SELECT * FROM MiTest WHERE simple = 'Ho\\\\'la'\",trim($composed));\n }", "public function testPDONewWhere()\n {\n $mod = Read::Factory($this->_table, $this->_db, \"MysqlPDO\");\n\n $where = [\n \"(\",\n\n \"(\",\n ['fend_test.`db`.user_id', 14],\n ['users.user_name', 'oak'],\n ['`users`.user_id', \">=\", 0],\n \")\",\n\n \"OR\",\n\n \"(\",\n ['`user_id`', \"<=\", 10000],\n ['user_id', \"like\", '57%'],\n \")\",\n\n \")\",\n\n \"OR\",\n\n ['user_id', \"in\", [1, 2, 3, 4, 5, 6]],\n\n \"OR\",\n\n \"(\",\n ['user_id', \"not in\", ['a', 'c', 'd', 'f']],\n \" `user_name` = 'yes' \",\n \")\",\n\n ];\n $mod->where($where);\n $sql = $mod->getSql();\n self::assertEquals('SELECT * FROM users WHERE ( ( `fend_test`.`db`.`user_id` = \\'14\\' AND `users`.`user_name` = \\'oak\\' AND `users`.`user_id` >= \\'0\\' ) OR ( `user_id` <= \\'10000\\' AND `user_id` like \\'57%\\' ) ) OR `user_id` in (\\'1\\',\\'2\\',\\'3\\',\\'4\\',\\'5\\',\\'6\\') OR ( `user_id` not in (\\'a\\',\\'c\\',\\'d\\',\\'f\\') AND `user_name` = \\'yes\\' ) ', $sql);\n\n }", "function simplenews_build_issue_filter_query(EntityFieldQuery $query) {\n if (isset($_SESSION['simplenews_issue_filter'])) {\n foreach ($_SESSION['simplenews_issue_filter'] as $key => $value) {\n switch ($key) {\n case 'list':\n case 'newsletter':\n if ($value != 'all') {\n list($key, $value) = explode('-', $value, 2);\n $query->fieldCondition(variable_get('simplenews_newsletter_field', 'simplenews_newsletter'), 'target_id', $value);\n }\n break;\n }\n }\n }\n}", "private static function buildCondition($params)\n {\n if (isset($params['where'])) {\n $conditions = [];\n foreach ($params['where'] as $field => $value) {\n $conditions[] = \"{$field}='{$value}'\";\n }\n\n return ' where ' . implode(' and ', $conditions);\n }\n\n return '';\n }", "public function getCondition() {\n\n \t$condition = array();\n \t$this->getQueryString(\"keyword\", $condition);\n \t$this->getQueryString(\"activityId\", $condition);\n \t$this->getQueryString(\"activityIds\", $condition);\n \t$this->getQueryString(\"activityType\", $condition);\n $this->getQueryString(\"state\", $condition);\n $this->getQueryString(\"orderDateStart\", $condition);\n $this->getQueryString(\"orderDateEnd\", $condition);\n $this->getQueryString(\"deliveryDateStart\", $condition);\n $this->getQueryString(\"deliveryDateEnd\", $condition);\n $this->getQueryString(\"serial\", $condition);\n $this->getQueryString(\"consumerId\", $condition);\n $this->getQueryString(\"payDateTimeStart\", $condition);\n $this->getQueryString(\"payDateTimeEnd\", $condition);\n $this->getQueryString(\"productId\", $condition);\n $this->getQueryString(\"deliveryId\", $condition);\n $this->getQueryString(\"productArray\", $condition);\n \n \treturn $condition;\n }", "function hod_info_sql($userid,$verified,$specific_account = 1) {\n\t\t$sql = \"SELECT hod_info.* FROM hod_info WHERE hod_info.verified = '{$verified}' \";\n\t\tif($specific_account != 1){\n\t\t\t$sql .= \"AND hod_info.user_id = '{$specific_account}' \";\n\t\t}\n\t\treturn $sql;\n\t}", "private function getProductSearchQuery(string $productSku): string\n {\n return <<<QUERY\n{\n products(filter: {sku: {eq: \"{$productSku}\"}}) {\n items {\n special_price\n }\n }\n}\nQUERY;\n }", "public function setCondition($condition);", "protected function addCondition($query, $attribute, $partialMatch = false)\n{\n if (($pos = strrpos($attribute, '.')) !== false) {\n $modelAttribute = substr($attribute, $pos + 1);\n } else {\n $modelAttribute = $attribute;\n }\n \n $value = $this->$modelAttribute;\n if (trim($value) === '') {\n return;\n }\n \n \n if ($partialMatch) {\n $query->andWhere(['like', $attribute, $value]);\n } else {\n $query->andWhere([$attribute => $value]);\n }\n}", "private function buildFindQuery(?string $filter = null): string\n {\n // means product_name and not product_id\n $sql = 'SELECT o, i, p FROM App\\Entity\\Order o LEFT JOIN o.inventory i LEFT JOIN i.product p';\n\n if (isset($filter)) {\n $sql = $sql . ' WHERE i.sku = :filter OR i.productId = :filter';\n }\n\n return $sql;\n }", "function LocalidadFilter( $Filter )\n {\n if( !empty($Filter->Loc) ) \n {\n $Loc = $Filter->Loc;\n return 'AND pLoc=\"'.$Loc.'\" ';\n }\n \n if( isset( $Filter->Prov ) ) \n return 'AND pProv='.$Filter->Prov.' ';\n\n return ''; \n }", "public function getJoinCondition() {}", "public function getCondition() \n {\n return $this->_fields['Condition']['FieldValue'];\n }", "public function condition(string $field, string $compare, string $operator = \"=\", string $connector = \"AND\");", "public function planFindByField($field,$condition,$value,$orderBy= 'asc');", "function filter_pqr_admin(string $nameReport): string\n{\n $nameReport = strtoupper($nameReport);\n\n $PqrForm = PqrForm::getInstance();\n $PqrFormField = $PqrForm->getRow('sys_dependencia');\n\n if (!$PqrFormField || !$PqrForm->enable_filter_dep) {\n return '';\n }\n\n $Funcionario = SessionController::getUser();\n\n $isAdmin = $Funcionario->getService()->hasFunction(FtPqrService::FUNCTION_ADMIN_PQR);\n if ($isAdmin) {\n return '';\n }\n\n $subconsulta = \"SELECT DISTINCT iddocumento FROM vpqr v JOIN tarea t ON v.iddocumento = t.relacion_id JOIN tarea_funcionario tf on tf.fk_tarea=t.idtarea WHERE v.sys_estado='$nameReport' AND t.relacion=1 AND tf.tipo=1 AND tf.estado=1 AND tf.externo=0 AND tf.usuario = {$Funcionario->getPK()}\";\n\n $isAdminDep = $Funcionario->getService()->hasFunction(FtPqrService::FUNCTION_ADMIN_DEP_PQR);\n if (!$isAdminDep) {\n return \" AND v.iddocumento IN ($subconsulta)\";\n }\n\n $records = VfuncionarioDc::getBasicQb()\n ->select('iddependencia')\n ->distinct()\n ->andWhere('idfuncionario =:idfuncionario')\n ->setParameter(':idfuncionario', $Funcionario->getPK(), Types::INTEGER)\n ->execute()->fetchAllAssociative();\n\n if (!$records) {\n return '1=0';\n }\n\n $ids = [];\n foreach ($records as $id) {\n $ids[] = $id['iddependencia'];\n $children = (new Dependencia($id['iddependencia']))->getChildren();\n foreach ($children as $DependenciaChild) {\n $ids[] = $DependenciaChild->getPK();\n }\n }\n\n return \" AND (sys_dependencia IN (\" . implode(',', array_unique($ids)) . \") OR v.iddocumento IN ($subconsulta))\";\n}", "function accesrestreint_breves_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('NOT IN','$primary','('.sql_get_select('zzzb.id_breve','spip_breves as zzzb',\".accesrestreint_rubriques_accessibles_where('zzzb.id_rubrique','',$_publique).\",'','','','',\\$connect).')')\";\r\n\t#return \"array('IN','$primary',array('SUBSELECT','id_breve','spip_breves',array(\".accesrestreint_rubriques_accessibles_where('id_rubrique').\")))\";\r\n}", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "function verify_vendor_id($vendor_id) // Colorize: green\n { // Colorize: green\n return isset($vendor_id) // Colorize: green\n && // Colorize: green\n is_int($vendor_id) // Colorize: green\n && // Colorize: green\n $vendor_id > 0; // Colorize: green\n }", "public function check(){\n $query = \"SELECT ordine.id_ordine, ordine.id_fornitore, fornitore.nome as fornitore, ordine.articolo, articolo.taglia, ordine.stato \n FROM \" . $this->table_name . \" LEFT JOIN fornitore ON ordine.id_fornitore = fornitore.id_fornitore \n INNER JOIN articolo ON ordine.id_ordine = articolo.id_ordine WHERE stato = 3\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "function home_po_vendor_outstanding() {\n\t\t\n\t\t$kd_plant = $this->session->userdata['ADMIN']['plant'];\n \t $this->db->select('EBELN');\n /*BSTMG-(COALESCE((SELECT SUM(gr_quantity) FROM t_grpo_detail\n\t\t\t\t\t\t JOIN t_grpo_header ON t_grpo_detail.id_grpo_header = t_grpo_header.id_grpo_header\n\t\t\t\t\t\t where t_grpo_header.po_no = EBELN),0)) AS */\n \t $this->db->from('zmm_bapi_disp_po_outstanding');\n \t $this->db->where('PLANT',$kd_plant);\n\t $this->db->where('BSTMG >',0);\n \t // $this->db->where(\"DELIV_DATE >= '\".date('Ymd').\"'\"); //.new 20120312\n\t\t$this->db->group_by('EBELN');\n\t\t//$this->db->order_by('EBELP');\n\t\t\n\n\t\t$query = $this->db->get();\n\t\tif($query->num_rows() > 0) {\n\t\t\treturn $query->num_rows();\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "protected function rawFilter($filter) {\n //Log::debug('query: ',$filter);\n\t\t// Build a query based on filter $filter\n\t\t$query = Pallet::query()\n ->select('Pallet.objectID', 'Pallet.Pallet_ID', 'Pallet.x', 'Pallet.y', 'Pallet.z', 'Pallet.Status')\n ->orderBy('Pallet_ID', 'asc');\n if(isset($filter['Pallet_ID']) && strlen($filter['Pallet_ID']) > 2) {\n $query->where('Pallet_ID', 'like', ltrim($filter['Pallet_ID'],'0') . '%');\n\t\t}\n\t\tif(isset($filter['Pallet_ID.prefix']) && is_array($filter['Pallet_ID.prefix'])) {\n $query->whereRaw(\"substring(Pallet_ID,1,3) in ('\".implode(\"','\", $filter['Pallet_ID.prefix']).\"')\");\n\t\t}\n if(isset($filter['Status']) && is_array($filter['Status'])) {\n $query->whereRaw(\"Status in ('\".implode(\"','\", $filter['Status']).\"')\");\n }\n elseif(isset($filter['Status']) && strlen($filter['Status']) > 3) {\n $query->where('Status', '=', $filter['Status']);\n }\n /*\n * container.parent should generate this sql request\n * select Pallet.* from Pallet join container plt on plt.objectID = Pallet.objectID where plt.parentID = 6213292055;\n */\n if(isset($filter['container.parent']) && strlen($filter['container.parent']) > 3) {\n $query\n ->join('container as plt', 'plt.objectID', '=', 'Pallet.objectID')\n ->where('plt.parentID',$filter['container.parent']);\n }\n /*\n * container.child should generate this sql request\n * select Pallet.* from Pallet join container gc on gc.parentID = Pallet.objectID where gc.objectID = 6226111054;\n */\n if(isset($filter['container.child']) && strlen($filter['container.child']) > 3) {\n $query\n ->join('container as gc', 'gc.parentID', '=', 'Pallet.objectID')\n ->where('gc.objectID',$filter['container.child']);\n }\n return $query;\n }", "private function isVendorCampaign(): bool\n {\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.id' => $this->id,\n ]\n ]);\n\n return !is_null($id);\n }", "protected function getQueryCondition()\n {\n $parts = [];\n foreach ($this->fields as $field) {\n $parts[] = \"{$field} LIKE :pattern\";\n }\n return implode(' AND ', $parts);\n }", "function build_sql_conditions( $args = array() ){\r\n\t\tglobal $wpdb;\r\n\t\t$events_table = $wpdb->prefix . EM_EVENTS_TABLE;\r\n\t\t$locations_table = $wpdb->prefix . EM_LOCATIONS_TABLE;\r\n\t\t\r\n\t\t$conditions = parent::build_sql_conditions($args);\r\n\t\t//eventful locations\r\n\t\tif( true == $args['eventful'] ){\r\n\t\t\t$conditions[] = \"{$events_table}.event_id IS NOT NULL\";\r\n\t\t}elseif( true == $args['eventless'] ){\r\n\t\t\t$conditions[] = \"{$events_table}.event_id IS NULL\";\r\n\t\t}\r\n\t\treturn $conditions;\r\n\t}", "public function condition()\n {\n return $this->condition;\n }", "function translated_plain_where($base, $field) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $this->dict[$this->lang][$GLOBALS[$base][\"conj_\".$i]]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $c = $this->dict[$this->lang][$GLOBALS[$base][\"comp_\".$i]];\r\n else\r\n $c = $this->compare[$GLOBALS[$base][\"comp_\".$i]];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $field[$GLOBALS[$base][\"sel_\".$i]],\r\n $c,\r\n $GLOBALS[$base][\"input_\".$i]);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "protected function getCondition($condition)\n {\n }", "public function getStudentAdhocConcession($condition='') { \n \n global $sessionHandler;\n \n $instituteId = $sessionHandler->getSessionVariable('InstituteId');\n $sessionId = $sessionHandler->getSessionVariable('SessionId');\n \n $query = \"SELECT\n acm.adhocId, acm.dateOfEntry, acm.studentId, acm.feeClassId, \n acm.userId, acm.description, acm.adhocAmount\n FROM\n adhoc_concession_master_new acm\n WHERE \n acm.instituteId = '$instituteId'\n $condition\";\n \n return SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\");\n }", "function dbConditionString($fieldName, array $values, $notIn = false) {\n\tswitch (count($values)) {\n\t\tcase 0:\n\t\t\treturn '1=0';\n\t\tcase 1:\n\t\t\treturn $notIn\n\t\t\t\t? $fieldName.'!='.zbx_dbstr(reset($values))\n\t\t\t\t: $fieldName.'='.zbx_dbstr(reset($values));\n\t}\n\n\t$in = $notIn ? ' NOT IN ' : ' IN ';\n\t$concat = $notIn ? ' AND ' : ' OR ';\n\t$items = array_chunk($values, 950);\n\n\t$condition = '';\n\tforeach ($items as $values) {\n\t\t$condition .= !empty($condition) ? ')'.$concat.$fieldName.$in.'(' : '';\n\t\t$condition .= implode(',', zbx_dbstr($values));\n\t}\n\n\treturn $fieldName.$in.'('.$condition.')';\n}", "private static function __typeAdjustCondition(array $typeRequest){\r\n $stringArray = '';\r\n foreach($typeRequest as $keys => $values){\r\n $stringArray .= $keys.\" = '\".$values.\"' AND \";\r\n }\r\n return substr($stringArray, 0, -4);\r\n }", "function PreciosFilter( $Filter )\n {\n $Field = PreciosField( $Filter );\n \n $where = \"\";\n if( !empty($Filter->precMin) ) $where = 'AND '.$Field.'>='.$Filter->precMin.' ';\n if( !empty($Filter->precMax) && $Filter->precMax<150) $where .= 'AND '.$Field.'<='.$Filter->precMax.' ';\n\n if( !empty($where) ) $where .= 'AND '.$Field.'>0 ';\n return $where; \n }", "public function sqlWhere()\n {\n if ($this->isMultilingualAttribute()) {\n $strWhere = 'IFNULL(translation.' . $this->arrConfig['attribute'] . ', ' . Product::getTable() . '.' . $this->arrConfig['attribute'] . ')';\n } else {\n $strWhere = Product::getTable() . '.' . $this->arrConfig['attribute'];\n }\n\n $strWhere .= ' ' . $this->getOperatorForSQL() . ' ?';\n\n return $strWhere;\n }", "public function getCondition()\n {\n return $this->condition;\n }", "protected function _getUpdateCondition($tableName)\n {\n return 'photo_contest_id = ' . $this->_db->quote($this->getExisting('photo_contest_id'));\n }", "protected function _buildCondition(){\n \t$aryCondition = array();\n \t\n \tif(!empty($this->postData)){\n \t\t //search\n\t\t\t \t\t\t\n\t\t\tif($this->postData['title']!=''){\n \t\t \t$aryCondition['like'][] = array(\"mt.title\"=>$this->postData['title']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['page']!=''){\n \t\t \t$aryCondition['and'][] = array(\"mt.page\"=>$this->postData['page']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['code']!=''){\n \t\t \t$aryCondition['like'][] = array(\"mt.code\"=>$this->postData['code']);\n \t\t }\t\t\t\n\t\t\tif($this->postData['status']!=''){\n \t\t \t$aryCondition['and'][] = array(\"mt.status\"=>$this->postData['status']);\n \t\t }\t\t\t\n\n \t}\n \treturn $aryCondition;\n }", "function paperselPredicate($papersel) {\n return \"ContactInfo.contactId\" . sql_in_numeric_set($papersel);\n}", "public function getCustomerIsVendorAttribute()\n {\n return Str::contains(strtolower($this->customer_type), 'vendor');\n }", "function generate_where($field,$array)\n{\n\tfor ($i=0;$i<sizeof($array);$i++)\n\t{\n\t\t$where=$where.\" \".$field.\" like \".$array[$i];\n\t\tif ($i<sizeof($array)-1)\n\t\t\t$where=$where.\" or\";\n\t}\n\tif (!isset($where))\n\t{\n\t\t$where = 0;\n\t}\n\tif (!isset($where))\n\t{\n\t\t$where=\"'0'\";\n\t}\n\treturn $where;\n}", "public function testconstructSQLClauseNot()\n {\n $_SESSION['behat']['GenesisSqlExtension']['keywords'] = [];\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = [];\n\n // Prepare / Mock\n $glue = ' - ';\n $columns = [\n 'firstname' => '!Abdul',\n 'lastname' => 'Qureshi'\n ];\n\n // Execute\n $result = $this->testObject->constructSQLClause($glue, $columns);\n\n $expected = \"firstname != 'Abdul' - lastname = 'Qureshi'\";\n\n // Assert Result\n $this->assertEquals($expected, $result);\n }", "function es_filtro($vfiltro){\n $res = false;\n if ($vfiltro != SIN_FILTRO)\n $res = true;\n return $res;\n}", "function buildQuery(){\n\t\t$r = ($this->fieldName == \"\") ? \"SELECT * FROM \" . $this->tableName . \";\" : \"SELECT * FROM \" . $this->tableName . \" WHERE \" . $this->fieldName . \" = \" . $this->fieldValue . \";\";\n\t\t//print \"executing $r <br/>\";\n\t\treturn $r;\n\t}", "private function createWhereByValue($value){\n $filterDbOfValue = $value->getFilterDB();\n if(is_null($filterDbOfValue)){\n $filterDbOfValue = $this->id .\"='\".$value->getId().\"'\";\n }\n return $filterDbOfValue;\n }", "function m_tampil_soal($table, $where){\n\t\treturn $this->db->get_where($table,$where);\n\t}", "private function prepareExistCondition($attribute)\n {\n $this->filter->addMust(new Exists($attribute));\n }" ]
[ "0.5453084", "0.5428421", "0.53242785", "0.523969", "0.5190168", "0.5170654", "0.5066701", "0.50420403", "0.5034378", "0.50256264", "0.4986985", "0.49861932", "0.49806476", "0.49726474", "0.49640357", "0.49357104", "0.48947275", "0.4886336", "0.48668274", "0.485836", "0.48513356", "0.48403904", "0.4813876", "0.48066294", "0.48047268", "0.47830603", "0.47799343", "0.47799343", "0.47799343", "0.47776", "0.47504508", "0.47384042", "0.47327638", "0.47304899", "0.472982", "0.47227913", "0.4721112", "0.47168374", "0.4703711", "0.46984825", "0.46921533", "0.46842197", "0.4683173", "0.46826947", "0.46807155", "0.46751967", "0.46703064", "0.4667485", "0.4666459", "0.46519196", "0.46420062", "0.46373522", "0.4628302", "0.46229398", "0.46162453", "0.46072325", "0.460577", "0.46045133", "0.4603764", "0.4603077", "0.45857227", "0.45842397", "0.45784748", "0.45750633", "0.45741487", "0.45713276", "0.45685697", "0.4562478", "0.45591113", "0.45536152", "0.45522466", "0.45399553", "0.45345935", "0.4530469", "0.45280278", "0.45176765", "0.45161092", "0.4513238", "0.45124626", "0.45065746", "0.4504311", "0.45034623", "0.45031404", "0.44988385", "0.44979966", "0.4496155", "0.44931272", "0.44922194", "0.44918144", "0.44856226", "0.4483641", "0.44805557", "0.44804746", "0.44792694", "0.44763693", "0.44726562", "0.44693527", "0.4468645", "0.44614598", "0.44603246" ]
0.4843504
21
$condition = "items.anoti = 0";
private function GetNewItemsCountNoti() { $this->db->select('count(*) as NewItemsNoti'); $this->db->from('items'); $this->db->join('vendor','vendor.vid = items.vid','left'); $this->db->join('filters','filters.filt_id = items.f_id','left'); $this->db->join('sub_category','sub_category.sub_cat_id = filters.sub_cat_id','left'); $this->db->join('category','category.cat_id = sub_category.cat_id','left'); $this->db->where('items.verified',0); //$this->db->where($condition); $query = $this->db->get(); $tmpArray = $query->result_array(); $this->data = array_shift($tmpArray); return $this->data["NewItemsNoti"]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_condition($item) {\n\t\treturn $this->conditions[$this->prefix.$item['id']] = $item['condition'];\n\t}", "function getItems($where, $value, $approve = NULL){\r\n\tglobal $con;\r\n\tif($approve == NULL) { $sql = 'AND Approve = 1';}else{$sql = '';}\r\n\t$getItems = $con->prepare(\"SELECT * FROM items WHERE $where = ? $sql ORDER BY item_ID DESC\");\r\n\t$getItems->execute(array($value));\t\r\n\t$items = $getItems->fetchAll();\r\n\treturn $items;\r\n\r\n\r\n}", "function _getItemSearchFromStmt() {\n $sql = 'FROM plugin_docman_item AS i'.\n ' LEFT JOIN plugin_docman_version AS v'.\n ' ON (i.item_id = v.item_id)'.\n ' LEFT JOIN plugin_docman_version AS v2'.\n ' ON (v2.item_id = v.item_id AND v.number < v2.number) ';\n return $sql;\n }", "function accesrestreint_breves_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('NOT IN','$primary','('.sql_get_select('zzzb.id_breve','spip_breves as zzzb',\".accesrestreint_rubriques_accessibles_where('zzzb.id_rubrique','',$_publique).\",'','','','',\\$connect).')')\";\r\n\t#return \"array('IN','$primary',array('SUBSELECT','id_breve','spip_breves',array(\".accesrestreint_rubriques_accessibles_where('id_rubrique').\")))\";\r\n}", "function accesrestreint_rubriques_accessibles_where($primary,$not='NOT', $_publique=''){\r\n\tif (!$_publique) $_publique = \"!test_espace_prive()\";\r\n\treturn \"sql_in('$primary', accesrestreint_liste_rubriques_exclues($_publique), '$not')\";\r\n}", "function getItem($where, $value, $approve = null)\n{\n global $con;\n\n $sql = $approve == null ? 'AND Item_Approve = 1' : '';\n\n $getItem = $con->prepare(\"Select * From items WHERE $where =? $sql ORDER BY Item_ID DESC\");\n\n $getItem->execute(array($value));\n\n $items = $getItem->fetchAll();\n\n return $items;\n}", "public function zero()\n {\n $this->assertFalse($this->orCriterion->hasCriterion());\n $this->orCriterion->toSQL();\n }", "public function getItemsCriteria() {}", "public function getItemsCriteria() {}", "function accesrestreint_articles_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('NOT IN','$primary','('.sql_get_select('zzza.id_article','spip_articles as zzza',\".accesrestreint_rubriques_accessibles_where('zzza.id_rubrique','',$_publique).\",'','','','',\\$connect).')')\";\r\n\t#return array('SUBSELECT','id_article','spip_articles',array(\".accesrestreint_rubriques_accessibles_where('id_rubrique').\")))\";\r\n}", "public function testConditionOverride() {\n\t\t$products = $this->productsManager->filter(Attr::id()->lt(3))->find(Attr::category()->eq('Clothes'));\n\t\t$this->assertCount(3, $products);\n\t}", "private function sql_resAllItemsFilterWiRelation()\n {\n // Don't count hits\n $bool_count = false;\n\n // Query for all filter items\n $select = $this->sql_select( $bool_count );\n $from = $this->sql_from();\n $where = $this->sql_whereAllItems();\n $groupBy = $this->curr_tableField;\n $orderBy = $this->sql_orderBy();\n $limit = $this->sql_limit();\n\n// $query = $GLOBALS['TYPO3_DB']->SELECTquery\n// (\n// $select,\n// $from,\n// $where,\n// $groupBy,\n// $orderBy,\n// $limit\n// );\n//$this->pObj->dev_var_dump( $query );\n // Execute query\n $arr_return = $this->pObj->objSqlFun->exec_SELECTquery\n (\n $select, $from, $where, $groupBy, $orderBy, $limit\n );\n // Execute query\n\n return $arr_return;\n }", "function s_m_put_get_condition($ref_id_db_arr, $ref_data){\r\n $where = \"\";\r\n for($i = 0; $i < count($ref_id_db_arr); $i++){\r\n $where .= $ref_id_db_arr[$i] . \"='\" . $ref_data[$i] . \"'' AND \";\r\n }\r\n return substr($where, 0, strlen($where) - 5);\r\n}", "public function buildConditionQuery()\n\t\t\t{\n\t\t\t\t$this->sql_condition = ' user_id='.$this->CFG['user']['user_id'];\n\t\t\t}", "function accesrestreint_syndic_articles_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('NOT IN','$primary','('.sql_get_select('zzzs.id_syndic','spip_syndic as zzzs',\".accesrestreint_rubriques_accessibles_where('zzzs.id_rubrique','',$_publique).\",'','','','',\\$connect).')')\";\r\n\t#return \"array('IN','$primary',array('SUBSELECT','id_syndic','spip_syndic',array(\".accesrestreint_rubriques_accessibles_where('id_rubrique').\")))\";\r\n}", "function beforeFind($queryData) {\r\n\t\t\t\t\tif (is_array($queryData['conditions'])) {\r\n\t\t\t\t\t\t$queryData['conditions']['Auction.deleted']=0;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$queryData['conditions'].=' AND Auction.deleted=0';\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn $queryData;\r\n\t\t\t\t}", "public function testConditionClause()\n {\n $condition = $this->getConnection()\n ->condition()\n (\"WHERE blog_id = :id\");\n return $this->assertEquals($condition, \"WHERE blog_id = :id\");\n }", "function itemExistsNotDeleted($itemId){\n return getSingleValue(\"SELECT COUNT(`id`) FROM `public_items` WHERE `id` =\" . escape(intval($itemId)) . \" AND `deleted` =0 LIMIT 0, 1\");\n }", "function test_select_items($urabe, $body)\n{\n $sql = $body->sql_simple;\n $result = $urabe->select_items($sql);\n return $result;\n}", "public function count_condition($param = 0)\n\t{\n\t\t$query = $this->db->query(\"SELECT kondisi FROM tb_inventori_item WHERE kondisi = ?\", array($param));\n\t\treturn $query->num_rows();\n\t}", "function has_js_condition($item) {\n\t\treturn isset($item['condition']) && is_array($item['condition']);\n\t}", "private function sql_whereAllItems()\n {\n $where = '1 ' .\n $this->sql_whereAnd_pidList() .\n $this->sql_whereAnd_enableFields() .\n $this->sql_whereAnd_Filter() .\n $this->sql_whereAnd_fromTS() .\n $this->sql_whereAnd_sysLanguage();\n // Get WHERE statement\n // RETURN WHERE statement without a WHERE\n return $where;\n }", "function start_group_where($key,$value=NULL,$escape=TRUE,$type=\"AND\")\n {\n $this->open_bracket($type); \n return parent::_where($key, $value,'',$escape); \n }", "public function check(){\n $query = \"SELECT ordine.id_ordine, ordine.id_fornitore, fornitore.nome as fornitore, ordine.articolo, articolo.taglia, ordine.stato \n FROM \" . $this->table_name . \" LEFT JOIN fornitore ON ordine.id_fornitore = fornitore.id_fornitore \n INNER JOIN articolo ON ordine.id_ordine = articolo.id_ordine WHERE stato = 3\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "public function doCheckItemHasNoActiveItems($itemid = -1) {\n if ($itemid > 0) {\n $this->db->select('items.item_manu');\n // we need to do a sub query, this\n $this->db->from('items');\n $this->db->join('item_manu', 'items.item_manu = item_manu.id', 'left');\n $this->db->where('items.item_manu', $itemid);\n $this->db->where('items.active', 1);\n $resQuery = $this->db->get();\n\n\n if ($resQuery->num_rows() > 0) {\n return FALSE;\n } else {\n return TRUE;\n }\n } else {\n return false;\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 compare_operator($query,$item)\n{\n if($query['WHERE'][2]==\"CONTAINS\")\n {\n if(strpos($item,$query['WHERE'][3]) !== false)\n {\n return true;\n }\n }\n else if ($query['WHERE'][2]==\"=\")\n {\n if((is_double($query['WHERE'][3]) && ((double)$item == $query['WHERE'][3])) || strcmp($item, $query['WHERE'][3])==0)\n {\n return true;\n }\n }\n else if ($query['WHERE'][2]==\"<\")\n {\n if((is_double($query['WHERE'][3]) && ((double)$item < $query['WHERE'][3])) || strcmp($item, $query['WHERE'][3]) < 0)\n {\n return true;\n }\n }\n else if ($query['WHERE'][2]==\">\")\n {\n if((is_double($query['WHERE'][3]) && ((double)$item > $query['WHERE'][3])) || strcmp($item, $query['WHERE'][3]) > 0)\n {\n return true;\n }\n }\n return false;\n}", "public function testPDONewWhere()\n {\n $mod = Read::Factory($this->_table, $this->_db, \"MysqlPDO\");\n\n $where = [\n \"(\",\n\n \"(\",\n ['fend_test.`db`.user_id', 14],\n ['users.user_name', 'oak'],\n ['`users`.user_id', \">=\", 0],\n \")\",\n\n \"OR\",\n\n \"(\",\n ['`user_id`', \"<=\", 10000],\n ['user_id', \"like\", '57%'],\n \")\",\n\n \")\",\n\n \"OR\",\n\n ['user_id', \"in\", [1, 2, 3, 4, 5, 6]],\n\n \"OR\",\n\n \"(\",\n ['user_id', \"not in\", ['a', 'c', 'd', 'f']],\n \" `user_name` = 'yes' \",\n \")\",\n\n ];\n $mod->where($where);\n $sql = $mod->getSql();\n self::assertEquals('SELECT * FROM users WHERE ( ( `fend_test`.`db`.`user_id` = \\'14\\' AND `users`.`user_name` = \\'oak\\' AND `users`.`user_id` >= \\'0\\' ) OR ( `user_id` <= \\'10000\\' AND `user_id` like \\'57%\\' ) ) OR `user_id` in (\\'1\\',\\'2\\',\\'3\\',\\'4\\',\\'5\\',\\'6\\') OR ( `user_id` not in (\\'a\\',\\'c\\',\\'d\\',\\'f\\') AND `user_name` = \\'yes\\' ) ', $sql);\n\n }", "function updateAmazonProductsOfferingConditionNotes($items)\n{\n\tif (sizeof($items) > 0) {\n\t\t$data = array();\n\t\t$data['submitedPrice'] = 0;\n\t\t$caseOfferingConditionNote = \"OfferingConditionNote = CASE\";\n\t\tforeach($items as $key => $item)\n\t\t{\t\n\t\t\tif ($items[$key]['OfferingConditionNote'] != null) {\n\t\t\t\t$caseOfferingConditionNote.= \"\\n WHEN id_product = \" . $items[$key]['id_product'] . \" THEN '\" . $items[$key]['OfferingConditionNote'] . \"'\";\n\t\t\t\t$productsIds[] = $items[$key]['id_product'];\n\t\t\t}\t\t\t\n\t\t}\n\t\tif (count($productsIds) > 0) {\n\t\t\t$caseOfferingConditionNote.= \"\n\t\t\t\tEND\n\t\t\t\tWHERE id_product IN (\" . implode(\", \", $productsIds) . \")\n\t\t\t\";\n\t\t\t$addWhere = $caseOfferingConditionNote;\n\t\t\tSQLUpdate('amazon_products', $data, $addWhere, 'shop', __FILE__, __LINE__);\n\t\t}\n\t}\n}", "function validate_fishbowl_item($mysqli, $item)\n{\n\tif ( empty($item[\"date\"])\n\t || !is_numeric($item[\"log_type\"]) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "function testFilteredQuery()\n {\n $q1 = MysqlQueryFactory::getInstance(array(\n \"parameters\" => array(\n \"simple\" => array(\"TYPE\" => \"String\"),\n \"number\" => array(\"TYPE\" => \"Integer\"),\n \"number2\" => array(\"TYPE\" => \"Integer\")\n ),\n \"base\" => \"SELECT * FROM MiTest WHERE [[%filter%]] \"\n ));\n $q1->setConnection($this->connection);\n $g=new StorageEngineGetParams(array(\"query\"=>\"test\",\"filter\"=>array(\"FIELD\"=>\"simple\",\"OPERATOR\"=>\"EQUALS\",\"VALUE\"=>\"Ho'la\")));\n $composed=$q1->parse($g);\n $this->assertEquals(\"SELECT * FROM MiTest WHERE simple = 'Ho\\\\'la'\",trim($composed));\n }", "function remplirConditionGroupeOnly($Motcle) {\r\n\t$RechercheGroupe = ''; // variable Fonction de condition\r\n\tif ($Motcle != \"\") {\r\n\t\t\r\n\t\t$RMotClef = explode ( \" \", $Motcle );\r\n\t\t$NbMotClef = count ( $RMotClef );\r\n\t\t$check = new checkDataBase (); // Instance d'un objet checkDataBase (Voir le fichier checkDataBase.php pour plus d'informations\r\n\t\t\r\n\t\t$matableGroupe = \"groupe\";\r\n\t\t$RequeteTriGroupe = $check->checkTable ( $matableGroupe );\r\n\t\t\r\n\t\t$I = \"0\";\r\n\t\t$RechercheGroupe = '(';\r\n\t\tforeach ( $RequeteTriGroupe as $Row ) {\r\n\t\t\t$Type = preg_replace ( \"[^a-z]\", \"\", $Row ['Type'] );\r\n\t\t\t$Type = explode ( \"(\", $Type );\r\n\t\t\t$I2 = \"0\";\r\n\t\t\t\r\n\t\t\tif ($I != \"0\") {\r\n\t\t\t\t$RechercheGroupe .= \" OR \";\r\n\t\t\t}\r\n\t\t\treset ( $RMotClef );\r\n\t\t\tforeach ( $RMotClef as $V ) {\r\n\t\t\t\t$I2 ++;\r\n\t\t\t\t$V = str_replace ( \"'\", \"''\", $V );\r\n\t\t\t\t$RechercheGroupe .= $Row ['Field'] . \" LIKE '%$V%'\";\r\n\t\t\t\t\r\n\t\t\t\tif ($I2 != $NbMotClef) {\r\n\t\t\t\t\t$RechercheGroupe .= \" OR \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$I ++;\r\n\t\t}\r\n\t\t$RechercheGroupe .= ')';\r\n\t}\r\n\treturn $RechercheGroupe;\r\n}", "protected function unique($item, $value, $operator = '='){\r\n\t\r\n\tswitch($item->row->table){\r\n\t\tcase 'base':\r\n\t\t\t$res = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->tableName.\" WHERE \".$this->fieldName.\" != \".(int)$this->id.\" AND \".$item->row->name.\" \".$operator.\" '\".$value.\"'\");\r\n\t\tbreak; case 'meta':\r\n\t\t\t$res = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->metaDataTableName.\" WHERE id_meta = '\".$item->row->name.\"' AND \".$this->metaConnectId.\" != \".$this->id.\" AND \".$item->row->attributes()->system_type.\"_value \".$operator.\" '\".$value.\"'\");\r\n\t\tbreak; default:\r\n\t\t\treturn false;\r\n\t}\r\n\r\n\treturn count($res) == 0 ? true: false; \r\n}", "public function rawFilter($filter) {\n\t\t$query = InventorySummary::orderBy('Client_SKU', 'asc');\n\t\tif(isset($filter['objectID']) && strlen($filter['objectID']) > 3) {\n\t\t\t$query = $query->where('objectID', 'like', $filter['objectID'] . '%');\n\t\t}\n\t\tif(isset($filter['Client_SKU']) && strlen($filter['Client_SKU']) > 3) {\n\t\t\t$query = $query->where('Client_SKU', 'like', $filter['Client_SKU'] . '%');\n\t\t}\n\t\tif(isset($filter['Description']) && strlen($filter['Description']) > 3) {\n\t\t\t$query = $query->where('Description', 'like', $filter['Description'] . '%');\n\t\t}\n\n /*\n * Pick face quantity choices\n */\n if(isset($filter['pickQty_rb'])) {\n if($filter['pickQty_rb'] == 'zero') {\n $query = $query->where('pickQty', '=', '0');\n } elseif($filter['pickQty_rb'] == 'belowMin') {\n $query = $query->where('pickQty', '<', '3');\n } elseif($filter['pickQty_rb'] == 'aboveMin') {\n $query = $query->where('pickQty', '>', '2');\n }\n }\n\n /*\n * Activity location quantity choices\n */\n if(isset($filter['actQty_rb'])) {\n if($filter['actQty_rb'] == 'zero') {\n $query = $query->where('actQty', '=', '0');\n } elseif($filter['actQty_rb'] == 'aboveZero') {\n $query = $query->where('actQty', '>', '0');\n }\n }\n\n /*\n * Reserve quantity choices\n */\n if(isset($filter['resQty_rb'])) {\n if($filter['resQty_rb'] == 'zero') {\n $query = $query->where('resQty', '=', '0');\n } elseif($filter['resQty_rb'] == 'aboveZero') {\n $query = $query->where('resQty', '>', '0');\n }\n }\n\n /*\n * Replen Priority choices\n */\n if(isset($filter['replenPrty_cb_noReplen'])\n or isset($filter['replenPrty_cb_20orBelow'])\n or isset($filter['replenPrty_cb_40orBelow'])\n or isset($filter['replenPrty_cb_60orBelow'])) {\n $query->where(function ($query) use ($filter) {\n if (isset($filter['replenPrty_cb_noReplen']) && $filter['replenPrty_cb_noReplen'] == 'on') {\n $query->orWhereNull('replenPrty')\n ->orWhere('replenPrty', '=', '0');\n }\n if (isset($filter['replenPrty_cb_20orBelow']) && $filter['replenPrty_cb_20orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['1', '20']);\n }\n if (isset($filter['replenPrty_cb_40orBelow']) && $filter['replenPrty_cb_40orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['21', '40']);\n }\n if (isset($filter['replenPrty_cb_60orBelow']) && $filter['replenPrty_cb_60orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['41', '60']);\n }\n });\n }\n //dd(__METHOD__.\"(\".__LINE__.\")\", compact('filter', 'query'));\n\n\t\tif(isset($filter['created_at']) && strlen($filter['created_at']) > 1) {\n\t\t\t$query = $query->where('created_at', 'like', $filter['created_at'] . '%');\n\t\t}\n\t\tif(isset($filter['updated_at']) && strlen($filter['updated_at']) > 1) {\n\t\t\t$query = $query->where('updated_at', 'like', $filter['updated_at'] . '%');\n\t\t}\n return $query;\n }", "private static function createAndJsonContainsExpression(string $field, array $items, string $path) : Expression\n {\n $i = 0;\n $expression = '(';\n\n foreach ($items as $item) {\n if ($i) {\n $expression .= ' AND ';\n }\n\n $expression .= static::generateExpression($field, $item, $path);;\n $i++;\n }\n\n $expression .= ')';\n\n return new Expression($expression);\n }", "function requetefiltre($num_dep,$insee,$idmare,$interco){\n\t//POUR LES DEPARTEMENT\n\tif($num_dep <> 0){\n\t\t$condition = 'AND LEFT(lg.\"L_ADMIN\",2) = '.\"'\".$num_dep.\"'\".'';\n\t}else{\n\t\t$condition = '';\n\t}\n\t//POUR LES INTERCO\n\tif($interco <> 0){\n\t\t$condition .= 'AND intercommunalite.\"Num_fiscalite\" = '.\"'\".$interco.\"'\".'';\n\t}else{\n\t\t$condition .= '';\n\t}\n\t//POUR LES COMMUNES\n\tif($insee <> 0){\n\t\t$condition .= 'AND lg.\"L_ADMIN\" = '.\"'\".$insee.\"'\".'';\n\t}else{\n\t\t$condition .= '';\n\t}\n\t//POUR LES MARE\n\tif($idmare <> 0){\n\t\t$condition = ' AND lg.\"L_ID\" = '.\"'\".$idmare.\"'\".'';\n\t}else{\n\t\t$condition .= '';\n\t}\n\t\n\treturn $condition;\n\t\n}", "public function getViaTableCondition();", "public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}", "public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}", "public function get_unapproved_items() {\n return $this->query(\"SELECT * FROM `items` where NOT `approved` order by `premium` desc, `date`\");\n }", "protected function user_where_clause() {}", "public function GetNewItemsDataNoti()\n {\n $this->db->select('items.item_id,items.item_name,items.description,items.verified,items.block,vendor.name,vendor.shop_name,vendor.address,vendor.mobile_no,sub_category.sub_cat_name,category.category_name,filters.filt_name');\n $this->db->from('items');\n $this->db->join('vendor','vendor.vid = items.vid','left');\n $this->db->join('filters','filters.filt_id = items.f_id','left');\n $this->db->join('sub_category','sub_category.sub_cat_id = filters.sub_cat_id','left');\n $this->db->join('category','category.cat_id = sub_category.cat_id','left');\n $this->db->where('items.verified',0);\n // $this->db->where($condition);\n $query = $this->db->get();\n return $query->result();\n }", "public function testOrCondition() {\n\t\t$products = $this->productsManager->find(Q::orfilter(Attr::id()->eq(5), Attr::id()->eq(3)));\n\t\t$this->assertCount(2, $products);\n\t}", "public function getConditions($form = null) {\n\t\treturn 'messageTable.isDeleted = 0 AND messageTable.isDisabled = 0';\n\t}", "function deleteItems($cond)\n {\n $this->db->where($cond);\n $this->db->delete(\"feedback\");\n return true;\n }", "function simplenews_build_subscription_filter_query(SelectQueryInterface $query) {\n if (isset($_SESSION['simplenews_subscriptions_filter'])) {\n foreach ($_SESSION['simplenews_subscriptions_filter'] as $key => $value) {\n switch ($key) {\n case 'list':\n if ($value != 'all') {\n list($key, $value) = explode('-', $value, 2);\n $query->condition('su.' . $key, $value);\n }\n break;\n case 'email':\n if (!empty($value)) {\n $query->condition('sn.mail', '%' . $value . '%', 'LIKE');\n }\n break;\n }\n }\n }\n}", "public function Filter_Not() {\r\n\t\treturn array(\r\n\t\t\t'where' => '0'\r\n\t\t);\r\n\t}", "function FilterMethod($row){\n\t\treturn $row['parentid'] == $this->filter;\n }", "function beforeFind($queryData) {\n\t\t\tif (is_array($queryData['conditions'])) {\n\t\t\t\t$queryData['conditions']['Product.deleted']=0;\n\t\t\t} else {\n\t\t\t\t$queryData['conditions'].=' AND Product.deleted=0';\n\t\t\t}\n\t\t\treturn $queryData;\n\t\t}", "public function clearCondition(){\n\t\t$this->where=\"\";\n\t}", "function plain_where($base) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $GLOBALS[$base][\"conj_\".$i]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $v = \"%\".$GLOBALS[$base][\"input_\".$i].\"%\";\r\n else\r\n $v = $GLOBALS[$base][\"input_\".$i];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $GLOBALS[$base][\"sel_\".$i],\r\n $GLOBALS[$base][\"comp_\".$i],\r\n $v);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "private function getSQLCondition() {\n\t\t// the manager can see everyone in the department\n\t\t// the admin and everybody else can see everyone in the company.\n\t\tswitch ($this->page->config['user_level']) {\n\t\t\tcase lu_manager:\n\t\t\tcase lu_employee:\n\t\t\tcase lu_admin:\n\t\t\t\t$sql = 'WHERE 1 = 2';\n\t\t\t\tbreak;\t//nobody below GM can access this subject\n\t\t\tcase lu_gm:\n\t\t\tcase lu_owner:\n\t\t\t\t$sql = ' WHERE c.company_id = '.$this->page->company['company_id'];\n\t\t}\n\t\treturn $sql;\n\t}", "public function testBuildWhereEmpty()\n {\n $query = $this->getQuery();\n\n $this->assertSame(\n '',\n $query->buildWhere()\n );\n }", "function get_condition()\r\n {\r\n $owner = $this->owner;\r\n\r\n $conds = array();\r\n $parent = $this->parent;\r\n $category = $parent->get_parameter(WeblcmsManager :: PARAM_CATEGORY);\r\n $category = $category ? $category : 0;\r\n $conds[] = new EqualityCondition(ContentObjectPublication :: PROPERTY_CATEGORY_ID, $category, ContentObjectPublication :: get_table_name());\r\n\r\n $type_cond = array();\r\n $types = array(Assessment :: get_type_name(), Survey :: get_type_name(), Hotpotatoes :: get_type_name());\r\n foreach ($types as $type)\r\n {\r\n $type_cond[] = new EqualityCondition(ContentObject :: PROPERTY_TYPE, $type);\r\n }\r\n $conds[] = new OrCondition($type_cond);\r\n $c = Utilities :: query_to_condition($this->query);\r\n if (! is_null($c))\r\n {\r\n $conds[] = $c;\r\n }\r\n return new AndCondition($conds);\r\n }", "function simplenews_build_issue_filter_query(EntityFieldQuery $query) {\n if (isset($_SESSION['simplenews_issue_filter'])) {\n foreach ($_SESSION['simplenews_issue_filter'] as $key => $value) {\n switch ($key) {\n case 'list':\n case 'newsletter':\n if ($value != 'all') {\n list($key, $value) = explode('-', $value, 2);\n $query->fieldCondition(variable_get('simplenews_newsletter_field', 'simplenews_newsletter'), 'target_id', $value);\n }\n break;\n }\n }\n }\n}", "public function testHasKidsLessThanZero()\n {\n $this->assertEquals(0, $this->getObject(-1)->getValue());\n }", "public function onItemgroup(){\n\t\t$sql = \"SELECT * FROM `itemgroup` WHERE `status` = 'ON'\";\n\t\t$query = $this->execute($sql);\n\t\tif($query){\n\t\t\treturn $query;\n\t\t}\n\t}", "function GpsData_Filter_Zero($value) {\n\treturn $value > 0;\n}", "function accesrestreint_documents_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('IN','$primary','('.sql_get_select('zzz.id_document','spip_documents_liens as zzz',\r\n\tarray(array('OR',\r\n\t\tarray('OR',\r\n\t\t\tarray('AND','zzz.objet=\\'rubrique\\'',\".accesrestreint_rubriques_accessibles_where('zzz.id_objet','NOT',$_publique).\"),\r\n\t\t\tarray('AND','zzz.objet=\\'article\\'',\".accesrestreint_articles_accessibles_where('zzz.id_objet',$_publique).\")\r\n\t\t),\r\n\t\t\tarray('AND','zzz.objet=\\'breve\\'',\".accesrestreint_breves_accessibles_where('zzz.id_objet',$_publique).\")\r\n\t))\"\r\n\t.\",'','','','',\\$connect).')')\";\r\n\t/*return \"array('IN','$primary',array('SUBSELECT','id_document','spip_documents_liens',\r\n\tarray(array('OR',\r\n\t\tarray('OR',\r\n\t\t\tarray('AND','objet=\\'rubrique\\'',\".accesrestreint_rubriques_accessibles_where('id_objet').\"),\r\n\t\t\tarray('AND','objet=\\'article\\'',\".accesrestreint_articles_accessibles_where('id_objet').\")\r\n\t\t),\r\n\t\t\tarray('AND','objet=\\'breve\\'',\".accesrestreint_breves_accessibles_where('id_objet').\")\r\n\t))\r\n\t))\";*/\r\n}", "function voirCommandeDomicileenLivraison(){\n\t$conditions = array();\n\tarray_push($conditions, array('nameChamps'=>'modeLivraison','type'=>'=','name'=>'modeLivraison','value'=>'1'));\n\tarray_push($conditions, array('nameChamps'=>'statutCommande','type'=>'=','name'=>'statutCommande','value'=>'2'));\n\t$req = new myQueryClass('commande',$conditions);\n\t$r = $req->myQuerySelect();\n\treturn $r;\n}", "public function queryItem(Model $item, $extraCondition = array())\n {\n $condition = $item->queryGetCondition($extraCondition, Model::READ);\n return $this->query($condition, 'query');\n\n }", "function neworder_where(){\n\t\treturn false;\n\t}", "protected function _buildWhere(&$query)\r\n {\r\n\r\n\r\n \t//if($this->_checkin!=null)\r\n \t//{\r\n \t//\t$query->where('ltap.ltap_qdatu = \"'.$this->_confdate.'\"');\r\n \t//}\r\n return $query;\r\n }", "protected function parse_conditionset($recordid, $items, &$fields) {\n if (is_array($items) && count($items) == 2 && key($items) === 0) {\n // ARRAY(join, conditions)\n if ($join = $this->parse_join($items[0])) {\n if ($conditions = $this->parse_conditions($recordid, $items[1], $fields)) {\n return array($join, $conditions);\n }\n }\n }\n if ($conditions = $this->parse_conditions($recordid, $items, $fields)) {\n return array('AND', $conditions);\n }\n return false;\n }", "public function scopeBake(Builder $query, array $items)\n {\n //\"select * from `game_item_recipes` where items->\"$.id\" = 3\"\n $query->whereHas(\"items\", function(){\n\n });\n\n dd($query->get());\n\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}", "function test_entier($valeur){\r\n return ($valeur>0 || $valeur==\"0\");\r\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}", "private function setGroup2() {\n $this->qestion->groupBy(\"moods.id\");\n //$this->qestion->havingRaw(\"CASE WHEN count(forwarding_drugs.id_mood) = 0 THEN 1 else forwarding_drugs.id_mood END \");\n }", "function checkItem($item, $table, $value){\n global $con;\n \n $stmt2 = $con->prepare(\"Select $item From $table WHERE $item=? \");\n \n $stmt2->execute(array($value));\n \n $resultNum = $stmt2->rowCount();\n \n return $resultNum;\n}", "function countItem($item, $table, $condition = null){\n \n global $con;\n \n if($condition === null){\n $stmt3 = $con->prepare(\"SELECT COUNT($item) FROM $table\");\n $stmt3->execute();\n }\n else{\n $stmt3 = $con->prepare(\"SELECT COUNT($item) FROM $table WHERE $item=?\");\n $stmt3->execute(array($condition));\n } \n \n return $stmt3->fetchColumn();\n}", "function fn_product_condition_get_product_data($product_id, &$field_list, $join, $auth, $lang_code, $condition) {\r\n $field_list .= 'condition';\r\n}", "function voirCommandeRelaienLivraison(){\n\t$conditions = array();\n\tarray_push($conditions, array('nameChamps'=>'modeLivraison','type'=>'=','name'=>'modeLivraison','value'=>'2'));\n\tarray_push($conditions, array('nameChamps'=>'statutCommande','type'=>'=','name'=>'statutCommande','value'=>'3'));\n\t$req = new myQueryClass('commande',$conditions);\n\t$r = $req->myQuerySelect();\n\treturn $r;\n}", "function getExcludeObsoleteItemsStmt($table) {\n $sql = '';\n $sql .= '('.$table.'.obsolescence_date = 0 OR ';\n $sql .= ' '.$table.'.obsolescence_date > '.Docman_ItemDao::getObsoleteToday().')';\n return $sql;\n }", "function kembalikanInventory($id){\n return false;\n}", "function checkInventory($userid, $ingredient){\n\t\n\t\t $count = @mysql_query(\"SELECT COUNT(*) as count FROM Inventory WHERE (UserID = '$userid' \n\t\t AND IngredientName = '$ingredient')\");\n\t\t $countdata = mysql_fetch_assoc($count);\n\t\t if($countdata['count'] <= 0)\n\t\t return false;\n\t\t else return true;\n\t}", "function translated_plain_where($base, $field) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $this->dict[$this->lang][$GLOBALS[$base][\"conj_\".$i]]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $c = $this->dict[$this->lang][$GLOBALS[$base][\"comp_\".$i]];\r\n else\r\n $c = $this->compare[$GLOBALS[$base][\"comp_\".$i]];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $field[$GLOBALS[$base][\"sel_\".$i]],\r\n $c,\r\n $GLOBALS[$base][\"input_\".$i]);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "public function testBuildFromEmpty()\n {\n $query = $this->getQuery()\n ->buildFrom()\n ;\n }", "public function testconstructSQLClauseNot()\n {\n $_SESSION['behat']['GenesisSqlExtension']['keywords'] = [];\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = [];\n\n // Prepare / Mock\n $glue = ' - ';\n $columns = [\n 'firstname' => '!Abdul',\n 'lastname' => 'Qureshi'\n ];\n\n // Execute\n $result = $this->testObject->constructSQLClause($glue, $columns);\n\n $expected = \"firstname != 'Abdul' - lastname = 'Qureshi'\";\n\n // Assert Result\n $this->assertEquals($expected, $result);\n }", "function checkItem($select, $from, $value){\r\n\r\n global $con;\r\n\r\n $statement = $con->prepare(\"SELECT $select FROM $from WHERE $select = ?\");\r\n\r\n $statement->execute(array($value));\r\n\r\n $count = $statement->rowCount();\r\n\r\n return $count;\r\n\r\n}", "public function updateItem($item) {\n\t\tif(isset($item['id'])){\n\t\t\t$id = $item['id'];\n\t\t\tunset($item['id']);\n\t\t\t\n\t\t\t$params['set'] =$item;\n\t\t\t$params['condition'] = array('id' => $id); \n\t\t\treturn tdb::update(self::$tablename,$params);\n\t\t}\n\t\treturn false;\n\t}", "public function get_item($field, $where = array()) {\n if (!is_array($where)) {\n $where = array();\n }\n //add group clausule\n $where[\"arraygroup\"] = \"items\";\n //now get that item\n return $field->get_sqlarray( \n array(\"where\" => $where)\n );\n }", "public function isAMainItem(): bool\n {\n return MealMealItem::where('meal_item_id', $this->id)\n ->where('is_main',1)\n ->count() > 0;\n }", "static public function mdlMostrarSignoss($tabla, $item, $valor){\n\n if($item != null){\n\n $stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla WHERE $item = :$item\");\n\n $stmt -> bindParam(\":\".$item, $valor, PDO::PARAM_STR);\n\n $stmt -> execute();\n\n return $stmt -> fetch();\n\n }else{\n\n $stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla\");\n\n $stmt -> execute();\n\n return $stmt -> fetchAll();\n\n }\n\n $stmt -> close();\n\n $stmt = null;\n\n}", "public function getCondition() { \n \t\treturn $this->condition . tx_newspaper::enableFields(tx_newspaper::getTable($this)); \n \t}", "function getItems($cond)\n {\n $this->db->select(\"*\");\n $this->db->from(\"feedback\");\n $this->db->where($cond);\n $query = $this->db->get();\n return $query->result();\n }", "function not_active_productos()\n {\n $query = $this->db->get_where('productos', array('eliminado' => 'SI'));\n if($query->num_rows()>0) {\n return $query;\n } else {\n return FALSE;\n }\n }", "protected function assertNullQueryApplied($actual)\n\t{\n\t\t$this->assertStringContainsString('0 = 1', $actual->toSql());\n\n\t\treturn $this;\n\t}", "function get_analysed($item, $groupid = false, $courseid = false, $where_clause = false) {\n return array();\n }", "public function getFilteredData($params){\n $kelas = (empty($params['kelas']))?'empty':$params['kelas'];\n $jurusan = (empty($params['jurusan']))?'empty':$params['jurusan'];\n $no_kelas = (empty($params['no_kelas']))?'0':$params['no_kelas'];\n $qb = $this->getEntityManager()->createQueryBuilder();\n $qb->select('n')\n ->from('NilaiHarianEntity', 'n')\n ->innerJoin('n.siswa', 's');\n if($no_kelas === '0' && $jurusan === 'empty' && !($kelas === 'empty') ){\n $qb->andWhere(\"s.kelas = :kelas\")\n ->setParameter('kelas', $kelas)\n ->orderBy(\"s.nis\", \"ASC\");\n }elseif ($no_kelas === '0' && $kelas === 'empty' && !($jurusan === 'empty')) {\n $qb->andWhere(\"s.jurusan = :jurusan\")\n ->setParameter('jurusan', $jurusan)\n ->orderBy(\"s.nis\", \"ASC\");\n }elseif ($no_kelas === '0' && !($jurusan === 'empty') && !($kelas === 'empty')) {\n $qb->andWhere(\"s.kelas = :kelas\")\n ->andWhere(\"s.jurusan = :jurusan\")\n ->setParameter('jurusan', $jurusan)\n ->setParameter('kelas', $kelas)\n ->orderBy(\"s.nis\", \"ASC\");\n }elseif ($kelas === 'empty' && !($jurusan === 'empty') && !($no_kelas === '0')) {\n $qb->andWhere(\"s.jurusan = :jurusan\")\n ->andWhere(\"s.no_kelas = :no_kelas\")\n ->setParameter('jurusan', $jurusan)\n ->setParameter('no_kelas', $no_kelas)\n ->orderBy(\"s.nis\", \"ASC\");\n }elseif(!($no_kelas === '0') && !($jurusan === 'empty') && !($kelas === 'empty')){\n $qb->andWhere(\"s.jurusan = :jurusan\")\n ->andWhere(\"s.no_kelas = :no_kelas\")\n ->andWhere('s.kelas = :kelas')\n ->setParameter('jurusan', $jurusan)\n ->setParameter('no_kelas', $no_kelas)\n ->setParameter('kelas', $kelas)\n ->orderBy(\"s.nis\", \"ASC\");\n }else{\n \n }\n $query = $qb->getQuery();\n return $query->getResult();\n }", "function get_muebles()\n {\n $query = $this->db->get_where('productos', array('eliminado' => 'NO', 'id_categoria' => '2'));\n\n if($query->num_rows()>0) {\n return $query;\n } else {\n return FALSE;\n }\n }", "function getFiltroTiposTaxa($get = null,$where = \" 1 = 1\"){\n $Result = \"\"; \n if(isset($get['getFiltroTipo'])){\n foreach ($get['getFiltroTipo'] as $key => $value ) {\n \n switch ($value) {\n case 1:\n $where .= \" AND TDE <> 0 \";\n break;\n case 2:\n $where .= \" AND TDA <> 0 \";\n break;\n case 3:\n $where .= \" AND TDE = 0 \";\n break;\n case 4:\n $where .= \" AND TDA = 0 \";\n break;\n } \n } \n return $where;\n }\n }", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "function stocks_pre_boucle($boucle) {\n $id_table = $boucle->id_table;\n\n //Savoir si on consulté la table organisations_liens\n if ($jointure = array_keys($boucle->from, 'spip_stocks')) {\n //Vérifier qu'on est bien dans le cas d'une jointure automatique\n if (isset($boucle->join[$jointure[0]])\n and isset($boucle->join[$jointure[0]][3])\n and $boucle->join[$jointure[0]]\n and $boucle->join[$jointure[0]][3]\n ) {\n //Le critere ON de la jointure (index 3 dans le tableau de jointure) est incompléte\n //on fait en sorte de retomber sur ses pattes, en indiquant l'objet à joindre\n $boucle->join[$jointure[0]][3] = \"'L1.objet='.sql_quote('\".objet_type($id_table).\"')\";\n\t\t}\n }\n\n return $boucle;\n}", "function getJoinCondition() ;", "public function mesto($data)\n {\n if(property_exists($data, 'mestoNalaska'))\n {\n if(property_exists($data, 'prikaziNelokalizovanePodatke') && $data->prikaziNelokalizovanePodatke == true)\n {\n return 'where (Mesto.naziv LIKE :mestoNalaska or Toznaka.lokalizovano = false) ';\n\n }\n else\n {\n //ne mora left join - mora da ima mesto\n return 'where Mesto.naziv LIKE :mestoNalaska ';\n\n }\n\n }\n else\n //vracamo nesto sto je uvek tacno, ali da fiksiramo gde je where\n return \"where Mesto.naziv LIKE '%' \";\n }", "function esiUpdateApiContractItems() {\n $table = db_asocquery(\"DESCRIBE `apicontractitems`;\");\n $found = FALSE;\n foreach ($table as $column) {\n if ($column['Field']=='rawQuantity' && $column['Type']=='int(11)') {\n $found = TRUE;\n }\n } \n if ($found === FALSE) {\n return db_uquery(\"ALTER TABLE `apicontractitems` ADD COLUMN `rawQuantity` int(11) NULL DEFAULT NULL AFTER `quantity`;\");\n }\n return TRUE;\n}", "function checkitems($select , $from , $value) {\n\n\t\tglobal $con; // To use var at any place in any function\n\n\t\t$statment = $con->prepare(\"SELECT $select FROM $from WHERE $select = ?\");\n\n\t\t$statment->execute(array($value));\n\n\t\t$count = $statment->rowCount();\n\n\t\treturn $count;\n\t}", "function data_term_condition() {\n return $this->db->get('t_page_term_condition');\n }", "public function queryAll($campos=\"*\",$criterio=\"\");", "private function getQueryConditions($sql, $profileIsp, $profileItemCond, $typeFieldName)\n {\n $itemDataType = $profileIsp['item_data_type'];\n if ($itemDataType == 'S') {\n $ispCatArray = array_column($profileIsp['category_type'], 'value');\n $inString = \"'\" . implode(\"','\", $ispCatArray) . \"'\";\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND metadata_value IN (\" . $inString . \") $profileItemCond ) \";\n } elseif ($itemDataType == 'D') {\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND STR_TO_DATE(metadata_value, \\\"%m/%d/%Y\\\") >= '\" . $profileIsp['start_date'] . \"' AND STR_TO_DATE(metadata_value, \\\"%m/%d/%Y\\\") <= '\" . $profileIsp['end_date'] . \"' $profileItemCond ) \";\n } elseif ($itemDataType == 'N') {\n if ($profileIsp['is_single']) {\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND metadata_value = '\" . $profileIsp['single_value'] . \"' $profileItemCond ) \";\n } else {\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND metadata_value >= \" . $profileIsp['min_digits'] . \" AND metadata_value <= \" . $profileIsp['max_digits'] . \" $profileItemCond) \";\n }\n }\n }" ]
[ "0.56072336", "0.53392047", "0.5316762", "0.5153812", "0.5146575", "0.51356626", "0.512279", "0.5056664", "0.5055824", "0.5045938", "0.50270075", "0.50265443", "0.50245875", "0.49932677", "0.49638268", "0.4954881", "0.49430794", "0.4942311", "0.49337065", "0.49205577", "0.48972628", "0.48843908", "0.4874496", "0.48704842", "0.48609498", "0.4854097", "0.4848871", "0.47912022", "0.47908622", "0.47745514", "0.47652516", "0.47476202", "0.4747577", "0.4744077", "0.47206157", "0.4719523", "0.47186473", "0.4709676", "0.47080684", "0.47064453", "0.4696058", "0.46669734", "0.46642727", "0.4652294", "0.46440142", "0.46399102", "0.46362343", "0.46337724", "0.4627807", "0.46260497", "0.46177885", "0.4617422", "0.4614627", "0.46109805", "0.4604036", "0.45891765", "0.45864663", "0.45816782", "0.4574855", "0.45743945", "0.45655113", "0.4557195", "0.4555452", "0.45439515", "0.45275614", "0.45212752", "0.45208278", "0.45200917", "0.45186788", "0.45155525", "0.45024", "0.4498943", "0.44927052", "0.44923928", "0.4486395", "0.44859084", "0.44775754", "0.44739553", "0.4472185", "0.4470536", "0.44654107", "0.4464217", "0.44620088", "0.4461761", "0.4461154", "0.4460241", "0.4458559", "0.44580904", "0.4457413", "0.44546965", "0.44532335", "0.44531146", "0.44483337", "0.44457278", "0.44450372", "0.44440275", "0.4442638", "0.4441152", "0.4440167", "0.4439545", "0.44310293" ]
0.0
-1
$condition = "items.anoti = 0";
public function GetNewItemsDataNoti() { $this->db->select('items.item_id,items.item_name,items.description,items.verified,items.block,vendor.name,vendor.shop_name,vendor.address,vendor.mobile_no,sub_category.sub_cat_name,category.category_name,filters.filt_name'); $this->db->from('items'); $this->db->join('vendor','vendor.vid = items.vid','left'); $this->db->join('filters','filters.filt_id = items.f_id','left'); $this->db->join('sub_category','sub_category.sub_cat_id = filters.sub_cat_id','left'); $this->db->join('category','category.cat_id = sub_category.cat_id','left'); $this->db->where('items.verified',0); // $this->db->where($condition); $query = $this->db->get(); return $query->result(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_condition($item) {\n\t\treturn $this->conditions[$this->prefix.$item['id']] = $item['condition'];\n\t}", "function getItems($where, $value, $approve = NULL){\r\n\tglobal $con;\r\n\tif($approve == NULL) { $sql = 'AND Approve = 1';}else{$sql = '';}\r\n\t$getItems = $con->prepare(\"SELECT * FROM items WHERE $where = ? $sql ORDER BY item_ID DESC\");\r\n\t$getItems->execute(array($value));\t\r\n\t$items = $getItems->fetchAll();\r\n\treturn $items;\r\n\r\n\r\n}", "function _getItemSearchFromStmt() {\n $sql = 'FROM plugin_docman_item AS i'.\n ' LEFT JOIN plugin_docman_version AS v'.\n ' ON (i.item_id = v.item_id)'.\n ' LEFT JOIN plugin_docman_version AS v2'.\n ' ON (v2.item_id = v.item_id AND v.number < v2.number) ';\n return $sql;\n }", "function accesrestreint_breves_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('NOT IN','$primary','('.sql_get_select('zzzb.id_breve','spip_breves as zzzb',\".accesrestreint_rubriques_accessibles_where('zzzb.id_rubrique','',$_publique).\",'','','','',\\$connect).')')\";\r\n\t#return \"array('IN','$primary',array('SUBSELECT','id_breve','spip_breves',array(\".accesrestreint_rubriques_accessibles_where('id_rubrique').\")))\";\r\n}", "function accesrestreint_rubriques_accessibles_where($primary,$not='NOT', $_publique=''){\r\n\tif (!$_publique) $_publique = \"!test_espace_prive()\";\r\n\treturn \"sql_in('$primary', accesrestreint_liste_rubriques_exclues($_publique), '$not')\";\r\n}", "function getItem($where, $value, $approve = null)\n{\n global $con;\n\n $sql = $approve == null ? 'AND Item_Approve = 1' : '';\n\n $getItem = $con->prepare(\"Select * From items WHERE $where =? $sql ORDER BY Item_ID DESC\");\n\n $getItem->execute(array($value));\n\n $items = $getItem->fetchAll();\n\n return $items;\n}", "public function zero()\n {\n $this->assertFalse($this->orCriterion->hasCriterion());\n $this->orCriterion->toSQL();\n }", "public function getItemsCriteria() {}", "public function getItemsCriteria() {}", "function accesrestreint_articles_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('NOT IN','$primary','('.sql_get_select('zzza.id_article','spip_articles as zzza',\".accesrestreint_rubriques_accessibles_where('zzza.id_rubrique','',$_publique).\",'','','','',\\$connect).')')\";\r\n\t#return array('SUBSELECT','id_article','spip_articles',array(\".accesrestreint_rubriques_accessibles_where('id_rubrique').\")))\";\r\n}", "public function testConditionOverride() {\n\t\t$products = $this->productsManager->filter(Attr::id()->lt(3))->find(Attr::category()->eq('Clothes'));\n\t\t$this->assertCount(3, $products);\n\t}", "private function sql_resAllItemsFilterWiRelation()\n {\n // Don't count hits\n $bool_count = false;\n\n // Query for all filter items\n $select = $this->sql_select( $bool_count );\n $from = $this->sql_from();\n $where = $this->sql_whereAllItems();\n $groupBy = $this->curr_tableField;\n $orderBy = $this->sql_orderBy();\n $limit = $this->sql_limit();\n\n// $query = $GLOBALS['TYPO3_DB']->SELECTquery\n// (\n// $select,\n// $from,\n// $where,\n// $groupBy,\n// $orderBy,\n// $limit\n// );\n//$this->pObj->dev_var_dump( $query );\n // Execute query\n $arr_return = $this->pObj->objSqlFun->exec_SELECTquery\n (\n $select, $from, $where, $groupBy, $orderBy, $limit\n );\n // Execute query\n\n return $arr_return;\n }", "function s_m_put_get_condition($ref_id_db_arr, $ref_data){\r\n $where = \"\";\r\n for($i = 0; $i < count($ref_id_db_arr); $i++){\r\n $where .= $ref_id_db_arr[$i] . \"='\" . $ref_data[$i] . \"'' AND \";\r\n }\r\n return substr($where, 0, strlen($where) - 5);\r\n}", "public function buildConditionQuery()\n\t\t\t{\n\t\t\t\t$this->sql_condition = ' user_id='.$this->CFG['user']['user_id'];\n\t\t\t}", "function accesrestreint_syndic_articles_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('NOT IN','$primary','('.sql_get_select('zzzs.id_syndic','spip_syndic as zzzs',\".accesrestreint_rubriques_accessibles_where('zzzs.id_rubrique','',$_publique).\",'','','','',\\$connect).')')\";\r\n\t#return \"array('IN','$primary',array('SUBSELECT','id_syndic','spip_syndic',array(\".accesrestreint_rubriques_accessibles_where('id_rubrique').\")))\";\r\n}", "function beforeFind($queryData) {\r\n\t\t\t\t\tif (is_array($queryData['conditions'])) {\r\n\t\t\t\t\t\t$queryData['conditions']['Auction.deleted']=0;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$queryData['conditions'].=' AND Auction.deleted=0';\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn $queryData;\r\n\t\t\t\t}", "function itemExistsNotDeleted($itemId){\n return getSingleValue(\"SELECT COUNT(`id`) FROM `public_items` WHERE `id` =\" . escape(intval($itemId)) . \" AND `deleted` =0 LIMIT 0, 1\");\n }", "public function testConditionClause()\n {\n $condition = $this->getConnection()\n ->condition()\n (\"WHERE blog_id = :id\");\n return $this->assertEquals($condition, \"WHERE blog_id = :id\");\n }", "function test_select_items($urabe, $body)\n{\n $sql = $body->sql_simple;\n $result = $urabe->select_items($sql);\n return $result;\n}", "public function count_condition($param = 0)\n\t{\n\t\t$query = $this->db->query(\"SELECT kondisi FROM tb_inventori_item WHERE kondisi = ?\", array($param));\n\t\treturn $query->num_rows();\n\t}", "function has_js_condition($item) {\n\t\treturn isset($item['condition']) && is_array($item['condition']);\n\t}", "private function sql_whereAllItems()\n {\n $where = '1 ' .\n $this->sql_whereAnd_pidList() .\n $this->sql_whereAnd_enableFields() .\n $this->sql_whereAnd_Filter() .\n $this->sql_whereAnd_fromTS() .\n $this->sql_whereAnd_sysLanguage();\n // Get WHERE statement\n // RETURN WHERE statement without a WHERE\n return $where;\n }", "function start_group_where($key,$value=NULL,$escape=TRUE,$type=\"AND\")\n {\n $this->open_bracket($type); \n return parent::_where($key, $value,'',$escape); \n }", "public function check(){\n $query = \"SELECT ordine.id_ordine, ordine.id_fornitore, fornitore.nome as fornitore, ordine.articolo, articolo.taglia, ordine.stato \n FROM \" . $this->table_name . \" LEFT JOIN fornitore ON ordine.id_fornitore = fornitore.id_fornitore \n INNER JOIN articolo ON ordine.id_ordine = articolo.id_ordine WHERE stato = 3\";\n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n return $stmt;\n }", "public function doCheckItemHasNoActiveItems($itemid = -1) {\n if ($itemid > 0) {\n $this->db->select('items.item_manu');\n // we need to do a sub query, this\n $this->db->from('items');\n $this->db->join('item_manu', 'items.item_manu = item_manu.id', 'left');\n $this->db->where('items.item_manu', $itemid);\n $this->db->where('items.active', 1);\n $resQuery = $this->db->get();\n\n\n if ($resQuery->num_rows() > 0) {\n return FALSE;\n } else {\n return TRUE;\n }\n } else {\n return false;\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 compare_operator($query,$item)\n{\n if($query['WHERE'][2]==\"CONTAINS\")\n {\n if(strpos($item,$query['WHERE'][3]) !== false)\n {\n return true;\n }\n }\n else if ($query['WHERE'][2]==\"=\")\n {\n if((is_double($query['WHERE'][3]) && ((double)$item == $query['WHERE'][3])) || strcmp($item, $query['WHERE'][3])==0)\n {\n return true;\n }\n }\n else if ($query['WHERE'][2]==\"<\")\n {\n if((is_double($query['WHERE'][3]) && ((double)$item < $query['WHERE'][3])) || strcmp($item, $query['WHERE'][3]) < 0)\n {\n return true;\n }\n }\n else if ($query['WHERE'][2]==\">\")\n {\n if((is_double($query['WHERE'][3]) && ((double)$item > $query['WHERE'][3])) || strcmp($item, $query['WHERE'][3]) > 0)\n {\n return true;\n }\n }\n return false;\n}", "public function testPDONewWhere()\n {\n $mod = Read::Factory($this->_table, $this->_db, \"MysqlPDO\");\n\n $where = [\n \"(\",\n\n \"(\",\n ['fend_test.`db`.user_id', 14],\n ['users.user_name', 'oak'],\n ['`users`.user_id', \">=\", 0],\n \")\",\n\n \"OR\",\n\n \"(\",\n ['`user_id`', \"<=\", 10000],\n ['user_id', \"like\", '57%'],\n \")\",\n\n \")\",\n\n \"OR\",\n\n ['user_id', \"in\", [1, 2, 3, 4, 5, 6]],\n\n \"OR\",\n\n \"(\",\n ['user_id', \"not in\", ['a', 'c', 'd', 'f']],\n \" `user_name` = 'yes' \",\n \")\",\n\n ];\n $mod->where($where);\n $sql = $mod->getSql();\n self::assertEquals('SELECT * FROM users WHERE ( ( `fend_test`.`db`.`user_id` = \\'14\\' AND `users`.`user_name` = \\'oak\\' AND `users`.`user_id` >= \\'0\\' ) OR ( `user_id` <= \\'10000\\' AND `user_id` like \\'57%\\' ) ) OR `user_id` in (\\'1\\',\\'2\\',\\'3\\',\\'4\\',\\'5\\',\\'6\\') OR ( `user_id` not in (\\'a\\',\\'c\\',\\'d\\',\\'f\\') AND `user_name` = \\'yes\\' ) ', $sql);\n\n }", "function updateAmazonProductsOfferingConditionNotes($items)\n{\n\tif (sizeof($items) > 0) {\n\t\t$data = array();\n\t\t$data['submitedPrice'] = 0;\n\t\t$caseOfferingConditionNote = \"OfferingConditionNote = CASE\";\n\t\tforeach($items as $key => $item)\n\t\t{\t\n\t\t\tif ($items[$key]['OfferingConditionNote'] != null) {\n\t\t\t\t$caseOfferingConditionNote.= \"\\n WHEN id_product = \" . $items[$key]['id_product'] . \" THEN '\" . $items[$key]['OfferingConditionNote'] . \"'\";\n\t\t\t\t$productsIds[] = $items[$key]['id_product'];\n\t\t\t}\t\t\t\n\t\t}\n\t\tif (count($productsIds) > 0) {\n\t\t\t$caseOfferingConditionNote.= \"\n\t\t\t\tEND\n\t\t\t\tWHERE id_product IN (\" . implode(\", \", $productsIds) . \")\n\t\t\t\";\n\t\t\t$addWhere = $caseOfferingConditionNote;\n\t\t\tSQLUpdate('amazon_products', $data, $addWhere, 'shop', __FILE__, __LINE__);\n\t\t}\n\t}\n}", "function validate_fishbowl_item($mysqli, $item)\n{\n\tif ( empty($item[\"date\"])\n\t || !is_numeric($item[\"log_type\"]) ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}", "function testFilteredQuery()\n {\n $q1 = MysqlQueryFactory::getInstance(array(\n \"parameters\" => array(\n \"simple\" => array(\"TYPE\" => \"String\"),\n \"number\" => array(\"TYPE\" => \"Integer\"),\n \"number2\" => array(\"TYPE\" => \"Integer\")\n ),\n \"base\" => \"SELECT * FROM MiTest WHERE [[%filter%]] \"\n ));\n $q1->setConnection($this->connection);\n $g=new StorageEngineGetParams(array(\"query\"=>\"test\",\"filter\"=>array(\"FIELD\"=>\"simple\",\"OPERATOR\"=>\"EQUALS\",\"VALUE\"=>\"Ho'la\")));\n $composed=$q1->parse($g);\n $this->assertEquals(\"SELECT * FROM MiTest WHERE simple = 'Ho\\\\'la'\",trim($composed));\n }", "protected function unique($item, $value, $operator = '='){\r\n\t\r\n\tswitch($item->row->table){\r\n\t\tcase 'base':\r\n\t\t\t$res = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->tableName.\" WHERE \".$this->fieldName.\" != \".(int)$this->id.\" AND \".$item->row->name.\" \".$operator.\" '\".$value.\"'\");\r\n\t\tbreak; case 'meta':\r\n\t\t\t$res = Db::result(\"SELECT * FROM \"._SQLPREFIX_.$this->metaDataTableName.\" WHERE id_meta = '\".$item->row->name.\"' AND \".$this->metaConnectId.\" != \".$this->id.\" AND \".$item->row->attributes()->system_type.\"_value \".$operator.\" '\".$value.\"'\");\r\n\t\tbreak; default:\r\n\t\t\treturn false;\r\n\t}\r\n\r\n\treturn count($res) == 0 ? true: false; \r\n}", "function remplirConditionGroupeOnly($Motcle) {\r\n\t$RechercheGroupe = ''; // variable Fonction de condition\r\n\tif ($Motcle != \"\") {\r\n\t\t\r\n\t\t$RMotClef = explode ( \" \", $Motcle );\r\n\t\t$NbMotClef = count ( $RMotClef );\r\n\t\t$check = new checkDataBase (); // Instance d'un objet checkDataBase (Voir le fichier checkDataBase.php pour plus d'informations\r\n\t\t\r\n\t\t$matableGroupe = \"groupe\";\r\n\t\t$RequeteTriGroupe = $check->checkTable ( $matableGroupe );\r\n\t\t\r\n\t\t$I = \"0\";\r\n\t\t$RechercheGroupe = '(';\r\n\t\tforeach ( $RequeteTriGroupe as $Row ) {\r\n\t\t\t$Type = preg_replace ( \"[^a-z]\", \"\", $Row ['Type'] );\r\n\t\t\t$Type = explode ( \"(\", $Type );\r\n\t\t\t$I2 = \"0\";\r\n\t\t\t\r\n\t\t\tif ($I != \"0\") {\r\n\t\t\t\t$RechercheGroupe .= \" OR \";\r\n\t\t\t}\r\n\t\t\treset ( $RMotClef );\r\n\t\t\tforeach ( $RMotClef as $V ) {\r\n\t\t\t\t$I2 ++;\r\n\t\t\t\t$V = str_replace ( \"'\", \"''\", $V );\r\n\t\t\t\t$RechercheGroupe .= $Row ['Field'] . \" LIKE '%$V%'\";\r\n\t\t\t\t\r\n\t\t\t\tif ($I2 != $NbMotClef) {\r\n\t\t\t\t\t$RechercheGroupe .= \" OR \";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$I ++;\r\n\t\t}\r\n\t\t$RechercheGroupe .= ')';\r\n\t}\r\n\treturn $RechercheGroupe;\r\n}", "public function rawFilter($filter) {\n\t\t$query = InventorySummary::orderBy('Client_SKU', 'asc');\n\t\tif(isset($filter['objectID']) && strlen($filter['objectID']) > 3) {\n\t\t\t$query = $query->where('objectID', 'like', $filter['objectID'] . '%');\n\t\t}\n\t\tif(isset($filter['Client_SKU']) && strlen($filter['Client_SKU']) > 3) {\n\t\t\t$query = $query->where('Client_SKU', 'like', $filter['Client_SKU'] . '%');\n\t\t}\n\t\tif(isset($filter['Description']) && strlen($filter['Description']) > 3) {\n\t\t\t$query = $query->where('Description', 'like', $filter['Description'] . '%');\n\t\t}\n\n /*\n * Pick face quantity choices\n */\n if(isset($filter['pickQty_rb'])) {\n if($filter['pickQty_rb'] == 'zero') {\n $query = $query->where('pickQty', '=', '0');\n } elseif($filter['pickQty_rb'] == 'belowMin') {\n $query = $query->where('pickQty', '<', '3');\n } elseif($filter['pickQty_rb'] == 'aboveMin') {\n $query = $query->where('pickQty', '>', '2');\n }\n }\n\n /*\n * Activity location quantity choices\n */\n if(isset($filter['actQty_rb'])) {\n if($filter['actQty_rb'] == 'zero') {\n $query = $query->where('actQty', '=', '0');\n } elseif($filter['actQty_rb'] == 'aboveZero') {\n $query = $query->where('actQty', '>', '0');\n }\n }\n\n /*\n * Reserve quantity choices\n */\n if(isset($filter['resQty_rb'])) {\n if($filter['resQty_rb'] == 'zero') {\n $query = $query->where('resQty', '=', '0');\n } elseif($filter['resQty_rb'] == 'aboveZero') {\n $query = $query->where('resQty', '>', '0');\n }\n }\n\n /*\n * Replen Priority choices\n */\n if(isset($filter['replenPrty_cb_noReplen'])\n or isset($filter['replenPrty_cb_20orBelow'])\n or isset($filter['replenPrty_cb_40orBelow'])\n or isset($filter['replenPrty_cb_60orBelow'])) {\n $query->where(function ($query) use ($filter) {\n if (isset($filter['replenPrty_cb_noReplen']) && $filter['replenPrty_cb_noReplen'] == 'on') {\n $query->orWhereNull('replenPrty')\n ->orWhere('replenPrty', '=', '0');\n }\n if (isset($filter['replenPrty_cb_20orBelow']) && $filter['replenPrty_cb_20orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['1', '20']);\n }\n if (isset($filter['replenPrty_cb_40orBelow']) && $filter['replenPrty_cb_40orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['21', '40']);\n }\n if (isset($filter['replenPrty_cb_60orBelow']) && $filter['replenPrty_cb_60orBelow'] == 'on') {\n $query->orWhereBetween('replenPrty', ['41', '60']);\n }\n });\n }\n //dd(__METHOD__.\"(\".__LINE__.\")\", compact('filter', 'query'));\n\n\t\tif(isset($filter['created_at']) && strlen($filter['created_at']) > 1) {\n\t\t\t$query = $query->where('created_at', 'like', $filter['created_at'] . '%');\n\t\t}\n\t\tif(isset($filter['updated_at']) && strlen($filter['updated_at']) > 1) {\n\t\t\t$query = $query->where('updated_at', 'like', $filter['updated_at'] . '%');\n\t\t}\n return $query;\n }", "function requetefiltre($num_dep,$insee,$idmare,$interco){\n\t//POUR LES DEPARTEMENT\n\tif($num_dep <> 0){\n\t\t$condition = 'AND LEFT(lg.\"L_ADMIN\",2) = '.\"'\".$num_dep.\"'\".'';\n\t}else{\n\t\t$condition = '';\n\t}\n\t//POUR LES INTERCO\n\tif($interco <> 0){\n\t\t$condition .= 'AND intercommunalite.\"Num_fiscalite\" = '.\"'\".$interco.\"'\".'';\n\t}else{\n\t\t$condition .= '';\n\t}\n\t//POUR LES COMMUNES\n\tif($insee <> 0){\n\t\t$condition .= 'AND lg.\"L_ADMIN\" = '.\"'\".$insee.\"'\".'';\n\t}else{\n\t\t$condition .= '';\n\t}\n\t//POUR LES MARE\n\tif($idmare <> 0){\n\t\t$condition = ' AND lg.\"L_ID\" = '.\"'\".$idmare.\"'\".'';\n\t}else{\n\t\t$condition .= '';\n\t}\n\t\n\treturn $condition;\n\t\n}", "private static function createAndJsonContainsExpression(string $field, array $items, string $path) : Expression\n {\n $i = 0;\n $expression = '(';\n\n foreach ($items as $item) {\n if ($i) {\n $expression .= ' AND ';\n }\n\n $expression .= static::generateExpression($field, $item, $path);;\n $i++;\n }\n\n $expression .= ')';\n\n return new Expression($expression);\n }", "public function getViaTableCondition();", "public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}", "public function globalVarConditionDoesNotMatchOnEmptyExpressionWithValueSetToZero() {}", "public function get_unapproved_items() {\n return $this->query(\"SELECT * FROM `items` where NOT `approved` order by `premium` desc, `date`\");\n }", "protected function user_where_clause() {}", "public function testOrCondition() {\n\t\t$products = $this->productsManager->find(Q::orfilter(Attr::id()->eq(5), Attr::id()->eq(3)));\n\t\t$this->assertCount(2, $products);\n\t}", "public function getConditions($form = null) {\n\t\treturn 'messageTable.isDeleted = 0 AND messageTable.isDisabled = 0';\n\t}", "function deleteItems($cond)\n {\n $this->db->where($cond);\n $this->db->delete(\"feedback\");\n return true;\n }", "function simplenews_build_subscription_filter_query(SelectQueryInterface $query) {\n if (isset($_SESSION['simplenews_subscriptions_filter'])) {\n foreach ($_SESSION['simplenews_subscriptions_filter'] as $key => $value) {\n switch ($key) {\n case 'list':\n if ($value != 'all') {\n list($key, $value) = explode('-', $value, 2);\n $query->condition('su.' . $key, $value);\n }\n break;\n case 'email':\n if (!empty($value)) {\n $query->condition('sn.mail', '%' . $value . '%', 'LIKE');\n }\n break;\n }\n }\n }\n}", "public function Filter_Not() {\r\n\t\treturn array(\r\n\t\t\t'where' => '0'\r\n\t\t);\r\n\t}", "function FilterMethod($row){\n\t\treturn $row['parentid'] == $this->filter;\n }", "function beforeFind($queryData) {\n\t\t\tif (is_array($queryData['conditions'])) {\n\t\t\t\t$queryData['conditions']['Product.deleted']=0;\n\t\t\t} else {\n\t\t\t\t$queryData['conditions'].=' AND Product.deleted=0';\n\t\t\t}\n\t\t\treturn $queryData;\n\t\t}", "public function clearCondition(){\n\t\t$this->where=\"\";\n\t}", "function plain_where($base) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $GLOBALS[$base][\"conj_\".$i]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $v = \"%\".$GLOBALS[$base][\"input_\".$i].\"%\";\r\n else\r\n $v = $GLOBALS[$base][\"input_\".$i];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $GLOBALS[$base][\"sel_\".$i],\r\n $GLOBALS[$base][\"comp_\".$i],\r\n $v);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "private function getSQLCondition() {\n\t\t// the manager can see everyone in the department\n\t\t// the admin and everybody else can see everyone in the company.\n\t\tswitch ($this->page->config['user_level']) {\n\t\t\tcase lu_manager:\n\t\t\tcase lu_employee:\n\t\t\tcase lu_admin:\n\t\t\t\t$sql = 'WHERE 1 = 2';\n\t\t\t\tbreak;\t//nobody below GM can access this subject\n\t\t\tcase lu_gm:\n\t\t\tcase lu_owner:\n\t\t\t\t$sql = ' WHERE c.company_id = '.$this->page->company['company_id'];\n\t\t}\n\t\treturn $sql;\n\t}", "public function testBuildWhereEmpty()\n {\n $query = $this->getQuery();\n\n $this->assertSame(\n '',\n $query->buildWhere()\n );\n }", "function get_condition()\r\n {\r\n $owner = $this->owner;\r\n\r\n $conds = array();\r\n $parent = $this->parent;\r\n $category = $parent->get_parameter(WeblcmsManager :: PARAM_CATEGORY);\r\n $category = $category ? $category : 0;\r\n $conds[] = new EqualityCondition(ContentObjectPublication :: PROPERTY_CATEGORY_ID, $category, ContentObjectPublication :: get_table_name());\r\n\r\n $type_cond = array();\r\n $types = array(Assessment :: get_type_name(), Survey :: get_type_name(), Hotpotatoes :: get_type_name());\r\n foreach ($types as $type)\r\n {\r\n $type_cond[] = new EqualityCondition(ContentObject :: PROPERTY_TYPE, $type);\r\n }\r\n $conds[] = new OrCondition($type_cond);\r\n $c = Utilities :: query_to_condition($this->query);\r\n if (! is_null($c))\r\n {\r\n $conds[] = $c;\r\n }\r\n return new AndCondition($conds);\r\n }", "function simplenews_build_issue_filter_query(EntityFieldQuery $query) {\n if (isset($_SESSION['simplenews_issue_filter'])) {\n foreach ($_SESSION['simplenews_issue_filter'] as $key => $value) {\n switch ($key) {\n case 'list':\n case 'newsletter':\n if ($value != 'all') {\n list($key, $value) = explode('-', $value, 2);\n $query->fieldCondition(variable_get('simplenews_newsletter_field', 'simplenews_newsletter'), 'target_id', $value);\n }\n break;\n }\n }\n }\n}", "public function testHasKidsLessThanZero()\n {\n $this->assertEquals(0, $this->getObject(-1)->getValue());\n }", "public function onItemgroup(){\n\t\t$sql = \"SELECT * FROM `itemgroup` WHERE `status` = 'ON'\";\n\t\t$query = $this->execute($sql);\n\t\tif($query){\n\t\t\treturn $query;\n\t\t}\n\t}", "function GpsData_Filter_Zero($value) {\n\treturn $value > 0;\n}", "function voirCommandeDomicileenLivraison(){\n\t$conditions = array();\n\tarray_push($conditions, array('nameChamps'=>'modeLivraison','type'=>'=','name'=>'modeLivraison','value'=>'1'));\n\tarray_push($conditions, array('nameChamps'=>'statutCommande','type'=>'=','name'=>'statutCommande','value'=>'2'));\n\t$req = new myQueryClass('commande',$conditions);\n\t$r = $req->myQuerySelect();\n\treturn $r;\n}", "function accesrestreint_documents_accessibles_where($primary, $_publique=''){\r\n\t# hack : on utilise zzz pour eviter que l'optimiseur ne confonde avec un morceau de la requete principale\r\n\treturn \"array('IN','$primary','('.sql_get_select('zzz.id_document','spip_documents_liens as zzz',\r\n\tarray(array('OR',\r\n\t\tarray('OR',\r\n\t\t\tarray('AND','zzz.objet=\\'rubrique\\'',\".accesrestreint_rubriques_accessibles_where('zzz.id_objet','NOT',$_publique).\"),\r\n\t\t\tarray('AND','zzz.objet=\\'article\\'',\".accesrestreint_articles_accessibles_where('zzz.id_objet',$_publique).\")\r\n\t\t),\r\n\t\t\tarray('AND','zzz.objet=\\'breve\\'',\".accesrestreint_breves_accessibles_where('zzz.id_objet',$_publique).\")\r\n\t))\"\r\n\t.\",'','','','',\\$connect).')')\";\r\n\t/*return \"array('IN','$primary',array('SUBSELECT','id_document','spip_documents_liens',\r\n\tarray(array('OR',\r\n\t\tarray('OR',\r\n\t\t\tarray('AND','objet=\\'rubrique\\'',\".accesrestreint_rubriques_accessibles_where('id_objet').\"),\r\n\t\t\tarray('AND','objet=\\'article\\'',\".accesrestreint_articles_accessibles_where('id_objet').\")\r\n\t\t),\r\n\t\t\tarray('AND','objet=\\'breve\\'',\".accesrestreint_breves_accessibles_where('id_objet').\")\r\n\t))\r\n\t))\";*/\r\n}", "public function queryItem(Model $item, $extraCondition = array())\n {\n $condition = $item->queryGetCondition($extraCondition, Model::READ);\n return $this->query($condition, 'query');\n\n }", "function neworder_where(){\n\t\treturn false;\n\t}", "protected function _buildWhere(&$query)\r\n {\r\n\r\n\r\n \t//if($this->_checkin!=null)\r\n \t//{\r\n \t//\t$query->where('ltap.ltap_qdatu = \"'.$this->_confdate.'\"');\r\n \t//}\r\n return $query;\r\n }", "protected function parse_conditionset($recordid, $items, &$fields) {\n if (is_array($items) && count($items) == 2 && key($items) === 0) {\n // ARRAY(join, conditions)\n if ($join = $this->parse_join($items[0])) {\n if ($conditions = $this->parse_conditions($recordid, $items[1], $fields)) {\n return array($join, $conditions);\n }\n }\n }\n if ($conditions = $this->parse_conditions($recordid, $items, $fields)) {\n return array('AND', $conditions);\n }\n return false;\n }", "public function scopeBake(Builder $query, array $items)\n {\n //\"select * from `game_item_recipes` where items->\"$.id\" = 3\"\n $query->whereHas(\"items\", function(){\n\n });\n\n dd($query->get());\n\n }", "function test_entier($valeur){\r\n return ($valeur>0 || $valeur==\"0\");\r\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}", "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}", "private function setGroup2() {\n $this->qestion->groupBy(\"moods.id\");\n //$this->qestion->havingRaw(\"CASE WHEN count(forwarding_drugs.id_mood) = 0 THEN 1 else forwarding_drugs.id_mood END \");\n }", "function checkItem($item, $table, $value){\n global $con;\n \n $stmt2 = $con->prepare(\"Select $item From $table WHERE $item=? \");\n \n $stmt2->execute(array($value));\n \n $resultNum = $stmt2->rowCount();\n \n return $resultNum;\n}", "function countItem($item, $table, $condition = null){\n \n global $con;\n \n if($condition === null){\n $stmt3 = $con->prepare(\"SELECT COUNT($item) FROM $table\");\n $stmt3->execute();\n }\n else{\n $stmt3 = $con->prepare(\"SELECT COUNT($item) FROM $table WHERE $item=?\");\n $stmt3->execute(array($condition));\n } \n \n return $stmt3->fetchColumn();\n}", "function fn_product_condition_get_product_data($product_id, &$field_list, $join, $auth, $lang_code, $condition) {\r\n $field_list .= 'condition';\r\n}", "function getExcludeObsoleteItemsStmt($table) {\n $sql = '';\n $sql .= '('.$table.'.obsolescence_date = 0 OR ';\n $sql .= ' '.$table.'.obsolescence_date > '.Docman_ItemDao::getObsoleteToday().')';\n return $sql;\n }", "function voirCommandeRelaienLivraison(){\n\t$conditions = array();\n\tarray_push($conditions, array('nameChamps'=>'modeLivraison','type'=>'=','name'=>'modeLivraison','value'=>'2'));\n\tarray_push($conditions, array('nameChamps'=>'statutCommande','type'=>'=','name'=>'statutCommande','value'=>'3'));\n\t$req = new myQueryClass('commande',$conditions);\n\t$r = $req->myQuerySelect();\n\treturn $r;\n}", "function checkInventory($userid, $ingredient){\n\t\n\t\t $count = @mysql_query(\"SELECT COUNT(*) as count FROM Inventory WHERE (UserID = '$userid' \n\t\t AND IngredientName = '$ingredient')\");\n\t\t $countdata = mysql_fetch_assoc($count);\n\t\t if($countdata['count'] <= 0)\n\t\t return false;\n\t\t else return true;\n\t}", "function kembalikanInventory($id){\n return false;\n}", "function translated_plain_where($base, $field) {\r\n for($i=1; $i<=$this->conditions; $i++) {\r\n ## Only create conditions for used input fields\r\n if ($GLOBALS[$base][\"input_\".$i] == \"\")\r\n continue;\r\n\r\n ## If necessary, add conjunction\r\n if ($q != \"\")\r\n $q .= sprintf(\" %s \", $this->dict[$this->lang][$GLOBALS[$base][\"conj_\".$i]]);\r\n \r\n ## Handle \"like\"\r\n if ($GLOBALS[$base][\"comp_\".$i] == \"like\")\r\n $c = $this->dict[$this->lang][$GLOBALS[$base][\"comp_\".$i]];\r\n else\r\n $c = $this->compare[$GLOBALS[$base][\"comp_\".$i]];\r\n\r\n ## Create subcondition\r\n $q .= sprintf(\"%s %s '%s'\",\r\n $field[$GLOBALS[$base][\"sel_\".$i]],\r\n $c,\r\n $GLOBALS[$base][\"input_\".$i]);\r\n }\r\n \r\n if (!$q) {\r\n $q = \"1=0\";\r\n }\r\n \r\n return \"( $q )\";\r\n }", "public function testBuildFromEmpty()\n {\n $query = $this->getQuery()\n ->buildFrom()\n ;\n }", "public function testconstructSQLClauseNot()\n {\n $_SESSION['behat']['GenesisSqlExtension']['keywords'] = [];\n $_SESSION['behat']['GenesisSqlExtension']['notQuotableKeywords'] = [];\n\n // Prepare / Mock\n $glue = ' - ';\n $columns = [\n 'firstname' => '!Abdul',\n 'lastname' => 'Qureshi'\n ];\n\n // Execute\n $result = $this->testObject->constructSQLClause($glue, $columns);\n\n $expected = \"firstname != 'Abdul' - lastname = 'Qureshi'\";\n\n // Assert Result\n $this->assertEquals($expected, $result);\n }", "function checkItem($select, $from, $value){\r\n\r\n global $con;\r\n\r\n $statement = $con->prepare(\"SELECT $select FROM $from WHERE $select = ?\");\r\n\r\n $statement->execute(array($value));\r\n\r\n $count = $statement->rowCount();\r\n\r\n return $count;\r\n\r\n}", "public function updateItem($item) {\n\t\tif(isset($item['id'])){\n\t\t\t$id = $item['id'];\n\t\t\tunset($item['id']);\n\t\t\t\n\t\t\t$params['set'] =$item;\n\t\t\t$params['condition'] = array('id' => $id); \n\t\t\treturn tdb::update(self::$tablename,$params);\n\t\t}\n\t\treturn false;\n\t}", "public function isAMainItem(): bool\n {\n return MealMealItem::where('meal_item_id', $this->id)\n ->where('is_main',1)\n ->count() > 0;\n }", "public function get_item($field, $where = array()) {\n if (!is_array($where)) {\n $where = array();\n }\n //add group clausule\n $where[\"arraygroup\"] = \"items\";\n //now get that item\n return $field->get_sqlarray( \n array(\"where\" => $where)\n );\n }", "static public function mdlMostrarSignoss($tabla, $item, $valor){\n\n if($item != null){\n\n $stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla WHERE $item = :$item\");\n\n $stmt -> bindParam(\":\".$item, $valor, PDO::PARAM_STR);\n\n $stmt -> execute();\n\n return $stmt -> fetch();\n\n }else{\n\n $stmt = Conexion::conectar()->prepare(\"SELECT * FROM $tabla\");\n\n $stmt -> execute();\n\n return $stmt -> fetchAll();\n\n }\n\n $stmt -> close();\n\n $stmt = null;\n\n}", "public function getCondition() { \n \t\treturn $this->condition . tx_newspaper::enableFields(tx_newspaper::getTable($this)); \n \t}", "protected function assertNullQueryApplied($actual)\n\t{\n\t\t$this->assertStringContainsString('0 = 1', $actual->toSql());\n\n\t\treturn $this;\n\t}", "function not_active_productos()\n {\n $query = $this->db->get_where('productos', array('eliminado' => 'SI'));\n if($query->num_rows()>0) {\n return $query;\n } else {\n return FALSE;\n }\n }", "function getItems($cond)\n {\n $this->db->select(\"*\");\n $this->db->from(\"feedback\");\n $this->db->where($cond);\n $query = $this->db->get();\n return $query->result();\n }", "function get_analysed($item, $groupid = false, $courseid = false, $where_clause = false) {\n return array();\n }", "public function getFilteredData($params){\n $kelas = (empty($params['kelas']))?'empty':$params['kelas'];\n $jurusan = (empty($params['jurusan']))?'empty':$params['jurusan'];\n $no_kelas = (empty($params['no_kelas']))?'0':$params['no_kelas'];\n $qb = $this->getEntityManager()->createQueryBuilder();\n $qb->select('n')\n ->from('NilaiHarianEntity', 'n')\n ->innerJoin('n.siswa', 's');\n if($no_kelas === '0' && $jurusan === 'empty' && !($kelas === 'empty') ){\n $qb->andWhere(\"s.kelas = :kelas\")\n ->setParameter('kelas', $kelas)\n ->orderBy(\"s.nis\", \"ASC\");\n }elseif ($no_kelas === '0' && $kelas === 'empty' && !($jurusan === 'empty')) {\n $qb->andWhere(\"s.jurusan = :jurusan\")\n ->setParameter('jurusan', $jurusan)\n ->orderBy(\"s.nis\", \"ASC\");\n }elseif ($no_kelas === '0' && !($jurusan === 'empty') && !($kelas === 'empty')) {\n $qb->andWhere(\"s.kelas = :kelas\")\n ->andWhere(\"s.jurusan = :jurusan\")\n ->setParameter('jurusan', $jurusan)\n ->setParameter('kelas', $kelas)\n ->orderBy(\"s.nis\", \"ASC\");\n }elseif ($kelas === 'empty' && !($jurusan === 'empty') && !($no_kelas === '0')) {\n $qb->andWhere(\"s.jurusan = :jurusan\")\n ->andWhere(\"s.no_kelas = :no_kelas\")\n ->setParameter('jurusan', $jurusan)\n ->setParameter('no_kelas', $no_kelas)\n ->orderBy(\"s.nis\", \"ASC\");\n }elseif(!($no_kelas === '0') && !($jurusan === 'empty') && !($kelas === 'empty')){\n $qb->andWhere(\"s.jurusan = :jurusan\")\n ->andWhere(\"s.no_kelas = :no_kelas\")\n ->andWhere('s.kelas = :kelas')\n ->setParameter('jurusan', $jurusan)\n ->setParameter('no_kelas', $no_kelas)\n ->setParameter('kelas', $kelas)\n ->orderBy(\"s.nis\", \"ASC\");\n }else{\n \n }\n $query = $qb->getQuery();\n return $query->getResult();\n }", "function getFiltroTiposTaxa($get = null,$where = \" 1 = 1\"){\n $Result = \"\"; \n if(isset($get['getFiltroTipo'])){\n foreach ($get['getFiltroTipo'] as $key => $value ) {\n \n switch ($value) {\n case 1:\n $where .= \" AND TDE <> 0 \";\n break;\n case 2:\n $where .= \" AND TDA <> 0 \";\n break;\n case 3:\n $where .= \" AND TDE = 0 \";\n break;\n case 4:\n $where .= \" AND TDA = 0 \";\n break;\n } \n } \n return $where;\n }\n }", "function get_muebles()\n {\n $query = $this->db->get_where('productos', array('eliminado' => 'NO', 'id_categoria' => '2'));\n\n if($query->num_rows()>0) {\n return $query;\n } else {\n return FALSE;\n }\n }", "public function whereComplex()\n {\n return $this->addComplexCondition('and', $this->conditions);\n }", "public function mesto($data)\n {\n if(property_exists($data, 'mestoNalaska'))\n {\n if(property_exists($data, 'prikaziNelokalizovanePodatke') && $data->prikaziNelokalizovanePodatke == true)\n {\n return 'where (Mesto.naziv LIKE :mestoNalaska or Toznaka.lokalizovano = false) ';\n\n }\n else\n {\n //ne mora left join - mora da ima mesto\n return 'where Mesto.naziv LIKE :mestoNalaska ';\n\n }\n\n }\n else\n //vracamo nesto sto je uvek tacno, ali da fiksiramo gde je where\n return \"where Mesto.naziv LIKE '%' \";\n }", "function getJoinCondition() ;", "function stocks_pre_boucle($boucle) {\n $id_table = $boucle->id_table;\n\n //Savoir si on consulté la table organisations_liens\n if ($jointure = array_keys($boucle->from, 'spip_stocks')) {\n //Vérifier qu'on est bien dans le cas d'une jointure automatique\n if (isset($boucle->join[$jointure[0]])\n and isset($boucle->join[$jointure[0]][3])\n and $boucle->join[$jointure[0]]\n and $boucle->join[$jointure[0]][3]\n ) {\n //Le critere ON de la jointure (index 3 dans le tableau de jointure) est incompléte\n //on fait en sorte de retomber sur ses pattes, en indiquant l'objet à joindre\n $boucle->join[$jointure[0]][3] = \"'L1.objet='.sql_quote('\".objet_type($id_table).\"')\";\n\t\t}\n }\n\n return $boucle;\n}", "function esiUpdateApiContractItems() {\n $table = db_asocquery(\"DESCRIBE `apicontractitems`;\");\n $found = FALSE;\n foreach ($table as $column) {\n if ($column['Field']=='rawQuantity' && $column['Type']=='int(11)') {\n $found = TRUE;\n }\n } \n if ($found === FALSE) {\n return db_uquery(\"ALTER TABLE `apicontractitems` ADD COLUMN `rawQuantity` int(11) NULL DEFAULT NULL AFTER `quantity`;\");\n }\n return TRUE;\n}", "function data_term_condition() {\n return $this->db->get('t_page_term_condition');\n }", "function checkitems($select , $from , $value) {\n\n\t\tglobal $con; // To use var at any place in any function\n\n\t\t$statment = $con->prepare(\"SELECT $select FROM $from WHERE $select = ?\");\n\n\t\t$statment->execute(array($value));\n\n\t\t$count = $statment->rowCount();\n\n\t\treturn $count;\n\t}", "public function queryAll($campos=\"*\",$criterio=\"\");", "private function getQueryConditions($sql, $profileIsp, $profileItemCond, $typeFieldName)\n {\n $itemDataType = $profileIsp['item_data_type'];\n if ($itemDataType == 'S') {\n $ispCatArray = array_column($profileIsp['category_type'], 'value');\n $inString = \"'\" . implode(\"','\", $ispCatArray) . \"'\";\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND metadata_value IN (\" . $inString . \") $profileItemCond ) \";\n } elseif ($itemDataType == 'D') {\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND STR_TO_DATE(metadata_value, \\\"%m/%d/%Y\\\") >= '\" . $profileIsp['start_date'] . \"' AND STR_TO_DATE(metadata_value, \\\"%m/%d/%Y\\\") <= '\" . $profileIsp['end_date'] . \"' $profileItemCond ) \";\n } elseif ($itemDataType == 'N') {\n if ($profileIsp['is_single']) {\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND metadata_value = '\" . $profileIsp['single_value'] . \"' $profileItemCond ) \";\n } else {\n $this->query[] = $sql . \" (\" . $typeFieldName . \" = \" . $profileIsp['id'] . \" AND metadata_value >= \" . $profileIsp['min_digits'] . \" AND metadata_value <= \" . $profileIsp['max_digits'] . \" $profileItemCond) \";\n }\n }\n }" ]
[ "0.56068283", "0.53370696", "0.53123546", "0.5152085", "0.514558", "0.5133539", "0.5123608", "0.50547945", "0.5053949", "0.5044014", "0.5026291", "0.5024383", "0.5022431", "0.4992591", "0.49619985", "0.49530518", "0.49432042", "0.49423444", "0.49308935", "0.4920024", "0.4897024", "0.48829764", "0.48729593", "0.48703602", "0.48625246", "0.48531199", "0.4849511", "0.47901332", "0.4789051", "0.47748873", "0.47640312", "0.4748453", "0.47480315", "0.4741395", "0.47199643", "0.4719424", "0.47184604", "0.471196", "0.4710349", "0.47063613", "0.46947673", "0.46634626", "0.4653767", "0.46424475", "0.46374127", "0.46368057", "0.46326476", "0.4625993", "0.4624734", "0.4617145", "0.46169856", "0.46151572", "0.46115056", "0.46024874", "0.45911622", "0.45842585", "0.45838895", "0.45729578", "0.45727038", "0.4564915", "0.45551726", "0.45546106", "0.45440784", "0.45252514", "0.45234734", "0.45216346", "0.4518493", "0.4517608", "0.45145002", "0.45020503", "0.4495108", "0.44909966", "0.4490864", "0.44864658", "0.44858652", "0.44771716", "0.4473299", "0.44726372", "0.4468727", "0.44645506", "0.44622454", "0.44614014", "0.4461033", "0.4460506", "0.4459251", "0.44587323", "0.44578826", "0.4456667", "0.44535634", "0.44527933", "0.44524568", "0.4448567", "0.44442502", "0.444348", "0.44432202", "0.44400996", "0.44389352", "0.44387767", "0.44384637", "0.44311583" ]
0.46643665
41
/ $this>db>select('count() as CompletedOrderNoti'); $this>db>from('orders'); $this>db>join('user_address','user_address.user_add_id=orders.user_add_id'); $this>db>join('city','city.city_id=user_address.city_id'); $this>db>join('area','area.area_id=user_address.area_id'); $this>db>join('user','user.uid =orders.uid '); $this>db>join('delivery_boy','delivery_boy.del_id=orders.assigndeliveryboy','left'); $this>db>join('paymentmode','paymentmode.pmid=orders.paymentmodeid'); $this>db>where('orders.status',5); $query = $this>db>get(); $tmpArray = $query>result_array(); $this>data = array_shift($tmpArray); return $this>data["CompletedOrderNoti"];
private function GetCompletedOrderNoti($Vid) { $condition = "orders.status=5 AND items.vid=$Vid"; $this->db->select('*'); $this->db->from('orders'); $this->db->join('user','user.uid =orders.uid'); $this->db->join('vendor_items','find_in_set(vendor_items.vi_id, orders.vi_id)'); $this->db->join('items','items.item_id=vendor_items.item_id'); //$this->db->where('items.vid',$Vid); $this->db->where($condition); $this->db->group_by('orders.order_id'); $query = $this->db->get(); $tmpArray = $query->result_array(); $this->data["CompletedOrderNoti"] = count($tmpArray); return $this->data["CompletedOrderNoti"]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_all_jemaat_count_waiting()\n {\n //$this->db->from('jemaat');\n //return $this->db->query(\"select COUNT(*) as jumlah FROM jemaat WHERE status_jemaat = 'waiting'\")->num_rows();\n return $this->db->where(['status_jemaat'=>'waiting'])->from(\"jemaat\")->count_all_results();\n //return $this->db->count_all_results();\n }", "public function show_order_by_count_post()\n {\n $response = new StdClass();\n $result = new StdClass();\n $admin_id =$this->input->post('admin_id');\n $order_status =$this->input->post('order_status');\n $resdata = $this->Supervisor->check_total_count($admin_id,$order_status);\n if($resdata>0)\n { \n $data1->count=$resdata;\n $data1->status ='1';\n array_push($result,$data1);\n $response->data = $data1;\n }\n else if($resdata==0)\n {\n $data1->count ='0';\n $data1->status = '1';\n array_push($result,$data1);\n $response->data = $data1;\n }\n else \n {\n $data1->status ='0';\n $data1->message = 'failed';\n array_push($result,$data1);\n $response->data = $data1;\n }\n \n echo json_output($response);\n }", "function getOrderDataCount($type=\"\",$limit=\"\",$offset=\"\",$startDate=\"1970:00:00 00:00:00\",$endDate=\"\",$restaurant=\"\",$payment =\"\"){\n\t\tif($limit !=\"\" && ($type <=3 ||$type ==7 || $type == 9))\n\t\t{\n\t\t\t$this->db->limit($limit,$offset);\n\t\t}\n\t\tif($type == 1 || $type == 3 || $type ==7 || $type == 8){\n\t\t\t\n\t\t\t$this->db->join('tbl_customer_delivery_address as cst','cst.address_id =od.selected_delivery_address','left');\n\t\t\t$this->db->join('tbl_locality as lc','lc.locality_id =cst.locality_id','left');\n\t\t\tif($type == 3){\n\t\t\t\t$this->db->select(\"od.order_id as OrderID,od.delivered_time as OrderTime,cst.customer_name as CustomerName,lc.name as Area\");\n\t\t\t}else if($type == 1){\n\t\t\t\t$this->db->select(\"lc.name as Name,count(od.order_id) as TotalOrders,SUM(od.total_price) as TotalSales\");\n\t\t\t\t$this->db->group_by('lc.locality_id');\n\t\t\t}else if($type == 7){\n\t\t\t\t$this->db->join('tbl_restaurants as rs','rs.restaurant_id =od.restaurant_id','left');\n\t\t\t\t$this->db->select(\"od.order_id as Sr,od.order_id as OrderID,od.delivered_time as OrderTime,cst.customer_name as CustName,cst.contact_no as Mobile,od.total_price as Amount,od.order_type as Payment ,lc.name as AreaName,rs.restaurant_name as Restaurant,od.order_status as Status\");\n\t\t\t\tif($payment !=\"\"){\n\t\t\t\t\t$this->db->where('od.order_type',$payment);\n\t\t\t\t}\n\t\t\t\t$this->db->group_by('od.order_id');\n\t\t\t}else if($type == 8){\n\t\t\t\t$this->db->select('od.order_id,od.total_price,od.delivered_time as OrderTime,od.order_type as Payment');\n\t\t\t\tif($payment !=\"\"){\n\t\t\t\t\t$this->db->where('od.order_type',$payment);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->db->order_by(\"od.delivered_time\",\"DESC\");\n\t\t\t\n\t\t}\n\t\telse if($type == 2){\n\t\t\t$this->db->join('tbl_order_details as os','os.order_id =od.order_id');\n\t\t\t$this->db->join('tbl_dishes','tbl_dishes.product_id=os.product_id');\n\t\t\t$this->db->select('tbl_dishes.product_en_name as ItemName, count(os.product_id) as TotalSold');\n\t\t\t$this->db->group_by('os.product_id');\n\t\t}\n\t\telse if($type == 9){\n\t\t\t$this->db->join('tbl_order_details as os','os.order_id =od.order_id');\n\t\t\t$this->db->join('tbl_dishes','tbl_dishes.product_id=os.product_id');\n\t\t\t$this->db->join('tbl_dish_category','tbl_dish_category.category_id = tbl_dishes.category_id',\"INNER\");\n\t\t\t$this->db->select('tbl_dish_category.category_name as category_name, count(os.product_id) as TotalSold');\n\t\t\t$this->db->group_by('tbl_dish_category.category_id');\n\t\t\t$this->db->order_by('TotalSold',\"DESC\");\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\t$this->db->select('od.order_id,od.total_price,od.delivered_time as OrderTime');\n\t\t\t$this->db->order_by(\"OrderTime\",\"DESC\");\n\t\t}\n\n\t\tif($restaurant !=\"\"){\n\t\t\t$this->db->where('od.restaurant_id',$restaurant);\n\t\t}\n\t\tif($startDate !=\"\"){\n\t\t\t$this->db->where(\"od.delivered_time >='$startDate'\");\n\t\t}\n\t\tif($endDate !=\"\"){\n\t\t\t$this->db->where(\"od.delivered_time <= '$endDate'\");\n\t\t}\n\t\t\n\t\tif($type == 3){\n\t\t\t$this->db->where_in('od.order_status',array(13,14));\n\t\t}\n\t\telse{\n\t\t\t$this->db->where_in('od.order_status',array(7,8));\n\t\t}\t\t\n\n\t\t$this->db->from('tbl_orders as od');\n\n\t\treturn $this->db->get()->num_rows();\n\t}", "public function count_post()\n{\n $pdata = file_get_contents(\"php://input\");\n $data = json_decode($pdata,true);\n\n // if(isset($data['company_id']))\n // {\n // $id = $data['company_id'];\n // }\n\n $totalCustomer = $this->model->getcount('users', array(\n 'user_role' => '2'));\n $todayOrders = $this->model->getcount('orders', array(\n 'DATE(created_at)' => date('Y-m-d')));\n $order_list = $this->model->GetJoinRecord('orders', 'user_id', 'users', 'id', 'COUNT(orders.id) as total_orders',array('orders.id!='=>'0'));\n\n $totalOrders = !empty($order_list) ? $order_list[0]->total_orders : 0;\n $pending_order = $this->model->getcount('orders',array('status='=>'placed'));\n $delivered_order = $this->model->getcount('orders',array('status='=>'delivered'));\n $cancel_order = $this->model->getcount('orders',array('status='=>'Cancel'));\n $processing_order = $this->model->getcount('orders',array('status='=>'Progress'));\n $dispatch_order = $this->model->getcount('orders',array('status='=>'Dispatched'));\n \n $resp = array(\n 'rccode' => 200,\n 'message' =>'success',\n 'total_customer' =>$totalCustomer,\n 'today_order' =>$todayOrders,\n 'total_order' => $totalOrders,\n 'pending_order' => $pending_order,\n 'delivered' =>$delivered_order,\n 'Cancel' => $cancel_order,\n 'Packing' => $processing_order,\n 'shipping' => $dispatch_order\n );\n$this->response($resp);\n}", "function fetch_no_order(){\n \t\t$this->db->select('SUM(ORDER_NO)');\n \t\t$this->db->from('sales');\n \t\t$this->db->where('SALES_DATE', date('Y-m-d'));\n \t\t$this->db->where('STATUS', 'Confirmed');\n\n \t\t$this->db->group_by('ORDER_NO');\n \t\t$query=$this->db->get();\n \t\tif($query->num_rows()>0){\n \t\t\treturn $query->num_rows();\n \t\t}\n \t\telse{\n \t\t\treturn 0;\n \t\t}\n \t}", "public function getTotalOrdersMo()\n\t{\n\t\t$query = $this->db->query(\"SELECT COUNT(oc_po_product.id) as total_orders FROM oc_po_order \nLEFT JOIN oc_po_product \nON(oc_po_order.id = oc_po_product.order_id)\nWHERE oc_po_order.user_id='103' AND oc_po_product.item_status <> 0\");\n\t\t$results = $query->row;\n\t\treturn $results['total_orders'];\n\t}", "public function getTotalOrdersAmRcv()\n\t{\n $log=new Log(\"AM_RCV_TOTAL:\".date('Y-m-d').\".log\");\n $log->write(\"SELECT COUNT(id) as total_orders FROM oc_po_order WHERE delete_bit = '1' and order_status = \" . 2);\n $query = $this->db->query(\"SELECT COUNT(id) as total_orders FROM oc_po_order WHERE delete_bit = '1' and order_status = \" . 2);\n $results = $query->row;\n return $results['total_orders'];\n\t}", "function allposts_count_Detail()\n { \n $query = $this->db->query(\"select a.fc_id,a.fc_branch,a.fc_nopo,a.fc_stock,b.fv_stock,CONCAT(b.fv_size,' | ',b.fv_warna) as variant,c.fv_satuan,rupiah(a.fn_price) as price,a.fn_qty,c.fn_uom,(a.fn_qty * c.fn_uom) as konversi,rupiah(a.fn_total) as total from td_po a LEFT OUTER JOIN v_variant b ON b.fc_stock=a.fc_stock AND b.fc_variant=a.fc_variant LEFT OUTER JOIN v_uom c ON c.fc_uom=a.fc_satuan WHERE a.fc_branch='\".$this->session->userdata('branch').\"' and a.fc_nopo='\".$this->session->userdata('userid').\"'\");\n return $query->num_rows(); \n }", "public function display_order_to_deliver_count(){\n $getOrderToDeliverCount = Order::join('order_invoice', ['orders.invoice_id' => 'order_invoice.id'])\n ->where('is_approved',1)\n ->where('delivery_date', '=', date('Y-m-d'))\n ->groupBy('orders.invoice_id') \n ->get()\n ->count();\n\n return response()->json([\n 'count' => $getOrderToDeliverCount,\n 'status' => 200\n ]);\n }", "function getDataOrder(){\n $idCheckout = $this->input->post('id_checkout');\n $orderStatus = $this->input->post('order_status');\n\n $this->db->select(\"*\");\n $this->db->from(\"tb_order\");\n $this->db->where(\"order_status\", $orderStatus);\n $this->db->where(\"id_checkout\", $idCheckout);\n $this->db->join(\"tb_konsumen\", \"tb_konsumen.id_konsumen = tb_order.id_user\");\n $this->db->join(\"tb_payment\", \"tb_payment.id_payment = tb_order.id_payment\");\n $this->db->join(\"tb_status_transaksi\", \"tb_status_transaksi.id_status_transaksi = tb_order.order_status\");\n $this->db->order_by(\"tb_order.tanggal_order\",\"DESC\");\n\n $query = $this->db->get();\n if($query -> num_rows() >0)\n {\n $data['message'] = \"Successfully Get Data Order\";\n $data['status'] = 200;\n $data['dataOrder'] = $query->result();\n }\n else\n {\n $data['message'] = \"Failed Get Data Order\";\n $data['status'] = 400;\n }\n\n echo json_encode($data);\n }", "public function display_order_to_approve_count(){\n // if(env(\"DB_CONNECTION\") == \"pgsql\"){\n // $getOrderToApproveCount = DB::select(\"SELECT COUNT(*) as data FROM orders WHERE is_approved = '0'\");\n // }else{\n // $getOrderToApproveCount = DB::select('SELECT COUNT(*) as data FROM orders WHERE is_approved = 0');\n // }\n \n // return response()->json([\n // 'count' => $getOrderToApproveCount[0],\n // 'status' => 200\n // ]);\n $getOrderToApproveCount = Order::join('order_invoice', ['orders.invoice_id' => 'order_invoice.id'])\n ->where('is_approved',0)\n ->groupBy('orders.invoice_id') \n ->get()\n ->count();\n\n return response()->json([\n 'count' => $getOrderToApproveCount,\n 'status' => 200\n ]);\n }", "function allposts_count_Detail($nopo)\n { \n $query = $this->db->query(\"select a.fc_id,a.fc_branch,a.fc_nopo,a.fc_stock,b.fv_stock,CONCAT(b.fv_size,' | ',b.fv_warna) as variant,c.fv_satuan,rupiah(a.fn_price) as price,a.fn_qty,c.fn_uom,(a.fn_qty * c.fn_uom) as konversi,rupiah(a.fn_total) as total from td_po a LEFT OUTER JOIN v_variant b ON b.fc_stock=a.fc_stock AND b.fc_variant=a.fc_variant LEFT OUTER JOIN v_uom c ON c.fc_uom=a.fc_satuan WHERE a.fc_nopo='\".$nopo.\"'\");\n return $query->num_rows(); \n }", "function getOrder(){\n $idUser = $this->input->post(\"id_user\");\n $orderStatus = $this->input->post(\"order_status\");\n\n $this->db->select(\"*\");\n $this->db->from(\"tb_order\");\n $this->db->where(\"tb_order.id_user\", $idUser);\n $this->db->where(\"tb_order.order_status\", $orderStatus);\n\n $this->db->join(\"tb_konsumen\", \"tb_konsumen.id_konsumen = tb_order.id_user\");\n\n $this->db->join(\"tb_payment\", \"tb_payment.id_payment = tb_order.id_payment\");\n\n $this->db->join(\"tb_status_transaksi\", \"tb_status_transaksi.id_status_transaksi = tb_order.order_status\");\n \n $this->db->order_by(\"tb_order.tanggal_order\",\"DESC\");\n\n $query = $this->db->get();\n if($query -> num_rows() >0)\n {\n $data['message'] = \"Successfully Get Data Order\";\n $data['status'] = 200;\n $data['dataOrder'] = $query->result();\n }\n else\n {\n $data['message'] = \"Failed Get Data Order\";\n $data['status'] = 400;\n }\n\n echo json_encode($data);\n }", "public function jumlahDitolak(){\n $this->db->select(\"count(status_pendaftaran) as status_pendaftaran\");\n $this->db->from($this->_table);\n $this->db->where('status_pendaftaran',\"Tidak Diterima\");\n return $this->db->get()->row()->status_pendaftaran;\n }", "public function jumOrder()\n\t{\n\t\t$this->db->select('count(id_order) as jumorder');\n\t\t$this->db->join('gudang', 'gudang.id_gudang = order.id_gudang');\n\n\t\t$query = $this->db->get('order');\n $row = $query->row();\n $this->db->save_queries = false;\n\n return $row;\n\t}", "public function get_add_player_notification_count($params1){\n $this->db->select(\"*\");\n $this->db->from(\"sl_add_team_notification s\");\n $this->db->join('yalla_team t','t.team_id = s.team_id','left');\n $this->db->where('s.player_id',$params1['player_id']);\n $this->db->where('s.noti_status',0);\n $this->db->where('s.notification_status',0);\n $this->db->where('t.team_status',0);\n $this->db->order_by(\"s.at_noti_id\",\"desc\");\n $this->db->group_by('s.team_id');\n $result = $this->db->get();\n //die(print_r($this->db->last_query()));\n $cnt = $result->num_rows();\n if(empty($cnt)){\n return 0;\n }else{\n return $cnt;\n }\n}", "public function buyer_orders()\n {\n $query = $this->db->where('buyer_id', $this->current_user->user_id)\n ->order_by('time desc')\n //->order_by('progress asc, time desc')\n ->get('orders');\n #echo $this->db->last_query();\n return ($query->num_rows() > 0) ? $this->build_array($query->result_array()) : array();\n\n }", "function data_jumlah_siswa(){\n $this->db->select('s.id as idsiswa,s.namaDepan,s.namaBelakang,s.alamat,s.noKontak,s.namaSekolah,s.alamatSekolah,s.penggunaID,p.namaPengguna,p.eMail');\n $this->db->join('tb_pengguna p', 's.penggunaID = p.id');\n $this->db->where('s.status','1');\n $this->db->where('p.status','1');\n $this->db->order_by('s.namaDepan', 'asc');\n return $query = $this->db->get('tb_siswa s')->num_rows(); \n }", "function fetch_no_order_staff(){\n \t\t$this->db->select('SUM(ORDER_NO)');\n \t\t$this->db->from('sales');\n \t\t$this->db->where('SALES_DATE', date('Y-m-d'));\n \t\t$this->db->where('STATUS', 'Confirmed');\n \t\t$this->db->where('STAFF_ID', $_SESSION['staff_id']);\n \t\t$this->db->group_by('ORDER_NO');\n \t\t$query=$this->db->get();\n \t\tif($query->num_rows()>0){\n \t\t\treturn $query->num_rows();\n \t\t}\n \t\telse{\n \t\t\treturn 0;\n \t\t}\n \t}", "public function modelTotal(){\n\t\t\t//---\n\t\t\t$conn = Connection::getInstance();\n\t\t\t$query = $conn->query(\"select id from orders\");\n\t\t\t//lay tong so ban ghi\n\t\t\treturn $query->rowCount();\n\t\t\t//---\n\t\t}", "public function get_order()\n\t{\n\t\t$sql = \"select * from `order` where status_pembayaran = 0 or status_pembayaran = 1 or status_pembayaran = 2 or status_pembayaran = 4 or status_pembayaran = 5 or status_pembayaran = 7\";\n\t\t$queryRec = $this->db->query($sql)->result_array();\n\t\treturn $queryRec;\n\t}", "function get_note_count(){\n \n $note = new tasting_note();\n $note_count = $note ->row_count();\n \n if(!$note_count){\n $var_result['success']=false;\n return $var_result; \n }\n \n $var_result['note_count'] = $note_count;\n $var_result['success']=true;\n $var_result['data']=$var_result;\n return $var_result; \n \n}", "public function acount_order()\n {\n $user = $this->session->userData('userData');\n $id=$user['oauth_uid'];\n $config['page_query_string'] = TRUE;\n $config['enable_query_string'] = TRUE;\n $config['base_url'] = base_url('don-hang?');\n $config['total_rows'] = $this->f_usersmodel->coutnUserOrder($id); // xác định tổng số record\n $config['per_page'] = 9; // xác định số record ở mỗi trang\n $config['uri_segment'] = 3; // xác định segment chứa page number\n $config['full_tag_open'] = \"<ul class='pagination'>\";\n $config['full_tag_close'] =\"</ul>\";\n $config['num_tag_open'] = '<li>';\n $config['num_tag_close'] = '</li>';\n $config['cur_tag_open'] = \"<li class='disabled'><li class='active'><a href='#'>\";\n $config['cur_tag_close'] = \"<span class='sr-only'></span></a></li>\";\n $config['next_tag_open'] = \"<li>\";\n $config['next_tagl_close'] = \"</li>\";\n $config['prev_tag_open'] = \"<li>\";\n $config['prev_tagl_close'] = \"</li>\";\n $config['first_tag_open'] = \"<li>\";\n $config['first_tagl_close'] = \"</li>\";\n $config['last_tag_open'] = \"<li>\";\n $config['last_tagl_close'] = \"</li>\";\n $this->pagination->initialize($config);\n $data = array();\n\n $data['item_list'] = $this->f_usersmodel->Getlist_oder($id,$config['per_page'], $this->input->get('per_page'));\n\n $order_id=array();\n foreach($data['item_list'] as $v){\n $order_id[]=$v->id;\n }\n if(empty($data['item_list'])){\n $data['detail']=array();\n }else{\n $data['detail'] = $this->f_usersmodel->order_detail($order_id);\n }\n\n $seo = array(\n 'title' => 'Quản lý đơn hàng'\n );\n $this->LoadHeader(null,$seo);\n $this->load->view('users/acount_order',$data);\n $this->LoadFooter();\n\n }", "public function Get_All_Work_Order($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 WHERE A.Created_By='$id'\");\n $query=$this->db->query(\"SELECT *, COUNT(C.WO_Resource_Icode) as Resource_count FROM work_order A INNER JOIN ibt_client B on A.Resource_Client_Icode=B.Client_Icode INNER JOIN work_order_resource C on A.Work_Order_Icode=C.WO_Icode \n WHERE A.Created_By='$id' and C.Active='Yes' GROUP by A.Work_Order_Icode\");\n return $query->result_array();\n }", "private function orders()\n {\n //$query=\"SELECT a.orderid, a.OrderNo,ordersource,b.customername,a.customerid FROM `order` as a left join customer as b on a.customerid= b.customerid \";\n\t\t\t$query=\"SELECT a.*,b.customername from `order` as a left join customer as b on a.customerid= b.customerid \";\n\t\t\t$r = $this->mysqli->query($query) or die($this->mysqli->error.__LINE__);\n\t\t\tif($r->num_rows > 0)\n {\n\t\t\t\t$result = array();\n\t\t\t\twhile($row = $r->fetch_assoc()){\n\t\t\t\t\t$result[] = $row;\n\t\t\t\t }\n \n\t\t\t $this->response($this->json($result), 200); // send user details\n }\n\t\t}", "public function busconcount_bgclothing(){\r\n $data = date(\"Y-m-d H:i:s\");\r\n $this->db->select(\"(SELECT COUNT(*) FROM postad WHERE category_id = '6' AND sub_cat_id = 25 AND sub_scat_id = 375 AND ad_status = 1 AND expire_data >='$data' AND ad_status =1 AND(ad_type = 'business' || ad_type = 'consumer')) AS allbustype,\r\n (SELECT COUNT(*) FROM postad WHERE category_id = '6' AND sub_cat_id = 25 AND sub_scat_id = 375 AND ad_status = 1 AND expire_data >='$data' AND ad_status =1 AND ad_type = 'business') AS business,\r\n (SELECT COUNT(*) FROM postad WHERE category_id = '6' AND sub_cat_id = 25 AND sub_scat_id = 375 AND ad_status = 1 AND expire_data >='$data' AND ad_status =1 AND ad_type = 'consumer') AS consumer\");\r\n $rs = $this->db->get();\r\n return $rs->result();\r\n }", "public function jumlahDiterima(){\n $this->db->select(\"count(status_pendaftaran) as status_pendaftaran\");\n $this->db->from($this->_table);\n $this->db->where('status_pendaftaran',\"Diterima\");\n return $this->db->get()->row()->status_pendaftaran;\n }", "public function countTotalByTestType($id,$status)\n {\n \n if($id==1)\n {\n $impression_smear = $this->db->select(\"*\")\n ->from(\"testdetails\")\n // ->join(\"tests\",'tests.test_id=testdetails.test_id')\n ->join(\"impression_smear\",'impression_smear.testDetails_id=testdetails.testDetails_id')\n ->where($status)\n ->get()->result();\n return count($impression_smear);\n }\n else if($id==2)\n {\n $haematology = $this->db->select(\"*\")\n ->from(\"testdetails\")\n // ->join(\"tests\",'tests.test_id=testdetails.test_id')\n ->join(\"haematology\",'haematology.testDetails_id=testdetails.testDetails_id')\n ->where($status)\n ->get()->result();\n return count($haematology);\n }\n else if($id==3)\n {\n $mastitis = $this->db->select(\"*\")\n ->from(\"testdetails\")\n // ->join(\"tests\",'tests.test_id=testdetails.test_id')\n ->join(\"mastitis\",'mastitis.testDetails_id=testdetails.testDetails_id')\n ->where($status)\n ->get()->result();\n return count($mastitis);\n \n }\n else if($id==4)\n {\n \n $culture_sensitivity = $this->db->select(\"*\")\n ->from(\"testdetails\")\n // ->join(\"tests\",'tests.test_id=testdetails.test_id')\n ->join(\"culture_sensitivity\",'culture_sensitivity.testDetails_id=testdetails.testDetails_id')\n ->where($status)\n ->get()->result();\n return count($culture_sensitivity);\n }\n else if($id==5)\n {\n $urine_examination = $this->db->select(\"*\")\n ->from(\"testdetails\")\n // ->join(\"tests\",'tests.test_id=testdetails.test_id')\n ->join(\"urine_examination\",'urine_examination.testDetails_id=testdetails.testDetails_id')\n ->where($status)\n ->get()->result();\n return count($urine_examination);\n \n } else if($id==6)\n {\n \n $mrt = $this->db->select(\"*\")\n ->from(\"testdetails\")\n // ->join(\"tests\",'tests.test_id=testdetails.test_id')\n ->join(\"mrt\",'mrt.testDetails_id=testdetails.testDetails_id')\n ->where($status)\n ->get()->result();\n return count($mrt); \n\n } else if($id==7)\n {\n \n $rbpt = $this->db->select(\"*\")\n ->from(\"testdetails\")\n // ->join(\"tests\",'tests.test_id=testdetails.test_id')\n ->join(\"rbpt\",'rbpt.testDetails_id=testdetails.testDetails_id')\n ->where($status)\n ->get()->result();\n return count($rbpt); \n } else if($id==8)\n {\n $spat_human = $this->db->select(\"*\")\n ->from(\"testdetails\")\n // ->join(\"tests\",'tests.test_id=testdetails.test_id')\n ->join(\"spat_human\",'spat_human.testDetails_id=testdetails.testDetails_id')\n ->where($status)\n ->get()->result();\n return count($spat_human); \n \n }else if($id==9)\n {\n \n $tuberculin_skin_test = $this->db->select(\"*\")\n ->from(\"testdetails\")\n // ->join(\"tests\",'tests.test_id=testdetails.test_id')\n ->join(\"tuberculin_skin_test\",'tuberculin_skin_test.testDetails_id=testdetails.testDetails_id')\n ->where($status)\n ->get()->result();\n return count($tuberculin_skin_test); \n }else if($id==10)\n {\n $water_bacteriology = $this->db->select(\"*\")\n ->from(\"testdetails\")\n // ->join(\"tests\",'tests.test_id=testdetails.test_id')\n ->join(\"water_bacteriology\",'water_bacteriology.testDetails_id=testdetails.testDetails_id')\n ->where($status)\n ->get()->result();\n return count($water_bacteriology);\n }else if($id==11)\n {\n $afs = $this->db->select(\"*\")\n ->from(\"testdetails\")\n // ->join(\"tests\",'tests.test_id=testdetails.test_id')\n ->join(\"acid_fast_staining\",'acid_fast_staining.testDetails_id=testdetails.testDetails_id')\n ->where($status)\n ->get()->result();\n return count($afs);\n }\n else if($id==12)\n {\n \n $elisa_human = $this->db->select(\"*\")\n ->from(\"testdetails\")\n // ->join(\"tests\",'tests.test_id=testdetails.test_id')\n ->join(\"elisa_human\",'elisa_human.testDetails_id=testdetails.testDetails_id')\n ->where($status)\n ->get()->result();\n return count($elisa_human); \n }else if($id==13)\n {\n \n $elisa_animal = $this->db->select(\"*\")\n ->from(\"testdetails\")\n // ->join(\"tests\",'tests.test_id=testdetails.test_id')\n ->join(\"elisa_animal\",'elisa_animal.testDetails_id=testdetails.testDetails_id')\n ->where($status)\n ->get()->result();\n return count($elisa_animal); \n }else if($id==14)\n {\n \n $pcr_human = $this->db->select(\"*\")\n ->from(\"testdetails\")\n // ->join(\"tests\",'tests.test_id=testdetails.test_id')\n ->join(\"pcr_human\",'pcr_human.testDetails_id=testdetails.testDetails_id')\n ->where($status)\n ->get()->result();\n return count($pcr_human); \n }else if($id==15)\n {\n \n $pcr_animal = $this->db->select(\"*\")\n ->from(\"testdetails\")\n // ->join(\"tests\",'tests.test_id=testdetails.test_id')\n ->join(\"pcr_animal\",'pcr_animal.testDetails_id=testdetails.testDetails_id')\n ->where($status)\n ->get()->result();\n return count($pcr_animal); \n }\n }", "public function total_pending_cases_order_reimbursement($accountid = ''){\n $this->db->select('count(case_detail.order_id) as order_id');\n $this->db->from('case_detail');\n $this->db->join('payment_details', 'payment_details.order_id=case_detail.order_id', 'right');\n $this->db->join('reimburse_details', 'reimburse_details.order_id = case_detail.order_id', 'left');\n\n if (!empty($accountid)) {\n $this->db->where('case_detail.ID_ACCOUNT', $accountid);\n }\n $this->db->where('case_detail.status', '1');\n $this->db->where('case_detail.deleted', '0');\n $this->db->where('payment_details.status', '2');\n return $this->db->get()->result_array();\n }", "function getNPOrderCount(){\n $dbobj = DB::connect();\n $sql = \"SELECT count(order_id) FROM tbl_newspaper_order\";\n $result = $dbobj->query($sql);\n if($dbobj->errno){\n echo(\"SQL Error : \" .$dbobj->error);\n exit;\n }\n $rec = $result->fetch_array();\n echo ($rec[0]);\n\n $dbobj->close();\n}", "public function tArsip()\n {\n\n $user = session()->get('id_user');\n return $this->db->table('surat_usulan')\n ->where('status', 'Diajukan')\n ->where('user', $user)\n ->countAllResults();\n }", "function countOrderSource($query)\r\n {\r\n $sql = \"SELECT phone_order_orderTypes.title as title, COUNT(*) as broj FROM `phone_order_calls`\r\n\t\t LEFT JOIN phone_order_orderTypes ON phone_order_calls.orderType = phone_order_orderTypes.id\r\n\t\t WHERE {$query}\r\n\t\t GROUP BY phone_order_calls.orderType\";\r\n\r\n $results=$this->conn->fetchAll($sql);\r\n return $results;\r\n }", "function jumlahdata() {\r\n\t\t\treturn $this->db->count_all('tb_kelas');\t\t\t\r\n\t\t\t}", "public function busconcount_bbclothing(){\r\n $data = date(\"Y-m-d H:i:s\");\r\n $this->db->select(\"(SELECT COUNT(*) FROM postad WHERE category_id = '6' AND sub_cat_id = 24 AND sub_scat_id = 373 AND ad_status = 1 AND expire_data >='$data' AND ad_status =1 AND(ad_type = 'business' || ad_type = 'consumer')) AS allbustype,\r\n (SELECT COUNT(*) FROM postad WHERE category_id = '6' AND sub_cat_id = 24 AND sub_scat_id = 373 AND ad_status = 1 AND expire_data >='$data' AND ad_status =1 AND ad_type = 'business') AS business,\r\n (SELECT COUNT(*) FROM postad WHERE category_id = '6' AND sub_cat_id = 24 AND sub_scat_id = 373 AND ad_status = 1 AND expire_data >='$data' AND ad_status =1 AND ad_type = 'consumer') AS consumer\");\r\n $rs = $this->db->get();\r\n return $rs->result();\r\n }", "public function get_count_cart1()\n\t{\n\t\t$UserId = $this->input->post('uid');\n\t\tif($UserId!='')\n\t\t{\n\t\t\t$a=$this->db->query(\"select count(*) as count from tb_admin_user_cart where userid='$UserId'\")->row_array();\n\t\t\t$b=$a['count'];\n\t\t\t\n\t\t\t//$b=count($result);\n\t\t\treturn $b;\n\t\t}\n\t\t\n\t}", "function confirmOrder() {\n\t\t$sql = \"SELECT FROM \";\n\t\t$this -> db -> select(\"id, user_name, contact, addr1, addr2, pin, city, email, DATE_FORMAT(order_date, '%b %d %Y') AS order_date, DATE_FORMAT(order_date, '%h:%i %p') AS order_time, CASE WHEN DATEDIFF(order_date, now()) > 0 THEN 1 ELSE 0 END AS isnew, order_status, quantity\");\n\t\t$query = $this -> db -> get('registrations');\n\t\t$result = $query -> result();\n\t\treturn $result;\n\t}", "function bar_unit(){\n $select = array(\n 'tb_unit.unit_organisasi',\n 'count(tb_pegawai_profil.id_unit) as Unit'\n );\n $result =$this->db\n ->select($select)\n ->from('tb_unit')\n ->join('tb_pegawai_profil','tb_pegawai_profil.id_unit = tb_unit.id_unit')\n ->group_by('tb_unit.id_unit')\n ->order_by('tb_unit.id_unit','ASC')\n ->get()\n ->result_array();\n return $result;\n }", "function get_override_count(){\n \n $from_date = $_REQUEST['from_date'];\n $to_date = $_REQUEST['to_date'];\n\n $obj= new available_override();\n $columns = \" sum(override) as qty\";\n $where = null;\n $rst = $obj ->get($where,$columns);\n \n if(!$rst){\n $var_result['success']=false;\n return $var_result; \n };\n \n $var_result['override_count'] = $rst[0]['qty'];\n $var_result['success']=true;\n $var_result['data']=$var_result;\n return $var_result; \n \n}", "public function get_count_cart()\n\t{\n\t\t$UserId = $this->input->post('uid');\n\t\tif($UserId!='')\n\t\t{\n\t\t\t$a=$this->db->query(\"select count(*) as count from tb_admin_cart where userid='$UserId'\")->row_array();\n\t\t\t$b=$a['count'];\n\t\t\t\n\t\t\t//$b=count($result);\n\t\t\treturn $b;\n\t\t}\n\t\t\n\t}", "public function display_order_to_receive_count_for_client(){\n // if(env(\"DB_CONNECTION\") == \"pgsql\"){\n // $getOrderToDeliverCount = DB::select('SELECT COUNT(*) as data FROM orders WHERE is_approved = \"1\" AND client_id = \"'.Auth::user()->id.'\" AND delivery_date = CURRENT_DATE');\n // }else{\n // $getOrderToDeliverCount = DB::select('SELECT COUNT(*) as data FROM orders WHERE is_approved = 1 AND client_id = \"'.Auth::user()->id.'\" AND delivery_date = CURDATE()');\n // }\n\n $getOrderToDeliveerCount = Order::join('order_invoice', ['orders.invoice_id' => 'order_invoice.id'])\n ->where('is_approved',1)\n ->where('client_id', Auth::user()->id)\n ->groupBy('orders.invoice_id') \n ->get()\n ->count();\n\n return response()->json([\n 'count' => $getOrderToDeliveerCount,\n 'status' => 200\n ]);\n }", "function count_archived_pro_list(){\n\t\treturn $this->db->select('count(*)','product_list','status = 0');\n\t}", "public function jum_arsip()\n {\n\n return $this->db->table('surat_usulan')\n // ->where('status', 'Diajukan')\n ->countAllResults();\n }", "public function getAllOrderProductTable()\n {\n $statusComplete = false;\n try {\n // run your code here\n $sql = \"SELECT * FROM `pish_hikashop_order_product`\".\n \" WHERE `order_id` = \".$this->last_id.\";\"; //have error\n \n \n $result = $this->conn->query($sql);\n if ($result) {\n $rowcount = $result->num_rows;\n if ($rowcount > 0) {\n $dev_array = array();\n for ($i = 0; $i < $result->num_rows; $i++) {\n $row = $result->fetch_assoc();\n $dev_array[$i] = $row;\n }\n \n $message = '';\n //create message for send\n foreach($dev_array as $key => $value){\n $message .='تعداد ';\n $message .= $value['order_product_quantity'].' ';\n $message .='نام محصول: ';\n $message .= $value['order_product_name'];\n $message .= ' <br>';\n \n }\n $this->messageProducts = $message;\n\n return true;\n } else {\n $statusComplete = false;\n }\n } else {\n $statusComplete = false;\n return false;\n \n }\n } catch (exception $e) {\n //code to handle the exception\n return false;\n }\n return $statusComplete;\n }", "function getBusTransaction($bus_id){\n $school_id = '';\n if(($this->session->userdata('school_id'))) {\n $school_id = $this->session->userdata('school_id');\n if($school_id > 0){\n $this->db->where('school_id',$school_id);\n } \n }\n $transaction = 0;\n $count = 0;\n \n //Bus Attendance\n $result_array = $this->db->get_where(\"bus_attendence\", array(\"bus_id\" => $bus_id))->result_array();\n $count = count($result_array);\n if($count)\n { \n $transaction = 1;\n return $transaction;\n } \n //echo $this->db->last_query().\"<hr>\";exit;\n //Bus Driver table\n $result_array = $this->db->get_where(\"bus_driver\", array(\"bus_id\" => $bus_id, \"bus_id\"=>$bus_id))->result_array();\n $count = count($result_array);\n if($count)\n { \n $transaction = 1;\n return $transaction;\n } \n // echo $this->db->last_query().\"<hr>\";\n //Bus Driver Attendance\n $result_array = $this->db->get_where(\"bus_driver_attendence\", array(\"bus_id\" => $bus_id))->result_array();\n $count = count($result_array);\n //echo $this->db->last_query().\"<hr>\";\n if($count)\n { \n $transaction = 1;\n return $transaction;\n } \n \n return $transaction;\n }", "public function totalOrdersByDate()\n {\n $data = [\n 'ano' => (int)date('Y'),\n 'mes' => (int)date('m'),\n 'dia' => (int)date('d'),\n ];\n\n /*$ano = Pedido\n ::selectRaw('YEAR(created_at) as ano, COUNT(*) as count')\n ->whereIn('status', [1,2,3])\n ->whereIn(DB::raw('YEAR(created_at)'), [$data['ano'], $data['ano'] - 1])\n ->groupBy(DB::raw('YEAR(created_at)'))\n ->orderBy(DB::raw('YEAR(created_at)'), 'DESC')\n ->get()->toArray();\n\n if (count($ano) == 1 && $data['ano'] == $ano[0]['ano']) {\n $ano[] = [\n 'ano' => $data['ano'] - 1,\n 'count' => 0\n ];\n }*/\n\n $mes = Pedido\n ::selectRaw('MONTH(created_at) as mes, COUNT(*) as count')\n ->whereIn('status', [1,2,3])\n ->whereIn(DB::raw('MONTH(created_at)'), [$data['mes'], $data['mes'] - 1])\n ->where(DB::raw('YEAR(created_at)'), '=', $data['ano'])\n ->groupBy(DB::raw('MONTH(created_at)'))\n ->orderBy(DB::raw('MONTH(created_at)'), 'DESC')\n ->get()->toArray();\n\n if (!isset($mes[0])) {\n $mes[] = [\n 'mes' => $data['mes'],\n 'count' => 0\n ];\n }\n\n if (count($mes) == 1) {\n if ($data['mes'] == $mes[0]['mes']) {\n $mes[] = [\n 'mes' => $data['mes'] - 1,\n 'count' => 0\n ];\n } elseif (($data['mes'] - 1) == $mes[0]['mes']) {\n $mes[] = $mes[0];\n\n $mes[0] = [\n 'mes' => $data['mes'],\n 'count' => 0\n ];\n }\n }\n\n if ($mes[1]['mes'] === 0) {\n $mes[1]['count'] = Pedido\n ::selectRaw('MONTH(created_at) as mes, COUNT(*) as count')\n ->whereIn('status', [1,2,3])\n ->where(DB::raw('MONTH(created_at)'), '=', 12)\n ->where(DB::raw('YEAR(created_at)'), '=', ($data['ano'] - 1))\n ->groupBy(DB::raw('MONTH(created_at)'))\n ->orderBy(DB::raw('MONTH(created_at)'), 'DESC')\n ->get()->toArray();\n\n $mes[1]['count'] = $mes[1]['count'][0]['count'];\n $mes[1]['mes'] = 12;\n }\n\n $dia = Pedido\n ::selectRaw('DAY(created_at) as dia, COUNT(*) as count')\n ->whereIn('status', [1,2,3])\n ->whereIn(DB::raw('DAY(created_at)'), [$data['dia'], $data['dia'] - 1])\n ->where(DB::raw('MONTH(created_at)'), '=', $data['mes'])\n ->where(DB::raw('YEAR(created_at)'), '=', $data['ano'])\n ->groupBy(DB::raw('DAY(created_at)'))\n ->orderBy(DB::raw('DAY(created_at)'), 'DESC')\n ->get()->toArray();\n\n if (!isset($dia[0])) {\n $dia[] = [\n 'dia' => $data['dia'],\n 'count' => 0\n ];\n }\n\n if (count($dia) == 1) {\n if ($data['dia'] == $dia[0]['dia']) {\n $dia[] = [\n 'dia' => $data['dia'] - 1,\n 'count' => 0\n ];\n } elseif (($data['dia'] - 1) == $dia[0]['dia']) {\n $dia[] = $dia[0];\n\n $dia[0] = [\n 'dia' => $data['dia'],\n 'count' => 0\n ];\n }\n }\n\n $mesesExtenso = Config::get('core.meses');\n\n $pedidos = [\n /*'ano' => [\n 'atual' => [$ano[0]['ano'], $ano[0]['count']],\n 'ultimo' => [$ano[1]['ano'], $ano[1]['count']],\n ],*/\n 'mes' => [\n 'atual' => [$mesesExtenso[(int)$mes[0]['mes']], $mes[0]['count']],\n 'ultimo' => [$mesesExtenso[(int)$mes[1]['mes']], $mes[1]['count']],\n ],\n 'dia' => [\n 'atual' => [$dia[0]['dia'], $dia[0]['count']],\n 'ultimo' => [$dia[1]['dia'], $dia[1]['count']],\n ]\n ];\n\n return $this->listResponse($pedidos);\n }", "public function busconcount_bgaccessories(){\r\n $data = date(\"Y-m-d H:i:s\");\r\n $this->db->select(\"(SELECT COUNT(*) FROM postad WHERE category_id = '6' AND sub_cat_id = 25 AND sub_scat_id = 376 AND ad_status = 1 AND expire_data >='$data' AND ad_status =1 AND(ad_type = 'business' || ad_type = 'consumer')) AS allbustype,\r\n (SELECT COUNT(*) FROM postad WHERE category_id = '6' AND sub_cat_id = 25 AND sub_scat_id = 376 AND ad_status = 1 AND expire_data >='$data' AND ad_status =1 AND ad_type = 'business') AS business,\r\n (SELECT COUNT(*) FROM postad WHERE category_id = '6' AND sub_cat_id = 25 AND sub_scat_id = 376 AND ad_status = 1 AND expire_data >='$data' AND ad_status =1 AND ad_type = 'consumer') AS consumer\");\r\n $rs = $this->db->get();\r\n return $rs->result();\r\n }", "public function m_totalPurchaseProduct($data){\n\n $query = $this->db->query(\"SELECT id_compra,numeroOrden,producto,cantidad,productos.almacen FROM compra INNER JOIN productos ON compra.producto = productos.id_producto\n\nWHERE numeroOrden = '\".$data['noOrden'].\"'\");\n\n return $query->result_array();\n\n }", "public function countProduit(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n return $this->db->getRows(array(\"return_type\"=>\"count\"));\n\t\t\t\t\t }", "function all_unitkerja(){\n $this->db->select(\"count(id_unit_kerja) as UnitKerja \");\n $this->db->from('tb_unit_kerja');\n $result = $this->db->get()->result();\n return $result;\n }", "function count_new_pro_list(){\n\t\treturn $this->db->select('count(*)','product_list','status = 3');\n\t}", "public function count()\r\n\t{\r\n//\t\techo json_encode($this->db->query_first($sql));\r\n\t\techo json_encode(array('total'=>30));\r\n\t}", "function count_active_pro_list(){\n\t\treturn $this->db->select('count(*)','product_list','status = 1');\n\t}", "public function getTotalOrdersAm()\n\t{\n\t\t$query = $this->db->query(\"SELECT COUNT(id) as total_orders FROM oc_po_order WHERE delete_bit = \" . 1);\n\t\t$results = $query->row;\n\t\treturn $results['total_orders'];\n\t}", "function all_kontrak(){\n $this->db->select(\"count(status_aktif) as Kontrak \");\n $this->db->from('tb_pegawai');\n $this->db->where('status_aktif', 1);\n $this->db->where('status_peg', 2);\n $this->db->where('status_profesi', 4);\n $result = $this->db->get()->result();\n return $result;\n }", "function jumlah_siswa(){\n $this->db->where('status','1');\n return $this->db->get('tb_siswa')->num_rows();\n }", "public function busconcount_petsdogs(){\r\n $data = date(\"Y-m-d H:i:s\");\r\n $this->db->select(\"(SELECT COUNT(*) FROM postad WHERE category_id = '5' AND sub_cat_id =1 AND ad_status = 1 AND expire_data >='$data' AND(ad_type = 'business' || ad_type = 'consumer')) AS allbustype,\r\n (SELECT COUNT(*) FROM postad WHERE category_id = '5' AND sub_cat_id =1 AND ad_status = 1 AND expire_data >='$data' AND ad_type = 'business') AS business,\r\n (SELECT COUNT(*) FROM postad WHERE category_id = '5' AND sub_cat_id =1 AND ad_status = 1 AND expire_data >='$data' AND ad_type = 'consumer') AS consumer\");\r\n $rs = $this->db->get();\r\n return $rs->result();\r\n }", "public function getAccountPendingPOs(){\n\t \t $this->db->select(\"PO.*, S.supl_comp, S.supl_conperson, S.supl_email, S.supl_phone, S.supl_mobile, S.supl_address, S.pan_no, CF.firm_name\");\n\t\t\t$this->db->from(\"purchase_orders AS PO\");\n\t\t\t$this->db->join(\"suppliers AS S\", \"S.supl_id = PO.supplier_id\");\n\t\t\t$this->db->join(\"company_firms AS CF \", \"CF.firm_id = PO.firm_id \");\n\t\t\t$this->db->where(\"PO.status\", 'Confirmed');\n\t\t\t$this->db->where(\"PO.account_confirmed\", '0');\n\t\t\t\n\t\t\t$query_pending_purchase_orders = $this->db->get();\n\t\t\t\n\t\t\t//echo $this->db->last_query();die;\n\t\t\tif($query_pending_purchase_orders->num_rows()>0)\n\t\t\t{\n\t\t\t\treturn $query_pending_purchase_orders->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 }", "function fetchrequestAllItemCurrentStock($id)\r{\r $link = parent::connectToDB();\r$query=\"select purchase_order.expected_date,purchase_order.purchase_order_id,purchase_order.status,stock.item_id,stock.quantity,stock.receive_date from purchase_order left outer join stock on purchase_order.purchase_order_id=stock.purchase_order_id where purchase_order.expected_date='$id'\";\r//echo $query;\r$result8 = mysqli_query($link, $query);\r$result11=mysqli_num_rows($result8);\r \rif($result11!=0)\r{\r//echo \"asdfgh\";\rreturn $result8;\r}\relse\r{\r//echo \"not\";\rreturn false;\r}\r\r}", "function getTotalCount( array $a = array() ){\r\n\t\t$where ='';\r\n\t\tif( isset($a['where']) && $a['where'] != '' ){\r\n\t\t\t$where = $a['where'];\r\n\t\t}\r\n\t\t\t$where .= \" AND status!='-1' \";\r\n\t\t\r\n\t\t$this->sSql = \"SELECT count(1) as cnt FROM `pack_mstr` WHERE 1 $where \";\r\n\t\t$res = $this->oMysqli->query( $this->sSql );\r\n\t\tif($res[0]){\r\n\t\t\treturn $res[0]->cnt;\r\n\t\t}else{\r\n\t\t\treturn 0;\t\r\n\t\t}\r\n\t}", "function get_wine_count_by_country(){\n \n $obj = new wine();\n $columns = \" tblCountry.country, count(tblWine.wine_id) as qty \";\n $group = \" tblCountry.country \";\n $where = null;\n $sort = \" qty DESC \";\n $limit = '10';\n $rst = $obj ->get_extended($where,$columns,$group,$sort,$limit);\n \n if(!$rst){\n $var_result['success']=false;\n return $var_result; \n }\n \n $var_result['success']=true;\n $var_result['data']=$rst;\n return $var_result; \n \n}", "function getOrder_detail($orderid){\n$reesult= array();\n$result=$this->db->where(\"order_id\", $orderid)->get('order_products')->result();\n return $result;\n }", "public static function get_nb_orders(){\n $return = array();\n $sql = \"SELECT count(mo.id)\n FROM miki_person mp, miki_order mo\n WHERE mp.id = mo.id_person\";\n $result = mysql_query($sql);\n\n $row = mysql_fetch_array($result);\n return $row[0];\n }", "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 }", "function getorderid($db,$orderid,$listorderdetail)\n{\n try{\n $stmt = $db->prepare(\"select CONCAT((select tracking_code_prefix from system_infomation),order_id)as trackingid,orders.order_message,\n orders.order_creation_date, type_ship.type_ship_name,type_delivery.type_delivery_name,customers.customer_name,\n customers.customer_phone,customers.customer_country,consignees.consignee_name,consignees.consignee_phone,\n consignees.consignee_country\n from orders left join type_ship on orders.type_ship_id=type_ship.type_ship_id\n left join type_delivery on orders.type_delivery_id=type_delivery.type_delivery_id\n left join customers on orders.customer_id=customers.customer_id\n left join consignees on orders.consignee_id=consignees.consignee_id\n where order_id=$orderid;\");\n $stmt->execute();\n foreach($stmt->fetchAll() as $row){\n $trackingcode=$row['trackingid'];\n $ordermessage=$row['order_message'];\n $createdate=$row['order_creation_date'];\n $shiptype=$row['type_ship_name'];\n $deliverytye=$row['type_delivery_name'];\n $customername=$row['customer_name'];\n $customerphone=$row['customer_phone'];\n $customercountry=str_replace(\"us\",\"USA\",$row['customer_country']);\n $consigneename=$row['consignee_name'];\n $consigneephone=$row['consignee_phone'];\n $consigneecountry=str_replace(\"vn\",\"VietNam\",$row['consignee_country']);\n\n return array(\"trackingcode\"=>$trackingcode,\"ordermessage\"=>$ordermessage,\"createdate\"=>$createdate,\"shiptype\"=>$shiptype,\"deliverytye\"=>$deliverytye,\n \"customername\"=>$customername,\"customerphone\"=>$customerphone,\"customercountry\"=>$customercountry,\"consigneename\"=>$consigneename,\n \"consigneephone\"=>$consigneephone,\"consigneecountry\"=>$consigneecountry,\"listorderdetail\"=>$listorderdetail,\"error\"=>0,\"message\"=>\"\");\n }\n return null;\n }catch (Exception $e)\n {\n return array(\"error\"=>1,\"message\"=>\"load data error!\");\n }\n}", "public function inProcess_orders_model()\n\t\t{\n $result=$this->db->query(\"SELECT * FROM users, orders, customers, delivery_method \n\t\t\t\tWHERE orders.customer_id=customers.customer_id\n\t\t\t\tAND orders.vender_id=users.id\n\t\t\t\tAND orders.delivery_method_id=delivery_method.id\n\t\t\t\tAND orders.order_status =2 \"\n\t\t\t);\n\t\t\treturn $result->result_array();\n\t\t}", "function getAllPembayaranCount()\n {\n $this->db->from('pembayaran');\n return $this->db->count_all_results();\n }", "public function getDataEditeur1($num) {\r\n\t\t$this->load->database('default');\r\n\t\t$sql=\"select count(editeur.numEditeur) as temp from editeur,reservation,festival where editeur.numEditeur=reservation.numEditeur and reservation.numFestival=?\";\r\n\t\t$res=$this->db->query($sql,$num);\r\n\t\t$row = $res->row_array();\r\n\t\treturn $row ;\r\n}", "function by_status_berlaku()\n {\n $this->db->select(\"COUNT(id) AS total,COUNT( CASE WHEN status_berlaku = '1' THEN 1 END ) AS berlaku,COUNT( CASE WHEN status_berlaku = '0' THEN 1 END ) AS tidak_berlaku\");\n $this->db->from($this->table);\n return $this->db->get()->row();\n }", "public function cntMoney($where) {\n// . \" left join \" . $this->table1 . \" as user on log.user_id = user.id\";\n $sql = \"select count(*) as cnt from \" . $this->table2 . \" as log\"\n . \" left join \" . $this->table1 . \" as user on log.user_id = user.id\";\n $query_sql = \" where 1=1 \";\n if ($where['username'] != '') {\n// $query_sql .= \" and user.username like '%{$where['username']}%' \";\n $query_sql .= \" and user.username like '{$where['username']}' \";\n }\n if ($where['order_num'] != '') {\n $query_sql .= \" and log.order_num='{$where['order_num']}' \";\n }\n if ($where['type'] != '') {\n $query_sql .= \" and log.type='{$where['type']}' \";\n }\n if ($where['rg_type'] != 0) {\n $query_sql .= \" and user.reg_type = {$where['rg_type']} \";\n } else {\n $query_sql .= \" and user.reg_type NOT IN (8,9,11)\";\n }\n if ($where['s_time'] != '') {\n $time = strtotime($where['s_time']);\n $query_sql .= \" and log.addtime > {$time} \";\n }\n if ($where['e_time'] != '') {\n $time = strtotime($where['e_time'] . \" 23:59:59\");\n $query_sql .= \" and log.addtime < {$time} \";\n }\n $sql .= $query_sql;\n $rt = $this->db->getone($sql);\n// if (empty($rt['money'])) {\n// $rt['money'] = 0;\n// }\n return($rt);\n }", "function get_total_cus_regVp($pid){\r\n\r\n\t\t$this->db->select('COUNT(*) as tot_buk');\r\n\r\n $this->db->from('customer_registration');\r\n\r\n\t\t//$this->db->where('monthly_permit_permit_status',1);\r\n\r\n\t\t//$this->db->where('user_master.user_master_password',$pw);\r\n\r\n\t\t$this->db->where('port_id',$pid);\r\n\r\n\t\t//$this->db->where('customer_booking_decission_status',2);\r\n\r\n\t\t$query = $this->db->get();\r\n\r\n $result = $query->result_array();\r\n\r\n return $result;\r\n\r\n\t\t\r\n\r\n\t}", "public function countAll(){\n $this->db->select(\"count(id) as total\");\n return $this->db->get($this->table)->first_row('array')['total'];\n }", "public function penjualan_product()\n\t{\n\t\t$sql = \"SELECT product_name, SUM(qty) as count FROM detail_order GROUP BY product_name\";\n\n // $queryRec = $this->db->query($sql,array($tanggal,$jam,$daerah,$daerah));\n $queryRec = $this->db->query($sql)->result_array();\n return $queryRec;\n\t}", "function get_all_data_prov(){\n return $this->db->query(\"\n SELECT *, a.nama, a.propinsiid,\n (select count(propinsiid) as jum from tbl_propinsi_kota where propinsiid=a.propinsiid) as jumlah_kota\n FROM tbl_propinsi a\n LEFT JOIN tbl_propinsi_kota b ON a.propinsiid = b.propinsiid\n GROUP BY a.propinsiid\n \")->result();\n }", "public function busconcount_bbaccessories(){\r\n $data = date(\"Y-m-d H:i:s\");\r\n $this->db->select(\"(SELECT COUNT(*) FROM postad WHERE category_id = '6' AND sub_cat_id = 24 AND sub_scat_id = 374 AND ad_status = 1 AND expire_data >='$data' AND ad_status =1 AND(ad_type = 'business' || ad_type = 'consumer')) AS allbustype,\r\n (SELECT COUNT(*) FROM postad WHERE category_id = '6' AND sub_cat_id = 24 AND sub_scat_id = 374 AND ad_status = 1 AND expire_data >='$data' AND ad_status =1 AND ad_type = 'business') AS business,\r\n (SELECT COUNT(*) FROM postad WHERE category_id = '6' AND sub_cat_id = 24 AND sub_scat_id = 374 AND ad_status = 1 AND expire_data >='$data' AND ad_status =1 AND ad_type = 'consumer') AS consumer\");\r\n $rs = $this->db->get();\r\n return $rs->result();\r\n }", "public function display_order_to_approve_count_for_client(){\n // if(env(\"DB_CONNECTION\") == \"pgsql\"){\n // $getOrderToApproveCount = DB::select('SELECT COUNT(*) as data FROM orders WHERE is_approved = \"0\" AND client_id = \"'.Auth::user()->id.'\" ');\n // }else{\n // $getOrderToApproveCount = DB::select('SELECT COUNT(*) as data FROM orders WHERE is_approved = 0 AND client_id = \"'.Auth::user()->id.'\" ');\n // }\n\n $getOrderToApproveCount = Order::join('order_invoice', ['orders.invoice_id' => 'order_invoice.id'])\n ->where('is_approved',0)\n ->where('client_id', Auth::user()->id)\n ->groupBy('orders.invoice_id') \n ->get()\n ->count();\n \n return response()->json([\n 'count' => $getOrderToApproveCount,\n 'status' => 200\n ]);\n }", "public function pending_orders_model()\n\t\t{\n\t\t\t\n\t\t\t$result=$this->db->query(\"SELECT * FROM users, orders, customers, delivery_method \n\t\t\t\tWHERE orders.customer_id=customers.customer_id\n\t\t\t\tAND orders.vender_id=users.id\n\t\t\t\tAND orders.delivery_method_id=delivery_method.id\n\t\t\t\tAND orders.order_status =1\"\n\t\t\t);\n\n\t\t\treturn $result->result_array();\n\t\t}", "public function report2(){\n $query = $this->db->query(\"SELECT COUNT(`risk_status`) AS numcount, risk_status,\nCASE WHEN `risk_status` = 2 THEN 'User'\n ELSE 'User'\n END AS riskstatus\n FROM t_risk\nWHERE periode_id= (SELECT MAX(periode_id) FROM t_risk)\nAND risk_existing_control IS NULL AND risk_status='2'\n\n\n \");\n \n if($query->num_rows() > 0){\n foreach($query->result() as $data){\n $hasil[] = $data;\n }\n return $hasil;\n }\n }", "function get_orderlist($iApplicationId)\n\t{\n $this->db->select('r_det.*,r_ord.*,r_men.vItemName');\n $this->db->from('r_app_paypal_paymentdetail as r_det');\n $this->db->join('r_order_customer_details as r_ord','r_det.iApplicationId = r_ord.iApplicationId','INNER');\n $this->db->join('r_order_detail as r_ord_det','r_det.iApplicationId = r_ord_det.iApplicationId','INNER');\n $this->db->join('r_menu_item as r_men','r_men.iItemId = r_ord_det.iItemId','INNER');\n $array = array('r_det.iApplicationId =' => $iApplicationId);\n\n // $this->db->where('r_det.iApplicationId =' => $iApplicationId);\n $this->db->where('r_det.iApplicationId',$iApplicationId);\n $this->db->distinct();\n $this->db->group_by('r_det.iPayId');\n $query = $this->db->get();\n return $query->result_array();\n /*select DISTINCT r_det.*,r_men.*,r_ord.* from r_app_order_transaction_details as r_det inner join r_order_customer_details as r_ord on r_det.iApplicationId = r_ord.iApplicationId inner join r_order_detail as r_ord_det on r_det.iApplicationId = r_ord_det.iApplicationId inner join r_menu_item as r_men on r_men.iItemId = r_ord_det.iItemId where r_det.iApplicationId=129*/\n }", "function getOverallOrderRemain(){\n\t\t$t=0;\n\t\t$a = Order::all();\n\t\tforeach($a as $n){\n\t\t$dur= $n->qty;\n\t\t$sl =Order::where('payment', 'verified')->count();\n\t\t$r=intVal($sl);\n\t\t$t = $t + $r;\n\t\t}\n\t\treturn $t;\n\t\t}", "function getordersby($status,$s=false,$e=false)\r\n\t{\r\n\t\tif($s)\r\n\t\t{\r\n\t\t\t$s=strtotime($s);\r\n\t\t\t$e=strtotime($e);\r\n\t\t}\r\n\t\t\r\n\t\t$cond = '';\r\n\t\tif($s)\r\n\t\t\t$cond.=\"\tand o.time between ? and ?\";\r\n\t\t\t\r\n\t\treturn $this->db->query(\"select count(*) as total,is_pnh,ifnull((partner_id/partner_id),0) as is_partner \r\n\t\t\t\tfrom king_transactions a \r\n\t\t\t\tjoin king_orders b on a.transid = b.transid \r\n\t\t\t\twhere b.status = 0 $cond \r\n\t\t\t\tgroup by is_pnh,is_partner \",array($s,$e))->result_array();\r\n\t}", "function count_aturan(){\n\n $this->db->select('*');\n $this->db->from('aturan');\n return $this->db->get()->num_rows();\n }", "function getOrdersData($varAction=null,$data=null) {\n //echo \"<pre>\";\n $objClassCommon = new ClassCommon();\n $arrRes=array();\n $argWhere='';\n $varTable = TABLE_ORDER_ITEMS;\n $total=0;\n if($varAction=='today' || $varAction=='yesterday'){\n if($varAction=='today'){\n $dateToday=date('Y-m-d'); \n }else{\n $dateToday=date('Y-m-d',strtotime(\"-1 days\"));\n }\n \n \n for ($i=4;$i<25;$i=$i+4){\n \n $num_paddedTotime = sprintf(\"%02d\", $i);\n $num_paddedFromtime = sprintf(\"%02d\", $i-4);\n $toTime=$dateToday.' '.$num_paddedTotime.':00:00';\n $fromTime=$dateToday.' '.$num_paddedFromtime.':00:00';\n \n $arrClms = array('TIME(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded < \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$i]['time'][]=$arrData;\n $arrRes['data'][$i]['count']=$count;\n $total +=$count;\n }\n $arrRes['total']=$total;\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_week'){\n $arrWeeksDates=$objClassCommon->getlastWeekDates();\n \n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date.' 23:00:00';\n $fromTime=$date.' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$count;\n $total +=$count;\n }\n $arrRes['total']=$total;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='last_month'){\n $lastMonth=date('n', strtotime(date('Y-m').\" -1 month\"));\n $lastMonthYear=date('Y', strtotime(date('Y-m').\" -1 month\"));\n \n $arrWeeksDates=$objClassCommon->getWeeks($lastMonth,$lastMonthYear);\n //echo $lastMonth.'=='.$lastMonthYear;\n //echo \"<pre>\";\n //print_r($arrWeeksDates);\n //die;\n \n foreach($arrWeeksDates as $key=>$date){\n $toTime=$date['endDate'].' 23:00:00';\n $fromTime=$date['startDate'].' 00:00:00';\n \n $arrClms = array('DATE(ItemDateAdded) as date');\n $argWhere = 'ItemDateAdded >= \"'.$fromTime.'\" AND ItemDateAdded <= \"'.$toTime.'\"';\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=count($arrData);\n $arrRes['data'][$key]['dates']=$arrData;\n $arrRes['data'][$key]['count']=$count;\n $total +=$count; \n }\n $arrRes['total']=$total;\n //print_r($arrWeeksDates);\n //print_r($arrRes);\n //die;\n //print_r($arrData);\n //print_r($arrTime);\n //print_r($arrRangeTimes);\n }elseif($varAction=='searchReports'){\n $argWhere='';\n if($data['fromDate'] !=''){\n $argWhere .='ItemDateAdded >= \"'.date('Y-m-d',strtotime($data['fromDate'])).' 00:00:00\"';\n }\n if($data['toDate'] !=''){\n if($argWhere != ''){\n $argWhere .=' AND ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }else{\n $argWhere .='ItemDateAdded <= \"'.date('Y-m-d',strtotime($data['toDate'])).' 23:00:00\"';\n }\n \n }\n \n $arrClms = array('count(ItemDateAdded) as counts');\n $argWhere .= 'AND Status <> \"Canceled\"';\n \n $arrData = $this->select($varTable, $arrClms, $argWhere);\n $count=$arrData[0]['counts'];\n $arrRes['result']=$count;\n }elseif($varAction=='top_order'){\n \n $varQuery = \"SELECT count(fkItemID) as count,fkItemID,ItemName FROM \" . $varTable . \" WHERE Status <> 'Canceled' AND ItemType ='product' GROUP BY fkItemID ORDER BY count DESC LIMIT 10\";\n $arrData = $this->getArrayResult($varQuery);\n //pre($arrData);\n $arrRes['result']=$arrData;\n $arrRes['count']=count($arrData);\n }\n \n //die;\n echo json_encode($arrRes);\n die;\n }", "public function get_order_status()\n\t{\n\t\t//retrieve all orders\n\t\t$this->db->from('order_status');\n\t\t$this->db->select('*');\n\t\t$this->db->order_by('order_status_name');\n\t\t$query = $this->db->get();\n\t\t\n\t\treturn $query;\n\t}", "function countQuestionDB($search_by='',$condition_arr=array())\r\n {\r\n\r\n $this->db->select('SUM(IF(QM.question_id<>\"\",1,0)) as total_question',false);\r\n $this->db->from('dipp_question_master QM');\r\n $this->db->join('dipp_module_master MM','QM.module_id = MM.module_id');\r\n $this->db->join('dipp_topic_master TM','MM.topic_id = TM.id');\r\n $this->db->join('dipp_step_master SM','TM.step_id = SM.id');\r\n $this->db->join('dipp_course_master CM','SM.course_id = CM.id');\r\n if(count($condition_arr) > 0) {\r\n $this->db->where($condition_arr); \r\n }\r\n if($search_by <> '')\r\n {\r\n \r\n $serach_value = \"( QM.question_text LIKE '%$search_by%' OR TM.name LIKE '%$search_by%')\";\r\n $this->db->where($serach_value);\r\n }\r\n $query = $this->db->get();\r\n //echo $this->db->last_query();\r\n $result = $query->result_array();\r\n return $result[0]['total_question'];\r\n\r\n\t}", "function getOrderData($type=\"\",$limit=\"\",$offset=\"\",$startDate=\"1970:00:00 00:00:00\",$endDate=\"\",$restaurant=\"\",$payment =\"\"){\n\t\tif($limit !=\"\" && ($type <=3 ||$type ==7 || $type == 9))\n\t\t{\n\t\t\t$this->db->limit($limit,$offset);\n\t\t}\n\t\tif($type == 1 || $type == 3 || $type ==7 || $type == 8){\n\t\t\t$this->db->join('tbl_customer_delivery_address as cst','cst.address_id =od.selected_delivery_address','left');\n\t\t\t$this->db->join('tbl_locality as lc','lc.locality_id =cst.locality_id','left');\n\t\t\tif($type == 3){\n\t\t\t\t$this->db->select(\"od.order_id as OrderID,od.order_placed_time as OrderTime,cst.customer_name as CustomerName,lc.name as Area,od.reason as Remark/Reason \");\n\t\t\t\t$this->db->order_by(\"OrderTime\",\"DESC\");\n\t\t\t}else if($type == 1){\n\t\t\t\t$this->db->select(\"lc.name as Name,count(od.order_id) as TotalOrders,SUM(od.total_price) as TotalSales\");\n\t\t\t\t$this->db->group_by('lc.locality_id');\n\t\t\t\t$this->db->order_by(\"TotalSales\",\"DESC\");\n\t\t\t}else if($type == 7){\n\t\t\t\t$this->db->join('tbl_restaurants as rs','rs.restaurant_id =od.restaurant_id','left');\n\t\t\t\t$this->db->select(\"od.order_id as Sr,od.order_id as OrderID,od.delivered_time as OrderTime,cst.customer_name as CustName,cst.contact_no as Mobile,od.total_price as Amount,od.order_type as Payment ,lc.name as AreaName,rs.restaurant_name as Restaurant,od.order_status as Status\");\n\t\t\t\tif($payment !=\"\"){\n\t\t\t\t\t$this->db->where('od.order_type',$payment);\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t\t$this->db->order_by(\"od.order_id\",\"DESC\");\n\t\t\t\t$this->db->group_by('od.order_id');\n\n\t\t\t\tif($startDate !=\"\")\n\t\t\t\t$this->db->where(\"od.delivered_time >='$startDate'\");\n\n\t\t\t\tif($endDate !=\"\")\n\t\t\t\t$this->db->where(\"od.delivered_time <='$endDate'\");\n\n\t\t\t}else if($type == 8){\n\t\t\t\t$this->db->select('od.order_id,od.total_price,od.delivered_time as OrderTime,od.order_type as Payment');\n\t\t\t\tif($payment !=\"\"){\n\t\t\t\t\t$this->db->where('od.order_type',$payment);\n\t\t\t\t}\n\t\t\t\t$this->db->order_by(\"OrderTime\",\"DESC\");\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\telse if($type == 9){\n\t\t\t$this->db->join('tbl_order_details as os','os.order_id =od.order_id');\n\t\t\t$this->db->join('tbl_dishes','tbl_dishes.product_id=os.product_id');\n\t\t\t$this->db->join('tbl_dish_category','tbl_dish_category.category_id = tbl_dishes.category_id',\"INNER\");\n\t\t\t$this->db->select('tbl_dish_category.category_name as Category Name, count(os.product_id) as TotalSold');\n\t\t\t$this->db->group_by('tbl_dish_category.category_id');\n\t\t\t$this->db->order_by('TotalSold',\"DESC\");\n\t\t}\n\t\telse if($type == 2){\n\t\t\t$this->db->join('tbl_order_details as os','os.order_id =od.order_id');\n\t\t\t$this->db->join('tbl_dishes','tbl_dishes.product_id=os.product_id');\n\t\t\t$this->db->select('tbl_dishes.product_en_name as ItemName, count(os.product_id) as TotalSold');\n\t\t\t$this->db->group_by('os.product_id');\n\t\t\t$this->db->order_by('TotalSold',\"DESC\");\n\t\t}\n\t\n\t\telse{\n\t\t\t\n\t\t\t$this->db->select('od.order_id,od.total_price,od.delivered_time as OrderTime');\n\t\t\t$this->db->order_by(\"OrderTime\",\"DESC\");\n\t\t}\n\n\t\tif($restaurant !=\"\"){\n\t\t\t$this->db->where('od.restaurant_id',$restaurant);\n\t\t}\n\t\tif($startDate !=\"\" && $type == 3){\n\t\t\t($type == 3)?$this->db->where(\"od.order_placed_time >='$startDate'\"):$this->db->where(\"od.delivered_time >='$startDate'\");\n\t\t}\n\t\tif($endDate !=\"\"){\n\t\t\t($type == 3)?$this->db->where(\"od.order_placed_time <='$endDate'\"):$this->db->where(\"od.delivered_time <='$endDate'\");\n\t\t}\n\n\t\tif($startDate !=\"\" && ($type == 8 || $type == 5 || $type == 1 || $type == 2 || $type == 4 || $type == 6 || $type == 9)){\n\t\t\t$this->db->where(\"od.delivered_time >='$startDate'\");\n\t\t}\n\t\tif($endDate !=\"\" && $type == 8 || $type == 5 || $type == 1 || $type == 2 || $type == 4 || $type == 6 || $type == 9){\n\t\t\t$this->db->where(\"od.delivered_time <='$endDate'\");\n\t\t}\n\t\t\n\t\tif($type == 3){\n\t\t\t$this->db->where_in('od.order_status',array(13,14));\n\t\t}else{\n\t\t\t$this->db->where_in('od.order_status',array(7,8));\n\t\t}\t\n\t\t$this->db->from('tbl_orders as od');\n\t\t\n\t\treturn $this->db->get()->result();\n\t}", "public function getCommentsCount($object_id = null){\n // if($res2->num_rows() <= 0) $res2 = [];\n // else $res2 = $res2->result_array();\n\n // if(isset($res2) && !empty($res2)) {\n // $idis = [];\n // foreach($res2 as $k => $one){\n // $idis[] = $one['catalogid'];\n // } unset($one);\n\n // $idis2 = [];\n // foreach($res2 as $k => $two){\n // $idis2[] = $two['main_id'];\n // } unset($two);\n\n // $array = [];\n // $array = array_merge($idis, $idis2);\n // $unique_array = [];\n // $unique_array = array_unique($array);\n // } else $unique_array = $object_id;\n\n // $result = $this->db->select('site_color_catalog.catalogid')\n // ->where_in('site_color_catalog.main_id', $unique_array)\n // ->from('site_color_catalog')->get()->result_array();\n\n // if(isset($result) && !empty($result)){\n // $idits = [];\n // foreach($result as $value){\n // $idits[] = $value['catalogid'];\n // }unset($value);\n // $all_result = [];\n // $all_result = array_unique($idits);\n // } else $all_result = $object_id;\n\n\n $object_id = (int)$object_id;\n if ($object_id <= 0) return array();\n $this->db->select('count(site_comment.id) as count');\n // $this->db->where_in('site_comment.id_catalog',$all_result);\n $this->db->where('site_comment.id_catalog',$object_id);\n $this->db->where('site_comment.visible',1)->from('site_comment');\n $res = $this->db->get()->row_array();\n return $res['count'];\n }", "private function getOrdersArray(){\n $connection = new Connection();\n $link = $connection->connect();\n $my_id = $this->user->getId();\n $count = $link->query(\"SELECT count(*) FROM transaction WHERE registered_for = '$my_id'\")->fetchColumn();\n if($count > 0){\n $result = $link->query(\"SELECT id FROM transaction WHERE registered_for = '$my_id' ORDER BY date_registered DESC LIMIT $this->ordersCount\");\n $orders = [];\n while($record = $result->fetch()){\n $orders[] = $record;\n }\n $connection = null;\n return $orders;\n }\n else{\n return FALSE;\n }\n }", "public function contarpagadas(){\n$pagada = $this->db->query(\"SELECT COUNT(*) FROM pago_factura\");\nreturn $pagada->fetch_row(); \n}", "function all_unit(){\n $this->db->select(\"count(id_unit) as Unit \");\n $this->db->from('tb_unit');\n $result = $this->db->get()->result();\n return $result;\n }", "function get_bottle_count(){\n \n $from_date = $_REQUEST['from_date'];\n $to_date = $_REQUEST['to_date'];\n\n $obj = new vintage_has_acquire();\n $columns = \" sum(qty) as qty\";\n $where = null;\n $rst = $obj ->get($where,$columns);\n \n if(!$rst){\n $var_result['success']=false;\n return $var_result; \n }\n\n $var_result['success']=true;\n $var_result['bottle_count']=$rst[0]['qty'];\n return $var_result; \n\n}", "function sales_records_order_no($order_no){\n \t\t$this->db->select('sales.SALES_ID, products.PRODUCT, sales.AMOUNT, sales.SALES_DATE, sales.ORDER_NO,, sales.SALES_ID, sales.QUANTITY_SOLD, staff.NAME, sales.STATUS');\n \t\t$this->db->from('sales');\n \t\t$this->db->join('products', 'products.PRODUCT_ID=sales.PRODUCT_ID', 'left');\n \t\t$this->db->join('staff', 'sales.STAFF_ID=staff.STAFF_ID', 'left');\n \t\t$this->db->where('sales.ORDER_NO', $order_no);\n \t\t$query=$this->db->get();\n \t\tif($query->num_rows()>0){\n \t\t\treturn $query->result();\n \t\t}\n \t\telse{\n \t\t\treturn false;\n \t\t}\n \t}", "public function count_data_blok()\n\t{\n\n\t\t$this->db->select('k.nama_kawasan, b.nama_blok, b.gambar, b.add_time, b.jumlah_unit, k.alamat, b.id_blok');\n\t\t$this->db->from('blok as b');\n\t\t$this->db->join('kawasan as k', 'k.id_kawasan = b.id_kawasan', 'inner');\n\n\t\treturn $this->db->get();\n\t}", "function get_all_distributor_orders(){\r\n\r\n $distributor = $this->aauth->get_user();\r\n $distributor_id = $distributor->distributor_id;\r\n\r\n $date_from = $this->session->userdata('dashboard_date_from');\r\n $date_to = $this->session->userdata('dashboard_date_to');\r\n\r\n $query_string = \"SELECT \r\n a.id as 'order_number',\r\n b.company_name as 'customer',\r\n do.distributor_id as 'distributor',\r\n c.name as 'payment_type', \r\n a.status, \r\n a.delivery_date, \r\n a.createdate,\r\n a.delivery_type,\r\n sum(oi.price * oi.quantity) as total,\r\n sum(oi.quantity) as product_count\r\n FROM `orders` as a, `order_items` as `oi`,`customers` as b, `payment_types` as c,`distributor_orders` as do \r\n WHERE a.customer_id = b.id \r\n AND a.id = do.order_id \r\n AND a.id = oi.order_id \r\n AND do.distributor_id = '$distributor_id'\r\n AND a.createdate > '$date_from' \r\n AND a.createdate < '$date_to' \r\n GROUP BY oi.order_id ORDER by a.createdate desc \";\r\n\r\n $query = $this->db->query($query_string);\r\n \r\n $return['query'] = $query_string;\r\n $return['orders'] = $query->result_array();\r\n return $return;\r\n }", "public function index()\n {\n //\n $order = DB::select(DB::raw(\"SELECT * FROM `orders`, `produks`, `users` WHERE orders.id_produk_order = produks.id_produk AND orders.id_user_order = users.id\"));\n \n //$order = DB::select(DB::raw(\"SELECT kategori_produk, nama_produk, ukuran_produk, SUM(harga_order) ,COUNT(id_produk_order) FROM `orders` ,`produks` WHERE id_produk_order = id_produk AND status_order = 'done and sending to you place' GROUP By id_produk_order\"));\n return view('master.masterOrder', compact('order'));\n }", "function Company_Count($doName, $siName){\n// from MV_LIST AS ML\n// LEFT JOIN MV_LIST_OTHER_INFO ON ML.MV_LIST_ID = MV_LIST_OTHER_INFO.MV_LIST_ID\n// LEFT OUTER JOIN\n// (SELECT MV_REGI_FK_LIST, MV_REGI_CHOOSE FROM MV_REGI WHERE (MV_REGI_CHOOSE = 0 or MV_REGI_CHOOSE = 1) GROUP BY MV_REGI_FK_LIST) AS T\n// ON T.MV_REGI_FK_LIST = ML.MV_LIST_ID\n// WHERE ML.USEYN = 'Y' AND ML.MV_LIST_SI_NAME='\".$doName.\"' AND ML.MV_LIST_GU_NAME='\".$siName.\"'\n// AND T.MV_REGI_FK_LIST IS NOT NULL ;\";\n\n $query = \"SELECT COUNT(1) AS COUNT\nfrom (\nselect ML.MV_LIST_ID from MV_LIST AS ML\nLEFT OUTER JOIN MV_REGI AS MR ON ML.MV_LIST_ID = MR.MV_REGI_FK_LIST\nWHERE MR.MV_REGI_DO = '\".$doName.\"'\nAND MR.MV_REGI_SI = '\".$siName.\"'\nAND MR.MV_REGI_CHOOSE < 4\nAND ML.USEYN = 'Y'\nAND ( ML.MV_LIST_TYPE = 0 OR ML.MV_LIST_TYPE = 1 OR ML.MV_LIST_TYPE = 3 )\nGROUP BY ML.MV_LIST_ID\nORDER BY ML.MV_LIST_NAME ) AS T;\";\n\n $query = DB::select( DB::raw( $query ) );\n\n if(count($query)){\n $count = $query[0]->COUNT;\n\n return $count;\n }\n }", "public function getNumberOrdersByDate()\n {\n\n $date = $this->request->get('date',today()->format('Y-m-d'));\n $count_orders_today = Order::whereDate('CreationDate',$date)->count();\n\n return response($count_orders_today);\n }", "public function countquery(){ \n\t\treturn $this->query_total; \n\t}", "function home_po_vendor_outstanding() {\n\t\t\n\t\t$kd_plant = $this->session->userdata['ADMIN']['plant'];\n \t $this->db->select('EBELN');\n /*BSTMG-(COALESCE((SELECT SUM(gr_quantity) FROM t_grpo_detail\n\t\t\t\t\t\t JOIN t_grpo_header ON t_grpo_detail.id_grpo_header = t_grpo_header.id_grpo_header\n\t\t\t\t\t\t where t_grpo_header.po_no = EBELN),0)) AS */\n \t $this->db->from('zmm_bapi_disp_po_outstanding');\n \t $this->db->where('PLANT',$kd_plant);\n\t $this->db->where('BSTMG >',0);\n \t // $this->db->where(\"DELIV_DATE >= '\".date('Ymd').\"'\"); //.new 20120312\n\t\t$this->db->group_by('EBELN');\n\t\t//$this->db->order_by('EBELP');\n\t\t\n\n\t\t$query = $this->db->get();\n\t\tif($query->num_rows() > 0) {\n\t\t\treturn $query->num_rows();\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function CounterMail(){\n\n $CantidadMails = ($this->ConfigModelo->select('rowCountWhere', 'Mensajes', 'estado', '0', 'Id', 'Id'));\n\n return $CantidadMails;\n\n }", "public function get_count()\n {\n $penggunaID = $this->session->userdata['id'];\n $query = \"SELECT COUNT(*) AS `numrows` FROM\n ( SELECT o.`id` AS id_ortu FROM tb_siswa s\n JOIN `tb_orang_tua` o\n ON s.id=o.`siswaID`\n WHERE s.penggunaID=$penggunaID) AS os\n JOIN `tb_laporan_ortu` l\n WHERE l.read_status_siswa='0' AND os.id_ortu = l.`id_ortu`\";\n $result = $this->db->query($query);\n return $result->result_array()[0]['numrows'];\n }" ]
[ "0.71006763", "0.7095632", "0.7068159", "0.7058182", "0.6977832", "0.69028115", "0.6902263", "0.68913406", "0.67720175", "0.67556834", "0.6737915", "0.6729815", "0.67011267", "0.6680627", "0.6672238", "0.66387564", "0.6619517", "0.6571654", "0.65613014", "0.6549636", "0.6504678", "0.64977217", "0.649705", "0.64815843", "0.64637476", "0.6449307", "0.6405883", "0.6400537", "0.63988644", "0.6391635", "0.63673574", "0.6357788", "0.6350999", "0.634998", "0.6349408", "0.6344801", "0.6313995", "0.6307168", "0.63030106", "0.62965626", "0.62856746", "0.62838507", "0.6277907", "0.6276084", "0.6256302", "0.62412", "0.6232688", "0.62321424", "0.6229774", "0.6220612", "0.62074274", "0.6206338", "0.6197932", "0.6187236", "0.6187224", "0.6171534", "0.6170972", "0.6167762", "0.616527", "0.6159494", "0.61587465", "0.6154955", "0.6154165", "0.61501235", "0.6146531", "0.61373794", "0.61370087", "0.61297786", "0.6127278", "0.6108205", "0.61057746", "0.6095618", "0.6090286", "0.6088203", "0.60852796", "0.6078018", "0.60753125", "0.6068272", "0.606425", "0.6056136", "0.604723", "0.6041971", "0.6041905", "0.60406524", "0.6038435", "0.6036264", "0.6017331", "0.6014208", "0.6010483", "0.6007", "0.59970117", "0.5996532", "0.5994111", "0.5993409", "0.59921", "0.5989963", "0.59891504", "0.5987477", "0.5981978", "0.59785986" ]
0.6171173
56
Display a listing of the resource.
public function index() { $datas = GuestSchool::all(); return view('backend.register.school.list', ['datas' => $datas]); }
{ "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 index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function 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 index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function 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 actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n 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 view('admin.resources.index');\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\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.7446737", "0.73625076", "0.7300871", "0.72476006", "0.7163127", "0.7149414", "0.7131995", "0.7105663", "0.7102927", "0.7101388", "0.704981", "0.69946545", "0.69897777", "0.6935023", "0.690029", "0.68989694", "0.68925905", "0.68878543", "0.6866467", "0.6849924", "0.6829784", "0.68033314", "0.67971504", "0.6796001", "0.6786942", "0.6760321", "0.6743112", "0.6730776", "0.67266184", "0.67259544", "0.67259544", "0.67259544", "0.671818", "0.670783", "0.670644", "0.6704464", "0.6665842", "0.6663898", "0.6660563", "0.6660198", "0.6657512", "0.6654405", "0.6648237", "0.6620824", "0.6619237", "0.6618058", "0.66072917", "0.660077", "0.6600677", "0.6594786", "0.6587929", "0.65850085", "0.65824693", "0.6581521", "0.6577045", "0.6574634", "0.65729445", "0.65715027", "0.6570646", "0.6565125", "0.6563328", "0.6553843", "0.6553201", "0.6545921", "0.6537198", "0.6534121", "0.6533748", "0.65272135", "0.6526431", "0.6525868", "0.6519198", "0.65185314", "0.6517867", "0.65170157", "0.651509", "0.65070677", "0.6505637", "0.65033627", "0.6494597", "0.6492147", "0.64880013", "0.64871716", "0.6485315", "0.6485215", "0.64790684", "0.64767736", "0.64725083", "0.64709103", "0.64702755", "0.6466392", "0.64618254", "0.646148", "0.64601135", "0.6458744", "0.64543813", "0.64537513", "0.64530194", "0.6450726", "0.64492655", "0.6449169", "0.64466155" ]
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 return view('Form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n 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('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\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 newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }" ]
[ "0.75934863", "0.75934863", "0.7587591", "0.75782615", "0.75711566", "0.74992937", "0.74349296", "0.7432467", "0.7387912", "0.7351958", "0.73380226", "0.73111826", "0.72957826", "0.72812104", "0.72734547", "0.7242778", "0.72294843", "0.7225723", "0.718609", "0.71780044", "0.7173978", "0.71492267", "0.71434265", "0.7143343", "0.71356934", "0.7127626", "0.7122704", "0.71151215", "0.71151215", "0.71151215", "0.711137", "0.7093674", "0.708441", "0.70805633", "0.7079313", "0.70560336", "0.70560336", "0.705535", "0.7038748", "0.7038717", "0.70355713", "0.7033314", "0.70298624", "0.70262384", "0.7025372", "0.70192045", "0.7017566", "0.70037806", "0.70029014", "0.69999987", "0.6995955", "0.6994461", "0.69932437", "0.698907", "0.6985915", "0.69654584", "0.69652516", "0.6956021", "0.6951258", "0.6950627", "0.69471824", "0.69432425", "0.6941303", "0.69406337", "0.6937103", "0.6937103", "0.69363457", "0.6934366", "0.6931313", "0.6927307", "0.6926027", "0.6922591", "0.69176334", "0.69158953", "0.6911744", "0.6910005", "0.6909594", "0.6907657", "0.6902698", "0.6900764", "0.69007087", "0.6900391", "0.68942374", "0.68933", "0.68929493", "0.68912417", "0.68912417", "0.68911326", "0.6888626", "0.6887399", "0.68857414", "0.6884495", "0.6881287", "0.6878567", "0.6875623", "0.687334", "0.68722713", "0.6870009", "0.68697596", "0.6869062", "0.6868769" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.7285655", "0.71443397", "0.7133207", "0.6641532", "0.6621311", "0.65678823", "0.6525738", "0.65086055", "0.6448411", "0.6374508", "0.637246", "0.6364561", "0.6364561", "0.6364561", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122" ]
0.0
-1
Display the specified resource.
public function show($id) { return view('backend.register.school.show', ['data' => GuestSchool::find($id)]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { return view('backend.register.school.edit', ['data' => GuestSchool::find($id)]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function 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 edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($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($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\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 $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 edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78548634", "0.7693446", "0.72737956", "0.72415876", "0.71732706", "0.7064379", "0.70547634", "0.6985193", "0.6948865", "0.6946892", "0.69416964", "0.6929201", "0.69028485", "0.6899143", "0.6899143", "0.68794435", "0.6864862", "0.6860578", "0.68581015", "0.6845792", "0.6836835", "0.681191", "0.6808133", "0.6806856", "0.68035305", "0.6796193", "0.67936623", "0.67936623", "0.67895305", "0.6785768", "0.678106", "0.67773324", "0.67697626", "0.6762823", "0.6747543", "0.6747543", "0.67463523", "0.67444044", "0.6741766", "0.6737379", "0.6726827", "0.6714104", "0.66950524", "0.66935307", "0.6689272", "0.6689106", "0.66872644", "0.6686648", "0.6684393", "0.6670288", "0.6669616", "0.66668564", "0.66668564", "0.666409", "0.6662514", "0.66599286", "0.66590035", "0.6655965", "0.6653906", "0.6644097", "0.66327673", "0.66314846", "0.6629497", "0.6629497", "0.6620671", "0.66204685", "0.66168797", "0.66163945", "0.66112244", "0.6610172", "0.66072273", "0.65975267", "0.6596347", "0.6595878", "0.65914613", "0.65904135", "0.65880567", "0.658147", "0.6581434", "0.6581035", "0.65780395", "0.65776944", "0.6576013", "0.6570687", "0.6569499", "0.6568776", "0.6567722", "0.6562973", "0.6562973", "0.6561691", "0.655929", "0.6557889", "0.65571314", "0.65565974", "0.65564924", "0.65558827", "0.65556073", "0.6555524", "0.6549151", "0.6548339", "0.65460944" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $guestSchool = GuestSchool::find($id); $inputs = $request->all(); $rules = [ 'prefix' => 'required', 'name' => 'required', 'surname' => 'required', 'gender' => 'required|in:M,F,U', 'age' => 'required|integer|between:1,100', 'school' => 'required', 'follower' => 'required|integer', 'province' => 'required', 'email' => 'required|email', 'phone' => 'required|regex:/^0[0-9]{1,2}[0-9]{7}$/', ]; $messages = [ 'prefix.required' => 'กรุณากรอก คำนำหน้าชื่อ', 'name.required' => 'กรุณากรอก ชื่อ', 'surname.required' => 'กรุณากรอก นามสกุล', 'gender.required' => 'กรุณาเลือก เพศ', 'gender.in' => 'เพศ ที่เลือกไม่ถูกต้อง', 'age.required' => 'กรุณากรอก อายุ', 'age.integer' => 'รูปแบบอายุไม่ถูกต้อง', 'age.between' => 'อายุ ต้องอยู่ระหว่าง 1 ถึง 100', 'school.required' => 'กรุณากรอก ชื่อโรงเรียน>', 'follower.required' => 'กรุณากรอก จำนวนนักเรียนที่มาชมงาน', 'follower.integer' => 'รูปแบบจำนวนนักเรียนที่มาชมงานไม่ถูกต้อง', 'province.required' => 'กรุณากรอก จังหวัด', 'email.required' => 'กรุณากรอก อีเมลล์', 'email.email' => 'รูปแบบอีเมลไม่ถูกต้อง', 'phone.required' => 'กรุณากรอก เบอร์โทรศัพท์', 'phone.regex' => 'รูปแบบเบอร์โทรศัพท์ไม่ถูกต้อง', ]; $validator = Validator::make($inputs, $rules, $messages); if($validator->fails()){ return redirect('/backend/register/school/'.$id.'/edit')->with(['data' => $inputs])->withErrors($validator); } $guestSchool->fill($request->all()); $guestSchool->facebook = empty($request->facebook)? null:$request->facebook; $guestSchool->twitter = empty($request->twitter)? null:$request->twitter; $guestSchool->save(); return redirect('/backend/register/school/'.$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(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(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "public function update($request, $id);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "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 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 function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(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(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($id);", "public function update($id);", "public function put($path, $data = null);", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public 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 $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 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.7423347", "0.70622426", "0.70568657", "0.6896551", "0.65835553", "0.64519453", "0.6348333", "0.6212436", "0.61450946", "0.6122591", "0.6114199", "0.6101911", "0.60876113", "0.60528636", "0.60177964", "0.6006609", "0.59725446", "0.594558", "0.59395295", "0.5938792", "0.5893703", "0.5862337", "0.58523124", "0.58523124", "0.5851579", "0.5815571", "0.58067423", "0.5750728", "0.5750728", "0.5736541", "0.5723664", "0.5715135", "0.56949675", "0.5691129", "0.56882757", "0.5669375", "0.5655524", "0.56517446", "0.5647158", "0.5636521", "0.563466", "0.5632965", "0.56322825", "0.56291395", "0.56202215", "0.56087196", "0.56020856", "0.5591966", "0.5581127", "0.5581055", "0.558085", "0.5575458", "0.55706805", "0.55670804", "0.55629116", "0.5562565", "0.5558853", "0.5558505", "0.5558505", "0.5558505", "0.5558505", "0.5558505", "0.555572", "0.5555007", "0.5553948", "0.5553837", "0.5553147", "0.55429846", "0.5541925", "0.5540208", "0.5539145", "0.5536157", "0.55350804", "0.5534241", "0.5523782", "0.5518406", "0.55147856", "0.5513397", "0.550961", "0.55072165", "0.55067354", "0.5503418", "0.5501671", "0.55010796", "0.54998124", "0.5497327", "0.54942787", "0.54942036", "0.54942036", "0.54935455", "0.549267", "0.5491964", "0.5489983", "0.54833627", "0.54794145", "0.5478835", "0.5478348", "0.5465178", "0.54648995", "0.54607797", "0.54571307" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { GuestSchool::find($id)->delete(); return redirect('/backend/register/school'); }
{ "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
Deconnection de la DB
function deconnexion_DB() { mysql_close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function disconnect() {\n $this->db = null;\n }", "public function disconnect() {\n $this->db = null;\n }", "function destroy_connection(){\n\t\t//if($this->dbconn != null)\n\t\t//\t$this->dbconn->disconnect();\n\t\tunset($this->dbconn);\n\t}", "private function closeConnection(){\n $this->db =null;\n }", "private function _disconnect()\n {\n //\tDisconnect\n $this->_db->conn = null;\n $this->_db->clear();\n }", "public function CloseConnection()\n {\n $this->db = null;\n }", "private function deconnexion()\n\t\t{\n\t\t\tmysql_close($this->id);\n\t\t\t\n\t\t}", "public function disconnect()\n {\n $this->db->dispose();\n }", "public function close_connection()\n {\n $this->db = null;\n }", "function disconnect(){\n\t\t$this->dbconn = null;\n\t\t$this->logger->info('RECOLIN DB DB disconnected successfully');\n\t}", "public function disconnect()\n {\n \t//$GLOBALS['log']->debug('Calling DBManager::disconnect()');\n $close = $this->backendFunctions['close'];\n if(isset($this->database)){\n $this->freeResult();\n if ( is_resource($this->database) || is_object($this->database) )\n\t\t\t\t$close($this->database);\n unset($this->database);\n }\n }", "public function disconnect() {\n if (isset($this->dbCon) && $this->dbCon) {\n //$this->dbCon = null;\n }\n }", "public static function unsetDbConnection(){\n\t\tself::$db=null;\n\t}", "protected function _teardownDb()\n {\n list ($host, $port, $db) = $this->_getUrlParts();\n $db = trim($db, '/');\n \n try {\n Sopha_Db::deleteDb($db, $host, $port);\n } catch (Sopha_Db_Exception $e) {\n if ($e->getCode() != 404) {\n throw $e;\n }\n }\n }", "public function desconectar(){\n mysqli_close($this->conexion);\n }", "public function CloseConnectDB(){\n $this->PDO = null;\n }", "function cerrar_conexion()\n {\n mysqli_close($this->db);\n }", "function disconnect_from_db () {\n\tglobal $conn;\n\t$conn = null;\n}", "public function disconnect() {\n if (isset($this->database))\n @$this->database->close();\n }", "public function desconectar(){\r\n\t\tmysqli_close($this->conexion);\r\n\t}", "function db_disconnect()\n\t{\n\t\tpg_close($this->db_connection);\n\t}", "public function disconnectDatabase()\n {\n $this->database->close();\n $this->database = null;\n }", "private function closeConnection(){\n $this->file_db = null;\n }", "public function shutdown()\n {\n if ($this->db) {\n $db->disconnect();\n }\n }", "public function disconnect()\n {\n $this->setPdo(null);\n }", "protected function closeConection()\n {\n $this->db->close();\n unset($this->db);\n unset($this->satz);\n }", "function close_db(){\n $this->_dbh = null;\n \n }", "function close_db(){\n $this->_dbh = null;\n \n }", "public function disconnect()\n {\n $this->pdo = null;\n }", "function teardown() {\n // close database connection\n $this->conn = null;\n }", "public function __destruct()\r\n {\r\n $this->db = null;\r\n }", "function db_disconnect()\n{\n\tglobal $dbh;\n\n\tif (!isset($dbh))\n\t\t// Already disconnected.\n\t\treturn;\n\n\t$dbh->close();\n\t$dbh = NULL;\n\treturn;\n}", "public function __destruct()\n {\n $this->db = null;\n }", "public function __destruct()\n {\n try {\n if (!empty($this->databaseConnection)) {\n $this->databaseConnection->disconnect();\n }\n } catch (\\Exception) {\n }\n }", "public function __destruct()\n {\n parent::$db->closeConnection();\n }", "public function disconnect(){\n\t\n\t//TODO: Custom Error reporting\n\ttry {\n\t\t\n\t\t\t$this->_db = NULL;\n\t\t\t}\n\tcatch(PDOException $e) {\n\t\t\t//xxx Custom Error thingy!!!\n\t\t\t_b($e->getMessage());\n\t\t}\n\t\t\t\t\n\t}", "public static function closeConnection(){\n //Check if instance exists\n if(isset(self::$instance)){\n //Closes connection\n self::$connection = null;\n //unset the instance, following connections will require re-connection to the DB.\n self::$instance = null;\n }\n }", "public function __destruct(){\r\n\t\tself::$dbh = null;\r\n\t\tself::$db = null;\r\n\t}", "public function close()\n {\n $this->db = null;\n }", "public function __destruct() {\n $this->db = NULL;\n }", "public function close(){\r\n\t\tself::$dbh = null;\r\n\t\tself::$db = null;\r\n\t}", "public function closeDB(){\r\n $this->db->schließen();\r\n $this->con = 0;\r\n }", "function __destruct(){\n $this->dbConnection = null;\n }", "public function __destruct()\n {\n $this->db->close($this->conn);\n }", "function dbdisconnect($db_conn){\n\t$db_conn->close();\n}", "function closeDbConnection() {\n global $objDb;\n\n if (isset($objDb)) {\n @$objDb->Close();\n }\n }", "public function closeConnection()\n {\n $this->pdo = null;\n }", "public function __destruct()\n {\n if($this->_isConnected()) {\n mysqli_close($this->_dbConn);\n $this->_dbConn = null;\n }\n }", "public function __destruct() {\n mysqli_close($this->db_connection);\n }", "public function __destruct()\r\n\t{\r\n\t\t$this->db = null;\r\n\t}", "function __destruct() {\n\t\t\tunset($this->db);\n\t\t}", "public static function disconnect() {\n self::$PDO = null;\n }", "function __destruct()\n {\n unset($this->db);\n }", "public function disconnect(): void\n {\n $this->pdo = null;\n }", "public function __destruct(){\n\t\t$this->_db = null;\n\t}", "private function cerrar_conexion() {\n\t\t$this->conn->close();\n\t}", "protected function disconnect()\n {\n $this->conn_queries = 0;\n @$this->dbh->close();\n }", "public function __destruct() {\n unset($this->dbh);\n }", "function __destruct() {\n mysql_close($this->db_conn);\n }", "function closedbconnection() {\r\n\t\t\r\n\t\t\r\n #if ($this->dbconnection = TRUE) {\r\n mysql_close($this->dbconnection);\r\n #}\r\n \r\n }", "function __destruct() {\n //@, Error when no linked to db open. \n\t @mysql_close($this->con);\n\t \n\t}", "function __destruct()\t{\n\t\t$this->db_conn->close();\n\t}", "function closedb(){\r\n\t\tif($this->socket)\r\n\t\t\t\r\n\t\t\tmysqli_close($this->socket);\r\n\t\t\t$this->connected = false;\r\n\t}", "public function __destruct() {\n\t\t$this->dbAdapter->dbClose();\n\t}", "public function __destruct()\n {\n $this -> conn = null;\n }", "public function cerrar(){\n mysqli_close($this->conn);\n }", "public function Desconecta()\n\t{\n\t\t$this->conn = null;\n\t}", "public function __destruct()\n {\n $this->conn = false;\n if ($this->driver) {\n unset($this->driver);\n }\n }", "public function disconnect(){\n\t\t$this->Connection = null;\n\t}", "public function cerrarConexion(){\n $this->conn->close();\n }", "public function disconnect() {\n \n $this->con = null;\n \n }", "function __destruct() {\n mysqli_close($this->database_manager);\n }", "public static function close()\n {\n static::$_db = null;\n }", "function delete(){\r\n\t\t//Connect\r\n\t\t$sql = new DataBase;\r\n\t\t$sql->connect();\r\n\t}", "public static function close_connexion() {\n self::$conn = null;\n }", "public function __destruct() {\n $this->conn = null;\n }", "function __destruct() {\r\n $this->db=null;\r\n }", "public function __destruct()\n {\n $this->connection = null;\n }", "public function __destruct()\n {\n $this->connection = null;\n }", "function __destruct() {\n $this->connection = null;\n }", "public function __destruct(){\r\n //Turn off the lights, and stuff\r\n $this->database->disconnect();\r\n }", "public function __destruct() {\n if ($this->_db !== null)\n mysql_close($this->_db);\n }", "public function cerrarConexion() {\n\t\t$this->_con->close();\n\t}", "public function conn_close(){\n $this->conn = null;\n }", "function __destruct() {\n $this->db->close();\n }", "function __destruct() {\n $this->db->close();\n }", "function shutdown()\n\t{\n\t\tif (class_exists('Db'))\n\t\t{\n\t\t\tDb::close_connection();\n\t\t}\n\t}", "public function destroy()\n {\n $db = XenForo_Application::get('db');\n $db->query('DROP TABLE `' . self::DB_TABLE . '`');\n }", "public function __destruct(){\n\t\t $this->conn = null;\n\t\t}", "public function closeConnection()\n \t{\n \t\t$this->connection = null;\n \t}", "public function __destruct() {\n $conn = null;\n }", "function __destruct()\n {\n if ($this->conn) mysqli_close($this->conn);\n }", "function __destruct() {\n $this->db->close();\n }", "public function __destruct()\n\t\t{\n\t\t\t$this->connection->close();\n\t\t\t//echo 'Desconectado';\n\t\t}", "protected function __destruct()\n {\n if (self::$db) self::$db->close();\n }", "public function __destruct() {\r\n\t\tif (!is_null($this -> link)) {\r\n\t\t\tif (!$this -> pdo) {\r\n\t\t\t\tmysql_close($this -> link);\r\n\t\t\t}\r\n\r\n\t\t\t$this -> link = null;\r\n\t\t\tself::$singleton = null;\r\n\t\t}\r\n\t}", "public static function disconnect()\n\t{\n\t\tself::getConnection()->disconnect();\n\t}", "function disconnect() {\n if ($this->isConntected()) {\n mysql_close($this->connectionId);\n }\n }", "public function __destruct(){\n $this->db->close();\n }", "public function __destruct() {\n $this->close_connection();\n }" ]
[ "0.838163", "0.8351268", "0.8235328", "0.81784683", "0.8161283", "0.8155288", "0.80763096", "0.8041468", "0.80404043", "0.8012389", "0.7941486", "0.79412353", "0.78604245", "0.7807983", "0.7723823", "0.7719712", "0.7697792", "0.7660566", "0.76604015", "0.7659596", "0.76542574", "0.7641473", "0.7601779", "0.75891113", "0.7526291", "0.7521979", "0.7517793", "0.7517793", "0.74900174", "0.7488604", "0.7478656", "0.7476744", "0.7472629", "0.7460475", "0.743789", "0.7432322", "0.74229085", "0.74192446", "0.74071234", "0.7402722", "0.73966587", "0.73945093", "0.7391135", "0.73864424", "0.7380848", "0.7376861", "0.7374451", "0.73712754", "0.73643595", "0.7354218", "0.7334591", "0.7325201", "0.7319808", "0.7317598", "0.7314082", "0.72954607", "0.7293392", "0.7265423", "0.72599524", "0.7258988", "0.72589314", "0.72573906", "0.72478145", "0.723692", "0.72299045", "0.72197473", "0.72179455", "0.72127795", "0.72119224", "0.72033536", "0.7200676", "0.72000414", "0.71972036", "0.7191489", "0.71905106", "0.71829295", "0.7180645", "0.7171472", "0.7171472", "0.7157563", "0.71549", "0.715363", "0.71431994", "0.71348596", "0.71324307", "0.71324307", "0.7131111", "0.71282375", "0.712435", "0.7119255", "0.71128654", "0.7104774", "0.71025926", "0.70953953", "0.7094698", "0.7083635", "0.7083152", "0.7080729", "0.70805407", "0.70715344" ]
0.79106504
12
Display a listing of the resource.
public function index(Request $request) { $inputs = $request->all(); $inputs['nam'] = isset($inputs['nam']) ? $inputs['nam'] : date('Y'); $inputs['tenhhdv'] = isset($inputs['tenhhdv']) ? $inputs['tenhhdv'] : ''; $inputs['tendn'] = isset($inputs['tendn']) ? $inputs['tendn'] : ''; $inputs['paginate'] = isset($inputs['paginate']) ? $inputs['paginate'] : 5; $model = KkGiaXmTxdCt::leftJoin('kkgiaxmtxd','kkgiaxmtxd.mahs','=','kkgiaxmtxdct.mahs') ->leftjoin('company','company.maxa','=','kkgiaxmtxd.maxa') ->select('kkgiaxmtxdct.*','company.tendn','company.maxa','kkgiaxmtxd.ngayhieuluc') ->where('kkgiaxmtxd.trangthai','DD') ->where('kkgiaxmtxd.congbo','CB'); if($inputs['nam'] != 'all') $model = $model->whereYear('kkgiaxmtxd.ngayhieuluc',$inputs['nam']); if($inputs['tenhhdv'] != '') $model = $model->where('kkgiaxmtxdct.tenhhdv','like','%'.$inputs['tenhhdv'].'%'); if($inputs['tendn'] != '') $model = $model->where('company.tendn','like','%'.$inputs['tendn'].'%'); $model = $model->paginate($inputs['paginate']); return view('congbo.KeKhaiGia.XiMangTXD.index') ->with('model',$model) ->with('inputs',$inputs) ->with('pageTitle','Tìm kiếm thông tin kê khai giá xi măng, thép xây dựng'); }
{ "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 index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function 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 index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function 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 actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n 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 view('admin.resources.index');\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\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.7446737", "0.73625076", "0.7300871", "0.72476006", "0.7163127", "0.7149414", "0.7131995", "0.7105663", "0.7102927", "0.7101388", "0.704981", "0.69946545", "0.69897777", "0.6935023", "0.690029", "0.68989694", "0.68925905", "0.68878543", "0.6866467", "0.6849924", "0.6829784", "0.68033314", "0.67971504", "0.6796001", "0.6786942", "0.6760321", "0.6743112", "0.6730776", "0.67266184", "0.67259544", "0.67259544", "0.67259544", "0.671818", "0.670783", "0.670644", "0.6704464", "0.6665842", "0.6663898", "0.6660563", "0.6660198", "0.6657512", "0.6654405", "0.6648237", "0.6620824", "0.6619237", "0.6618058", "0.66072917", "0.660077", "0.6600677", "0.6594786", "0.6587929", "0.65850085", "0.65824693", "0.6581521", "0.6577045", "0.6574634", "0.65729445", "0.65715027", "0.6570646", "0.6565125", "0.6563328", "0.6553843", "0.6553201", "0.6545921", "0.6537198", "0.6534121", "0.6533748", "0.65272135", "0.6526431", "0.6525868", "0.6519198", "0.65185314", "0.6517867", "0.65170157", "0.651509", "0.65070677", "0.6505637", "0.65033627", "0.6494597", "0.6492147", "0.64880013", "0.64871716", "0.6485315", "0.6485215", "0.64790684", "0.64767736", "0.64725083", "0.64709103", "0.64702755", "0.6466392", "0.64618254", "0.646148", "0.64601135", "0.6458744", "0.64543813", "0.64537513", "0.64530194", "0.6450726", "0.64492655", "0.6449169", "0.64466155" ]
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 return view('Form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n 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('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\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 newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }" ]
[ "0.75934863", "0.75934863", "0.7587591", "0.75782615", "0.75711566", "0.74992937", "0.74349296", "0.7432467", "0.7387912", "0.7351958", "0.73380226", "0.73111826", "0.72957826", "0.72812104", "0.72734547", "0.7242778", "0.72294843", "0.7225723", "0.718609", "0.71780044", "0.7173978", "0.71492267", "0.71434265", "0.7143343", "0.71356934", "0.7127626", "0.7122704", "0.71151215", "0.71151215", "0.71151215", "0.711137", "0.7093674", "0.708441", "0.70805633", "0.7079313", "0.70560336", "0.70560336", "0.705535", "0.7038748", "0.7038717", "0.70355713", "0.7033314", "0.70298624", "0.70262384", "0.7025372", "0.70192045", "0.7017566", "0.70037806", "0.70029014", "0.69999987", "0.6995955", "0.6994461", "0.69932437", "0.698907", "0.6985915", "0.69654584", "0.69652516", "0.6956021", "0.6951258", "0.6950627", "0.69471824", "0.69432425", "0.6941303", "0.69406337", "0.6937103", "0.6937103", "0.69363457", "0.6934366", "0.6931313", "0.6927307", "0.6926027", "0.6922591", "0.69176334", "0.69158953", "0.6911744", "0.6910005", "0.6909594", "0.6907657", "0.6902698", "0.6900764", "0.69007087", "0.6900391", "0.68942374", "0.68933", "0.68929493", "0.68912417", "0.68912417", "0.68911326", "0.6888626", "0.6887399", "0.68857414", "0.6884495", "0.6881287", "0.6878567", "0.6875623", "0.687334", "0.68722713", "0.6870009", "0.68697596", "0.6869062", "0.6868769" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.7285655", "0.71443397", "0.7133207", "0.6641532", "0.6621311", "0.65678823", "0.6525738", "0.65086055", "0.6448411", "0.6374508", "0.637246", "0.6364561", "0.6364561", "0.6364561", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122", "0.634122" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function 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 edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($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($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\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 $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 edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78548634", "0.7693446", "0.72737956", "0.72415876", "0.71732706", "0.7064379", "0.70547634", "0.6985193", "0.6948865", "0.6946892", "0.69416964", "0.6929201", "0.69028485", "0.6899143", "0.6899143", "0.68794435", "0.6864862", "0.6860578", "0.68581015", "0.6845792", "0.6836835", "0.681191", "0.6808133", "0.6806856", "0.68035305", "0.6796193", "0.67936623", "0.67936623", "0.67895305", "0.6785768", "0.678106", "0.67773324", "0.67697626", "0.6762823", "0.6747543", "0.6747543", "0.67463523", "0.67444044", "0.6741766", "0.6737379", "0.6726827", "0.6714104", "0.66950524", "0.66935307", "0.6689272", "0.6689106", "0.66872644", "0.6686648", "0.6684393", "0.6670288", "0.6669616", "0.66668564", "0.66668564", "0.666409", "0.6662514", "0.66599286", "0.66590035", "0.6655965", "0.6653906", "0.6644097", "0.66327673", "0.66314846", "0.6629497", "0.6629497", "0.6620671", "0.66204685", "0.66168797", "0.66163945", "0.66112244", "0.6610172", "0.66072273", "0.65975267", "0.6596347", "0.6595878", "0.65914613", "0.65904135", "0.65880567", "0.658147", "0.6581434", "0.6581035", "0.65780395", "0.65776944", "0.6576013", "0.6570687", "0.6569499", "0.6568776", "0.6567722", "0.6562973", "0.6562973", "0.6561691", "0.655929", "0.6557889", "0.65571314", "0.65565974", "0.65564924", "0.65558827", "0.65556073", "0.6555524", "0.6549151", "0.6548339", "0.65460944" ]
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(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(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "public function update($request, $id);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "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 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 function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(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(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($id);", "public function update($id);", "public function put($path, $data = null);", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public 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 $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 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.7423347", "0.70622426", "0.70568657", "0.6896551", "0.65835553", "0.64519453", "0.6348333", "0.6212436", "0.61450946", "0.6122591", "0.6114199", "0.6101911", "0.60876113", "0.60528636", "0.60177964", "0.6006609", "0.59725446", "0.594558", "0.59395295", "0.5938792", "0.5893703", "0.5862337", "0.58523124", "0.58523124", "0.5851579", "0.5815571", "0.58067423", "0.5750728", "0.5750728", "0.5736541", "0.5723664", "0.5715135", "0.56949675", "0.5691129", "0.56882757", "0.5669375", "0.5655524", "0.56517446", "0.5647158", "0.5636521", "0.563466", "0.5632965", "0.56322825", "0.56291395", "0.56202215", "0.56087196", "0.56020856", "0.5591966", "0.5581127", "0.5581055", "0.558085", "0.5575458", "0.55706805", "0.55670804", "0.55629116", "0.5562565", "0.5558853", "0.5558505", "0.5558505", "0.5558505", "0.5558505", "0.5558505", "0.555572", "0.5555007", "0.5553948", "0.5553837", "0.5553147", "0.55429846", "0.5541925", "0.5540208", "0.5539145", "0.5536157", "0.55350804", "0.5534241", "0.5523782", "0.5518406", "0.55147856", "0.5513397", "0.550961", "0.55072165", "0.55067354", "0.5503418", "0.5501671", "0.55010796", "0.54998124", "0.5497327", "0.54942787", "0.54942036", "0.54942036", "0.54935455", "0.549267", "0.5491964", "0.5489983", "0.54833627", "0.54794145", "0.5478835", "0.5478348", "0.5465178", "0.54648995", "0.54607797", "0.54571307" ]
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
/ Initialize action controller here
public function init() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function init()\n {\n /* Initialize action controller here */\n }", "public function init()\n {\n /* Initialize action controller here */\n }", "protected function initializeController() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initAction()\n {\n }", "protected function initializeAction() {\n\t\t/* Merge flexform and setup settings\n\t\t * \n\t\t */\n\t\t$this->settings['action'] = $this->actionMethodName;\n\t}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {\n\n\t}", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "protected function initializeAction() {\n\t\t$this->akismetService->setCurrentRequest($this->request->getHttpRequest());\n\t}", "public function __construct($controller,$action) {\n\t\tparent::__construct($controller, $action);\n\t\t\n\t}", "public function init()\n {\n $controller = $this->router->getController();\n $action = $this->router->getAction();\n $params = $this->router->getParams();\n\n $objController = registerObject($controller);\n\n call_user_func_array([$objController, $action], $params);\n }", "public function __construct($controller, $action) {\n parent::__construct($controller, $action); //parent is Controller.php\n }", "protected function initAction()\r\n {\r\n $return = false;\r\n\r\n // parse request URI\r\n $parts_url = parse_url(strtolower(trim($_SERVER['REQUEST_URI'], '/')));\r\n // @TODO: fix\r\n $parts_url_array = explode('/', $parts_url['path']);\r\n list($this->controllerName, $this->itemId) = $parts_url_array;\r\n\r\n // parse method\r\n $this->requestMethod = strtolower($_SERVER['REQUEST_METHOD']);\r\n\r\n switch ($this->requestMethod) {\r\n case 'get':\r\n // default actions for GET\r\n if ($this->controllerName == 'login' || $this->controllerName == 'logout') {\r\n $this->actionName = $this->controllerName;\r\n $this->controllerName = 'users';\r\n } elseif (is_null($this->itemId)) {\r\n $this->actionName = 'index';\r\n } else {\r\n $this->actionName = 'view';\r\n }\r\n break;\r\n case 'post':\r\n // default action for POST\r\n $this->actionName = 'add';\r\n break;\r\n case 'put':\r\n // default action for PUT\r\n $this->actionName = 'edit';\r\n break;\r\n case 'delete':\r\n // default action for DELETE\r\n $this->actionName = 'delete';\r\n break;\r\n }\r\n\r\n if (!$this->controllerName) {\r\n $this->controllerName = 'main';\r\n }\r\n if (!$this->actionName) {\r\n $this->actionName = 'index';\r\n }\r\n\r\n // get, check & requre class\r\n $className = sprintf('mob%s', ucfirst($this->controllerName));\r\n $className = 'pages\\\\' . $className;\r\n \r\n if (class_exists($className)) {\r\n //create a instance of the controller\r\n $this->controller = new $className();\r\n\r\n //check if the action exists in the controller. if not, throw an exception.\r\n $actionName = sprintf('action%s', ucfirst($this->actionName));\r\n if (method_exists($this->controller, $actionName) !== false) {\r\n $this->action = $actionName;\r\n // set request params\r\n if ($this->itemId) {\r\n $this->controller->setParams(array('id' => $this->itemId));\r\n }\r\n $this->controller->setRequestParams($this->requestMethod);\r\n\r\n $return = true;\r\n } else {\r\n $this->controller->httpStatusCode = HTTP_STATUS_METHOD_NOT_ALLOWED;\r\n// throw new \\Exception('Action is invalid.');\r\n }\r\n } else {\r\n $this->controller = new clsMobController();\r\n $this->controller->httpStatusCode = HTTP_STATUS_NOT_FOUND;\r\n// throw new \\Exception('Controller class is invalid.');\r\n }\r\n\r\n return $return;\r\n }", "public function __construct()\n {\n // Prepare the action for execution, leveraging constructor injection.\n }", "public function __construct() {\n // filter controller, action and params\n $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL); // $_GET['url']\n $params = explode('/', trim($url, '/'));\n\n // store first and seccond params, removing them from params list\n $controller_name = ucfirst(array_shift($params)); // uppercase classname\n $action_name = array_shift($params);\n\n require_once APP . 'config.php';\n\n // default controller and action\n if (empty($controller_name)) {\n $controller_name = AppConfig::DEFAULT_CONTROLLER;\n }\n if (empty($action_name)) {\n $action_name = AppConfig::DEFAULT_ACTION;\n }\n\n // load requested controller\n if (file_exists(APP . \"Controller/$controller_name.php\")) {\n require CORE . \"Controller.php\";\n require CORE . \"Model.php\";\n require APP . \"Controller/$controller_name.php\";\n $controller = new $controller_name();\n\n // verify if action is valid\n if (method_exists($controller, $action_name)) {\n call_user_func_array(array($controller, $action_name), $params);\n $controller->render(\"$controller_name/$action_name\"); // skipped if already rendered\n } else {\n // action not found\n $this->notFound();\n }\n } else {\n // controller not found\n $this->notFound();\n }\n }", "public static function init() {\n\t\tself::setup_actions();\n\t}", "protected function initializeAction()\n\t{\n\t\tparent::init('Form');\n\t}", "public function initController()\n {\n $this->model = new AliveSettingServiceMeta();\n\n $this->middleware([\n\n ]);\n }", "public function init() {\n\n $this->jobs = new Hb_Jobs();\n if ($this->_request->getActionName() == 'view') {\n\n $this->_request->setActionName('index');\n }\n\n $this->searchParams = $this->_request->getParams();\n $this->view->searchParams = $this->searchParams;\n\n $this->view->actionName = $this->_request->getActionName();\n }", "protected function initializeAction()\n {\n $this->extKey = GeneralUtility::camelCaseToLowerCaseUnderscored('BwrkOnepage');\n /** @var LanguageAspect $languageAspect */\n $languageAspect = GeneralUtility::makeInstance(Context::class)->getAspect('language');\n $this->languageUid = $languageAspect->getId();\n }", "protected function initializeAction()\n {\n parent::initializeAction();\n $this->customer = SubjectResolver::get()\n ->forClassName(Customer::class)\n ->forPropertyName('user')\n ->resolve();\n }", "public function initialize()\n {\n parent::initialize();\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Cookie');\n $this->cors();\n\n $currentController = $this->request->getParam('controller');\n // pr($currentController); die();\n if($currentController == 'Tenants'){\n $currentController = 'TenantUsers';\n }\n if($currentController == 'CorporateClients'){\n $currentController = 'CorporateClientUsers';\n // pr($currentController);die();\n }\n // $currentController = $this->request->params['controller'];\n $loginAction = $this->Cookie->read('loginAction');\n if(!$loginAction){\n $loginAction = ['controller' => $currentController,'action' => 'login'];\n }\n // pr($loginAction);die;\n $this->loadComponent('Auth',[\n 'loginAction' => ['controller' => $currentController,'action' => 'login'],\n 'authenticate' => [\n 'Form' =>\n [\n 'userModel' => $currentController,\n 'fields' => ['username' => 'email', 'password' => 'password']\n ]\n ],\n 'authorize'=> ['Controller'],\n 'loginAction' => $loginAction,\n 'loginRedirect' => $loginAction,\n 'logoutRedirect' => $loginAction \n\n ]);\n // $this->loadComponent('Auth', [\n\n // 'unauthorizedRedirect' => false,\n // 'checkAuthIn' => 'Controller.initialize',\n\n // // If you don't have a login action in your application set\n // // 'loginAction' to false to prevent getting a MissingRouteException.\n // 'loginAction' => false\n // ]);\n /*\n * Enable the following components for recommended CakePHP security settings.\n * see https://book.cakephp.org/3.0/en/controllers/components/security.html\n */\n }", "public function init() {\n\t\t$this->load_actions();\n\t}", "public function init()\r\n {\r\n\r\n /* Initialize action controller here */\r\n\r\n //=====================================must add in all Controller class constructor ===================================//\r\n if(defined('SITEURL')) $this->site_url = SITEURL;\r\n if(defined('SITEASSET')) $this->site_asset = SITEASSET;\r\n $this->view->site_url = $this->site_url;\r\n $this->view->site_asset = $this->site_asset;\r\n Zend_Loader::loadClass('Signup');\r\n Zend_Loader::loadClass('User');\r\n Zend_Loader::loadClass('Request');\r\n //Zend_Loader::loadClass('mailerphp');\r\n\t\t//Zend_Loader::loadClass('Permission');\r\n\r\n\r\n //-----------------------------------------------authenticate logged in user---------------------------------------------//\r\n Zend_Loader::loadClass('LoginAuth');\r\n $this->view->ob_LoginAuth = $this->sessionAuth = new LoginAuth();\r\n\r\n $this->sessionAuth->login_user_check();\r\n\r\n $this->sessionAuth->cookie_check();\r\n $this->view->server_msg = $this->sessionAuth->msg_centre();\r\n\r\n //-----------------------------------------------authenticate logged in user---------------------------------------------//\r\n unset($_SESSION['tranzgo_session']['export_list']);\r\n $this->view->ControllerName = $this->_request->getControllerName();\r\n $this->view->page_id = ($_SESSION['tranzgo_session']['role_id']==1)?'5':'7';\r\n //______________________________________must add in all Controller class constructor _____________________________________//\r\n\r\n\r\n }", "public function __construct() {\n\t\t\t$this->init_globals();\n\t\t\t$this->init_actions();\n\t\t}", "public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->resolution_summary = \"\";\n\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __init()\n\t{\n\t\t// This code will run before your controller's code is called\n\t}", "function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t\t$this->_actionModel = new Action_Model();//khoi tao class\n\t\t}", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "protected function initializeAction() {\t\n\t\t$this->persdataRepository = t3lib_div::makeInstance('Tx_PtConference_Domain_Repository_persdataRepository');\n\t}", "public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->media_values = array(\n\t\t\t101 => Kohana::lang('ui_main.all'),\n\t\t\t102 => Kohana::lang('actionable.actionable'),\n\t\t\t103 => Kohana::lang('actionable.urgent'),\n\t\t\t104 => Kohana::lang('actionable.action_taken')\n\t\t);\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __construct() {\n\n list($null,$controller, $action, $id) = explode(\"/\", $_SERVER['PATH_INFO']);\n \n $this->urlValues['base'] = \"http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n $this->urlValues['controller'] = $controller ? $controller : \"home\";\n $this->urlValues['action'] = $action;\n $this->urlValues['id'] = $id;\n\n $this->controllerName = strtolower($this->urlValues['controller']);\n $this->controllerClass = ucfirst(strtolower($this->urlValues['controller'])) . \"Controller\";\n\n if ($this->urlValues['action'] == \"\") {\n $this->action = \"index\";\n } else {\n $this->action = $this->urlValues['action'];\n }\n }", "protected function _initControllers()\n\t{\n\t\treturn;\n\t}", "public function init()\n {\n $this->vars['CRUD']['Object'] = $this;\n $this->kernel = kernel();\n\n // Dynamic initialization\n if (! $this->modelName) {\n $modelRefl = new ReflectionClass($this->modelClass);\n $this->modelName = $modelRefl->getShortName();\n }\n\n\n if (! $this->crudId) {\n $this->crudId = \\Phifty\\Inflector::getInstance()->underscore($this->modelName);;\n }\n if (! $this->templateId) {\n $this->templateId = $this->crudId;\n }\n\n // Derive options from request\n if ($request = $this->getRequest()) {\n if ($useFormControls = $request->param('_form_controls')) {\n $this->actionViewOptions['submit_btn'] = true;\n $this->actionViewOptions['_form_controls'] = true;\n }\n }\n\n $this->reflect = new ReflectionClass($this);\n $this->namespace = $ns = $this->reflect->getNamespaceName();\n\n // XXX: currently we use FooBundle\\FooBundle as the main bundle class.\n $bundleClass = \"$ns\\\\$ns\";\n if (class_exists($bundleClass)) {\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n } else {\n $bundleClass = \"$ns\\\\Application\";\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n }\n\n $this->vars['Handler'] = $this;\n $this->vars['Controller'] = $this;\n\n // anyway, we have the model classname, and the namespace, \n // we should be able to registerRecordAction automatically, so we don't have to write the code.\n if ($this->registerRecordAction) {\n $self = $this;\n $this->kernel->event->register('phifty.before_action',function() use($self) {\n $self->kernel->action->registerAction('RecordActionTemplate', array(\n 'namespace' => $self->namespace,\n 'model' => $self->modelName,\n 'types' => (array) $self->registerRecordAction\n ));\n });\n }\n\n\n $this->initPermissions();\n\n /*\n * TODO: Move this to before render CRUD page, keep init method simple\n\n if ( $this->isI18NEnabled() ) {\n $this->primaryFields[] = 'lang';\n }\n */\n $this->initNavBar();\n }", "public function _initialize()\n {\n $this->cate=CONTROLLER_NAME;\n }", "protected function initializeActionEntries() {}", "protected function initializeAction() {\n\t\t$this->feusers = $this->feusersRepository->findByUid( $GLOBALS['TSFE']->fe_user->user['uid'] ) ;\n\t\t$this->schule = $this->feusers->getSchule();\n\t\n\t\t$this->extKey = $this->request->getControllerExtensionKey();\n\t\t$this->extPath = t3lib_extMgm::extPath($this->extKey);\n\t\n\t\t$this->importClassFile = $this->extPath.'Classes/tmp/class.importtext.php';\n\t\t$this->importClass = 'ImportText';\n\t \n\t\tif ( $this->settings[pidAjaxContainerKlassenuebersicht] > 0) $this->pidAjaxContainerKlassenuebersicht = (int) $this->settings[pidAjaxContainerKlassenuebersicht];\n\t\n\t}", "public function init(){\r\n\t$this->_helper->_acl->allow('public',NULL);\r\n\t$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\r\n\t$this->_contexts = array('xml','json');\r\n\t$this->_helper->contextSwitch()\r\n\t\t->setAutoDisableLayout(true)\r\n\t\t->addActionContext('oneto50k',$this->_contexts)\r\n\t\t->addActionContext('index',$this->_contexts)\r\n\t\t->initContext();\r\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function initBaseController();", "public function init() {\n $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\n\t\t$this->_helper->acl->allow('public',null);\n\t\t$this->_helper->contextSwitch()\n\t\t\t ->setAutoDisableLayout(true)\n\t\t\t ->addActionContext('index', array('xml','json'))\n ->initContext();\n\t}", "public function __construct()\n {\n // Call the CI_Controller constructor\n parent::__construct();\n }", "public function __construct()\n\t{\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function initAction() : object\n {\n /**\n * Show all movies.\n */\n $response = $this->app->response;\n return $response->redirect(\"cms/posts\");\n }", "protected function initializeAction() {\n\t\t$this->frontendUserRepository = t3lib_div::makeInstance('Tx_GrbFeusermanager_Domain_Repository_FrontendUserRepository');\n\t}", "public function contentControllerInit()\n\t{\n\t}", "protected function initializeAction()\n {\n parent::initializeAction();\n\n $query = GeneralUtility::_GET('q');\n if ($query !== null) {\n $this->request->setArgument('q', $query);\n }\n }", "public function __construct()\n {\n $this->setAction('index', array('idle', 'toggleEnabled', 'expunge'));\n }", "public static function init() {\n\t\t$_GET = App::filterGET();\n\t\t\n\t\t// Checken of er params zijn meegegeven\n\t\ttry {\n\t\t\tif (count($_GET) == 0) {\n\t\t\t\t$_GET[0] = '';\n\t\t\t}\n\t\t\t\n\t\t\t// Is de eerste param een controller ? Anders een pageView\n\t\t\tif (self::isController($_GET[0])) {\n\t\t\t\t$controllerName = self::formatAsController($_GET[0]);\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Er is sprake van een pageview\n\t\t\t\t$controllerName = 'PagesController';\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\t\n\t\t\t$action = self::getAction($controller);\n\t\t\t$controller->setAction($action);\n\n\t\t\t// Try to exec the action\n\t\t\ttry {\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(ActionDoesNotExistException $ex) {\n\n\t\t\t\techo $action;\n\t\t\t\t// Action bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidAction');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(MissingArgumentsException $ex) {\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('missingArguments');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\t\n\t\t\t// Try to render the view\n\t\t\ttry {\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\tcatch(ViewDoesNotExistException $ex) {\n\t\t\t\t// View bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidView');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t\t\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch(NoValidTemplateException $ex) {\n\t\t\techo 'Invalid template';\n\t\t}\n\t\tcatch(IsNotControllerException $ex) {\n\t\t\techo 'Controller not found';\n\t\t}\n\t}", "public function init()\r\n { \r\n //date_default_timezone_set('America/Phoenix');\r\n $ajaxContext = $this->_helper->getHelper('AjaxContext');\r\n\t$ajaxContext->addActionContext('list', 'html')\r\n ->addActionContext('edit', 'html')\r\n ->addActionContext('dashboard', 'html')\r\n ->addActionContext('handler', 'html')\r\n ->initContext();\r\n $auth = Zend_Auth::getInstance();\r\n $action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\r\n $type = $this->getRequest()->getParam('type');\r\n if (!$auth->hasIdentity() && $action!='handler') {\r\n //echo \"THIS IS AN ERROR: \".$action;\r\n $this->_redirect('login', array('UseBaseUrl' => true));\r\n }\r\n }", "public function __construct()\n {\n $this->model = new MainModel();\n $this->params[\"pagination\"][\"totalItemsPerPage\"] = 5;\n view()->share ('controllerName', $this->controllerName);//đặt controllerName cho all action\n }", "public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function init() {\n $this->_temporizador = new Trf1_Admin_Timer ();\n $this->_temporizador->Inicio();\n\n /* Initialize action controller here */\n $this->view->titleBrowser = 'e-Sisad';\n }", "public function __construct()\n\t{\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "function __construct()\n {\n parent::Controller();\n }", "public function controller()\n\t{\n\t\n\t}", "public function init() {\n\t\t\t\t\t\t$this->view->controller = $this->_request->getParam ( 'controller' );\n\t\t\t\t\t\t$this->view->action = $this->_request->getParam ( 'action' );\n\t\t\t\t\t\t$this->getLibBaseUrl = new Zend_View_Helper_BaseUrl ();\n\t\t\t\t\t\t$this->GetModelOrganize = new Application_Model_ModOrganizeDb ();\n\t\t\t\t\t\t$this->_helper->ajaxContext->addActionContext('deleteOrganisme1','json')->initContext();\n\t\t\t\t\t\t// call function for dynamic sidebar\n\t\t\t\t\t\t$this->_Categories = new Application_Model_ModCatTerm ();\n\t\t\t\t\t\t$parent_id = $this->_getParam ( 'controller' );\n\t\t\t\t\t\t$this->view->secondSideBar = $this->_Categories->showCateParent ( $parent_id );\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public function initializeAction() {\t\t\n\t\t$this->contactRepository = t3lib_div::makeInstance('Tx_Addresses_Domain_Repository_ContactRepository');\t\n\t}", "public function init() {\n\t$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\n\t$this->_helper->acl->allow('public',null);\n\t$this->_helper->contextSwitch()\n\t\t->setAutoDisableLayout(true)\n\t\t->addActionContext('index', array('xml','json'))\n\t\t->addActionContext('mint', array('xml','json'))\n\t\t->initContext();\n }", "public function __construct()\n {\n if (get_called_class() != 'ApplicationController') {\n $this->_set_default_layout();\n $this->_vars = new stdClass();\n $this->_init();\n }\n }", "public function initializeAction() {\n parent::initializeAction();\n $this->umDiv = new Tx_Magenerator_Domain_UserManagement_Div();\n }", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "public function actionInit()\n {\n $this->initRoles($this->roles);\n $this->initPermissions($this->permissions);\n $this->initDependencies($this->dependencies);\n }", "public function getControllerAction() {}", "public function __construct($action = '') {\n\t\t$this->app = Application::app();\n\t\t$this->setAction($action);\n\t}", "function initialize(Controller $controller) {\n $this->controller=&$controller;\n \t}", "public function __construct($controller, $action) {\n parent::__construct($controller, $action);\n $this->loadModel('Baskets');\n $this->loadModel('Orders');\n $this->loadModel('Messages');\n $this->loadModel('Products');\n\n if(Session::exists(BUYER_SESSION_NAME)) {\n $this->view->totalProductInBasket = $this->BasketsModel->countProductInBasket();\n $this->view->totalOrders = $this->OrdersModel->countSentOrder();\n $this->view->msgCount = $this->MessagesModel->unReadMessages();\n } elseif(Session::exists(STORE_SESSION_NAME)) {\n $this->view->msgCount = $this->MessagesModel->unReadMessages();\n $this->view->newOrders = $this->OrdersModel->newOrders(Session::get(STORE_SESSION_NAME));\n }\n\n $this->view->setLayout('details');\n }", "function initialize(Controller $controller) {\n $this->controller = $controller;\n }", "public function __construct() {\n if (isset($_GET['rc'])) {\n $this->url = rtrim($_GET['rc'], '/'); // We don't want no empty arg\n $this->args = explode('/', $this->url);\n }\n \n // Load index controller by default, or first arg if specified\n $controller = ($this->url === null) ? 'null' : array_shift($this->args);\n $this->controllerName = ucfirst($controller);\n\n // Create controller and call method\n $this->route();\n // Make the controller display something\n $this->controllerClass->render();\n }", "public function __construct() {\r\n\t\t\r\n\t\tSession::init();\n\t\tif (!Session::get('local'))\n\t\t\tSession::set('local', DEFAULT_LANGUAGE);\r\n\t\t\r\n\t\t$this->getUrl();\r\n\t\t\r\n\t\t//No controller is specified.\r\n\t\tif (empty($this->url[0])) {\r\n\t\t\t$this->loadDefaultController();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$this->loadCurrentController();\r\n\t\t$this->callControllerMethod();\r\n\r\n\t}", "public function __construct() {\n $this->urlValues = $_GET;\n if (!isset($this->urlValues['c'])) {\n $this->controllerName = \"home\";\n $this->controllerClass = \"HomeController\";\n } else {\n $this->controllerName = strtolower($this->urlValues['c']);\n $this->controllerClass = ucfirst(strtolower($this->urlValues['c'])) . \"Controller\";\n }\n \n if (!isset($this->urlValues['a'])) {\n $this->action = \"index\";\n } else {\n $this->action = $this->urlValues['a']; \n }\n }", "public function preAction() {\n $this->apiBrowser = new ApiBrowser();\n\n $basePath = $this->request->getBasePath();\n $this->namespaceAction = $basePath . '/namespace/';\n $this->classAction = $basePath . '/class/';\n $this->searchAction = $basePath . '/search';\n }", "function __construct($controller, $action)\n {\n global $inflect;\n\n $this->renderPage = true;\n $this->renderHeader = true;\n \t\n\t\t$this->requireUser = false;\n\t\t \n $this->_controller = ucfirst($controller);\n $this->_action = $action;\n \n $model = ucfirst($inflect->singularize($controller));\n $this->$model = new $model;\n\n $this->_template = new Template($controller, $action);\n }", "public function init()\n {\n $this->ctrlModel = new Admin_Model_Acl_ControllersActions();\n $this->dbCtrl = new Admin_Model_DbTable_Acl_ModuleController();\n }", "public function setup_actions() {}", "public function init(){\r\n\t\t$this->_data = $this->_request->getParams();\r\n $controller = $this->_data['controller']; //Get controller\r\n $action = $this->_data['action']; //Get action\r\n \r\n $loadfunction = new Default_Model_Common();\r\n foreach($loadfunction->loadFunction($controller) as $value){\r\n if($action == $value['action']){\r\n $load = new $value['model_load']();\r\n $this->view->$value['varname'] = $load->$value['function_load']();\r\n }\r\n }\r\n\r\n $this->view->lang = Zend_Registry::get(\"lang\"); //load language\r\n \r\n //List menu\r\n $listmenu = Zend_Registry::get(\"listmenu\");\r\n $this->view->listmenu = $listmenu;\r\n \r\n $this->view->selectaccount = ' class=\"selected\"';\r\n }", "function __construct() {\n\t\t\n\t\tparent::__construct();\n\t\t\n\t\t// skip the timestamp check for this app\n\t\tSession::check(true);\n\t\t$this->data[\"showActions\"] = true;\n\t\t$this->data[\"csrfToken\"] = CSRF::generateToken();\n\t\t\n\t}", "abstract public function getControllerAction();", "public function _construct($controller,$view){\r\n $this->controller = $controller;\r\n }", "public function initialize()\n { $model= new \\Yabasi\\ModelController();\n $this->setSchema($model->model());\n $this->setSource(\"notification\");\n }", "protected function __construct() {\n\t\t\tadd_action( 'init', array( $this, 'action__init' ), 11 );\n\t\t}", "public function init()\n {\n $this->ctrlActionModel = new Admin_Model_Acl_ControllersActions();\n $this->dbController = new Admin_Model_DbTable_Acl_ModuleController();\n $this->dbAction = new Admin_Model_DbTable_Acl_Action();\n }", "public function init()\n {\n $this->projectController->init();\n }", "function __construct() {\n\t\t\t$this->register_actions();\t\t\n\t\t\t$this->register_filters();\n\t\t}", "public function __construct() {\n // Call Module constructur\n parent::__construct();\n\n // Add additional route\n $this->_actions['GET']['/people/:id'] = 'people';\n }", "public function initialize()\n {\n $model= new \\Yabasi\\ModelController();\n $this->setSchema($model->model());\n $this->setSource(\"refund\");\n }", "function Controller()\n\t{\t\t\n\t\t$this->method = \"showView\";\n\t\tif (array_key_exists(\"method\", $_REQUEST))\n\t\t\t$this->method = $_REQUEST[\"method\"];\n\t\t\t\t\n\t\t$this->icfTemplating = new IcfTemplating();\n\t\t$this->tpl =& $this->icfTemplating->getTpl();\n\t\t$this->text =& $this->icfTemplating->getText();\t\t\n\t\t$this->controllerMessageArray = array();\n\t\t$this->pageTitle = \"\";\n\t\t$this->dateFormat = DateFormatFactory::getDateFormat();\n\t\t$this->controllerData =& $this->newControllerData();\n\t}", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "function __construct($module,$controller,$action) {\n\t\t$this->action = $action;\n\t\t$this->controller = preg_replace('%Controller$%','',$controller);\n\t\t$this->module = $module;\n\n\t\t$jadeCacheDir = J::path(\"App/Cache/Jade/$this->module/$this->controller\");\n\t\t(is_dir($jadeCacheDir)) || mkdir($jadeCacheDir,0777,true);\n\t\t$this->cacheFile = J::path(\"$jadeCacheDir/$this->action.php\");\n\t\t$this->viewFile = J::path(\"App/Modules/$this->module/Views/$this->controller/$this->action.jade\");\n\t}", "public function __construct()\n {\n $url = $this->getUrl();\n // Look in controllers folder for first value and ucwords(); will capitalise first letter \n if (isset($url[0]) && file_exists('../app/controllers/' . ucwords($url[0]) . '.php')) {\n $this->currentController = ucwords($url[0]); // Setting the current controllers name to the name capitilised first letter\n unset($url[0]); \n }\n\n // Require the controller\n require_once '../app/controllers/' . $this->currentController . '.php';\n // Taking the current controller and instantiating the controller class \n $this->currentController = new $this->currentController;\n // This is checking for the second part of the URL\n if (isset($url[1])) {\n if (method_exists($this->currentController, $url[1])) { // Checking the seond part of the url which is the corresponding method from the controller class\n $this->currentMethod = $url[1];\n unset($url[1]);\n }\n }\n\n // Get params, if no params, keep it empty\n $this->params = $url ? array_values($url) : []; \n\n // Call a callback with array of params\n call_user_func_array([$this->currentController, $this->currentMethod], $this->params);\n }", "public function __construct() {\n\t\tparent::__construct();\n\t\t$this->view = new ViewController();\t\t\n\t}", "public function __construct()\n {\n $this->controller = new Controller;\n $this->error_message = 'bad request or duplicate data';\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }" ]
[ "0.89566046", "0.89566046", "0.82057846", "0.80040884", "0.80040884", "0.8004028", "0.7928566", "0.7802862", "0.7750365", "0.7750365", "0.7750365", "0.7750365", "0.7750365", "0.7741994", "0.76497424", "0.7542271", "0.7541656", "0.7458589", "0.7430627", "0.7382884", "0.73493266", "0.73307425", "0.7321889", "0.73055863", "0.7295852", "0.7274981", "0.72531754", "0.7246773", "0.7212456", "0.72057885", "0.71661454", "0.71535975", "0.7130195", "0.7116122", "0.70873964", "0.7080964", "0.7078719", "0.70654655", "0.7053619", "0.7048942", "0.7036025", "0.7028192", "0.6996098", "0.69914645", "0.6983108", "0.69822043", "0.6978827", "0.69710267", "0.69653803", "0.6934731", "0.69341296", "0.6926329", "0.692468", "0.69113386", "0.6909758", "0.6896174", "0.68904704", "0.6874338", "0.68700373", "0.68700373", "0.6862786", "0.6847179", "0.6844484", "0.68443036", "0.68056643", "0.6804595", "0.68018633", "0.67917275", "0.6769771", "0.676602", "0.6765842", "0.67582476", "0.67257833", "0.6721477", "0.6721169", "0.67196625", "0.67082113", "0.6707143", "0.6706214", "0.67023355", "0.6700337", "0.669937", "0.6695276", "0.66930395", "0.6692887", "0.6688026", "0.66866106", "0.66839683", "0.6674853", "0.6667438", "0.6658782", "0.66509074", "0.6642763", "0.66400504", "0.6634305", "0.6610988", "0.6610453", "0.66071516", "0.66062886", "0.6600459", "0.6599095" ]
0.0
-1
Determine if the user is authorized to make this request.
public function authorize() { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }", "public function authorize()\n {\n return !is_null($this->user());\n }", "public function authorize()\n {\n return request()->user() != null;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }", "public function isAuthorized() {}", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n return auth()->check() ? true : false;\n }", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }", "public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }", "function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }", "public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }", "public function authorize()\n {\n return is_client_or_staff();\n }", "public function isAuthorized() {\n\t\treturn true;\n\t}", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}", "public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }", "public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }", "public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }", "public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }", "public function hasAuthorized() {\n return $this->_has(1);\n }", "public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }", "public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }", "public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }", "public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }", "public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n return \\Auth::check() ? true : false;\n }", "public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return !empty(Auth::user());\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function isAuthorized() {\n\t\t\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }", "public function authorize()\n {\n return $this->auth->check();\n }", "public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }", "public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->container['auth']->check();\n }", "function isAuthorized($request) {\n return true;\n }", "public function authorize()\n {\n return Auth::guest() || isMember();\n }", "public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }", "public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }", "public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }", "public function authorize()\n {\n return TRUE;\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }", "public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }", "public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }", "public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}", "public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}", "public function authorize()\n {\n // User system not implemented\n return true;\n }", "public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }", "public function authorize()\n {\n $idExpense = $this->input('expense');\n $expense = Expense::find($idExpense);\n\n return $expense && $this->user()->id == $expense->user_id;\n }", "public function authorize()\n {\n $organizationId = (string) $this->route('id');\n\n $this->organization = Organization::findByUuidOrFail($organizationId);\n\n return $this->user()->can('show', [Organization::class, $this->organization]);\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function authorize()\n {\n $user = Auth::user();\n $orderElement = OrderElement::find($this->input(\"order_element_id\"));\n $order = $orderElement->order;\n\n if ($user->id == $order->user_id) {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $current_user = auth()->user();\n $convention = Convention::find($this->route('convention_id'));\n\n // Use ClientPolicy here to authorize before checking the fields\n return $current_user->can('store', Convention::class)\n || $current_user->can('update', $convention);\n }", "public function authorize()\n {\n if (session()->has('user'))\n {\n $participantController = new ParticipantController();\n\n return !$participantController->isParticipating($this->input('id_user'), $this->input('id_event'));\n }\n else\n {\n return false;\n }\n }", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }" ]
[ "0.839992", "0.8375952", "0.8375952", "0.8342815", "0.8252745", "0.82473254", "0.8211478", "0.81453574", "0.810956", "0.80823004", "0.79912364", "0.7989508", "0.7982261", "0.7959524", "0.79507357", "0.7948338", "0.79256135", "0.79145455", "0.79002494", "0.7893071", "0.7889318", "0.7889047", "0.7859889", "0.78410757", "0.78410757", "0.783742", "0.7823091", "0.7812151", "0.7807754", "0.77919126", "0.7786674", "0.7781593", "0.7780777", "0.7762826", "0.7753834", "0.77178144", "0.77178144", "0.771564", "0.77118343", "0.77043885", "0.7693797", "0.7691735", "0.76900935", "0.76898056", "0.76733977", "0.76662993", "0.7664653", "0.76545596", "0.764996", "0.7642534", "0.764228", "0.7641884", "0.7634402", "0.762985", "0.76291037", "0.7626811", "0.76197964", "0.76197964", "0.76127744", "0.76032645", "0.7603009", "0.7601598", "0.7601598", "0.7600797", "0.7598501", "0.75954676", "0.75872594", "0.7584999", "0.7580122", "0.756261", "0.7553521", "0.7551973", "0.75506663", "0.7544154", "0.754182", "0.7538652", "0.7537086", "0.7529288", "0.75156945", "0.7513393", "0.74994284", "0.74953514", "0.7494652", "0.7491306", "0.7486971", "0.74858564", "0.74782985", "0.74769115", "0.7471861", "0.7470534", "0.7463947", "0.74632055", "0.74620247", "0.7461856", "0.7460523", "0.7448737", "0.7438837", "0.7435204", "0.74337536", "0.7430899", "0.74234605" ]
0.0
-1
Get the validation rules that apply to the request.
public function rules() { return [ 'namePr' => 'required', 'specPr' => 'required', 'qtyPr' => 'required' ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }", "public function getRules()\n {\n return $this->validator->getRules();\n }", "public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }", "public function rules()\n {\n return $this->validationRules;\n }", "public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }", "public static function getRules()\n {\n return (new static)->getValidationRules();\n }", "public function getRules()\n {\n return $this->validation_rules;\n }", "public function getValidationRules()\n {\n return [];\n }", "public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }", "public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }", "public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }", "protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }", "public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }", "public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n return $this->rules;\n }", "public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }", "public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }", "public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }", "public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }", "protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }", "public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }", "protected function getValidRules()\n {\n return $this->validRules;\n }", "public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }", "public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }", "public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }", "public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n { \n return $this->rules;\n }", "public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }", "public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }", "public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }", "public function validationRules()\n {\n return [];\n }", "public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }", "function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}", "public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }", "public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n return static::$rules;\n }", "function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}", "public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }", "public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }", "protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }", "public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }", "public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }", "public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }", "public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }", "public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }", "abstract protected function getValidationRules();", "public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }", "public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }", "public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }", "public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }", "public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }", "public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }", "public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }", "public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }", "public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }", "public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }", "public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }", "public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }", "public function getValidationRules() : array;", "public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }", "public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }", "public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }", "public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }", "public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}", "public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}", "public function rules()\n {\n $rules = array();\n return $rules;\n }", "public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }", "public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }", "public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }", "protected function get_validation_rules()\n {\n }", "public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }", "public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }", "public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }", "public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }", "public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }", "public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }", "public function rules(Request $request)\n {\n return Qc::$rules;\n }", "public function defineValidationRules()\n {\n return [];\n }", "public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }", "public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }" ]
[ "0.8342797", "0.8013068", "0.79357624", "0.79257727", "0.7922943", "0.7903906", "0.7859204", "0.7789624", "0.7783409", "0.77624106", "0.773673", "0.7732383", "0.77094924", "0.7691624", "0.7684878", "0.7682184", "0.7682184", "0.7682184", "0.7682184", "0.7682184", "0.7682184", "0.76753145", "0.76747704", "0.76653886", "0.7656984", "0.7641385", "0.7629662", "0.7629557", "0.7617277", "0.76092637", "0.7607173", "0.7602176", "0.7598716", "0.7597812", "0.7591812", "0.75902253", "0.7587347", "0.7579866", "0.75553906", "0.7555079", "0.75503534", "0.75459445", "0.7540463", "0.7536189", "0.75356364", "0.75300074", "0.75181943", "0.7514811", "0.75078565", "0.7506201", "0.75052506", "0.7498871", "0.7495198", "0.7494957", "0.7493081", "0.74902064", "0.7489407", "0.74890095", "0.7485984", "0.74858546", "0.7478957", "0.74781555", "0.74693084", "0.74632835", "0.7461654", "0.746117", "0.745908", "0.74546385", "0.7453331", "0.7452256", "0.7449815", "0.74481654", "0.7441297", "0.74408644", "0.7435215", "0.743476", "0.7432712", "0.74296844", "0.74289936", "0.7423239", "0.7418971", "0.74155754", "0.7413715", "0.7413531", "0.7412177", "0.7409704", "0.740534", "0.74039155", "0.7403364", "0.740084", "0.73900056", "0.73831314", "0.73729247", "0.7370593", "0.73688376", "0.73608065", "0.7355452", "0.7346383", "0.73441696", "0.73426807", "0.73349255" ]
0.0
-1
Display a listing of the resource.
public function danhsach() { $data=Khachhang::select()->get()->toArray(); return view('listkhachhang',['khachhang'=>$data]); }
{ "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 {\n $modules = Module::all();\n return Resource::collection($modules);\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 // 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 index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\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 $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 index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function listAction() {}", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $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 //\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 $this->booklist();\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 $items = Item::all();\n return view('items::list_items',compact('items'));\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 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 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 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 actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n 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 index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\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 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.7446524", "0.73606837", "0.72986734", "0.72471476", "0.7162155", "0.7148338", "0.71326286", "0.71040463", "0.71014625", "0.7099794", "0.705008", "0.6992253", "0.6988787", "0.69345415", "0.690014", "0.6898432", "0.6890998", "0.68884057", "0.68659663", "0.6849296", "0.6829797", "0.6801322", "0.6797618", "0.6795635", "0.67849535", "0.67592627", "0.674149", "0.67309594", "0.67251754", "0.6723507", "0.6723507", "0.6723507", "0.6718214", "0.6707538", "0.67058325", "0.67048824", "0.6665217", "0.66635793", "0.6660825", "0.6660659", "0.6657826", "0.6654284", "0.66487294", "0.66206425", "0.6619581", "0.6615064", "0.660576", "0.66012174", "0.66000843", "0.6594909", "0.6587545", "0.65845066", "0.65826195", "0.6581026", "0.6575906", "0.6573519", "0.657322", "0.6570324", "0.6569608", "0.6564927", "0.65621465", "0.6553052", "0.6550947", "0.65454125", "0.65373635", "0.65338445", "0.65335166", "0.6527752", "0.65250987", "0.6524361", "0.65207255", "0.65178186", "0.65174717", "0.65155977", "0.6515444", "0.65075177", "0.65038854", "0.6502002", "0.64949256", "0.6491797", "0.64876413", "0.64858246", "0.64848757", "0.64848495", "0.6478021", "0.64772964", "0.6471079", "0.6469467", "0.6469057", "0.646638", "0.64615834", "0.6460598", "0.6458667", "0.64583755", "0.64547765", "0.64538586", "0.64524144", "0.64494956", "0.6449159", "0.6449043", "0.6446361" ]
0.0
-1
Show the form for creating a new resource.
public function them() { return view('addkhachhang'); }
{ "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 them_database(Request $request) { $khachhang= new Khachhang; $khachhang->hoten=$request->txthoten; $khachhang->sdt=$request->txtsdt; $khachhang->diachi=$request->txtdiachi; $khachhang->sanpham=$request->txtsanpham; $khachhang->created_at= new Datetime(); $khachhang->save(); return redirect()->route('danhsach'); }
{ "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.72875285", "0.71454394", "0.71323526", "0.6639812", "0.6620611", "0.6568348", "0.6526527", "0.6509403", "0.64499927", "0.6375791", "0.63739914", "0.6365971", "0.6365971", "0.6365971", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667", "0.6342667" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show(Resena $resena)\n {\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function get_resource();", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "public function display() {\n echo $this->render();\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n {\n //\n $this->_show($id);\n }", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public abstract function display();", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "abstract public function resource($resource);", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8232636", "0.81890994", "0.68296117", "0.64987075", "0.649589", "0.64692974", "0.64633286", "0.63640857", "0.6307513", "0.6281809", "0.621944", "0.61926234", "0.61803305", "0.6173143", "0.61398774", "0.6119022", "0.61085826", "0.6106046", "0.60947937", "0.6078597", "0.6047151", "0.60409963", "0.6021287", "0.5989136", "0.5964405", "0.5962407", "0.59518087", "0.59309924", "0.5921466", "0.5908002", "0.5908002", "0.5908002", "0.59051657", "0.5894554", "0.5871459", "0.5870088", "0.586883", "0.5851384", "0.58168566", "0.58166975", "0.5815869", "0.58056176", "0.5799148", "0.5795126", "0.5791158", "0.57857597", "0.5783371", "0.5761351", "0.57592535", "0.57587147", "0.5746491", "0.57460666", "0.574066", "0.5739448", "0.5739448", "0.57295275", "0.57293373", "0.5729069", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57214445", "0.57149816", "0.5712036", "0.5710076", "0.57073003", "0.5707059", "0.5705454", "0.5705454", "0.5700382", "0.56997055", "0.5693362", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868" ]
0.0
-1
Show the form for editing the specified resource.
public function sua($id) { $data= Khachhang::find(1)->toArray(); return view('editkhachhang',['khachhang'=>$data]); }
{ "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($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(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($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($id)\n {\n return view('cataloguemodule::edit');\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit_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 \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function 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() \n\t{\n UserModel::authentication();\n\n //get the user's information \n $user = UserModel::user();\n\n\t\t$this->View->Render('user/edit', ['user' => $user]);\n }" ]
[ "0.78560406", "0.7695228", "0.72728705", "0.72414917", "0.71703714", "0.7064241", "0.70527977", "0.69833803", "0.69464153", "0.69454193", "0.694003", "0.69279605", "0.69024533", "0.6897402", "0.6897402", "0.68770015", "0.6862651", "0.68591106", "0.68564725", "0.6843339", "0.6834395", "0.6810238", "0.6805723", "0.6804495", "0.6801186", "0.6795105", "0.6791359", "0.6791359", "0.6786939", "0.6784608", "0.67788523", "0.6777179", "0.6767609", "0.676225", "0.67451584", "0.67451584", "0.6743699", "0.6743439", "0.67391723", "0.6734807", "0.67252284", "0.67122966", "0.6693062", "0.66917753", "0.66879624", "0.66876614", "0.6687631", "0.6684481", "0.6681963", "0.66689366", "0.6667962", "0.66648984", "0.66648984", "0.6662123", "0.6660378", "0.6658323", "0.6656464", "0.6654652", "0.6652069", "0.6641764", "0.6631318", "0.66304123", "0.66275823", "0.66275823", "0.66177845", "0.6617647", "0.66153026", "0.66149485", "0.6609338", "0.66080546", "0.66048896", "0.6595353", "0.6594271", "0.6593553", "0.6590015", "0.6589076", "0.6586446", "0.6579586", "0.6579553", "0.65792876", "0.6576532", "0.6576231", "0.65737045", "0.6568481", "0.6567548", "0.656672", "0.65654945", "0.6560779", "0.6560779", "0.6560434", "0.65577626", "0.6557244", "0.65557075", "0.6555567", "0.6555111", "0.6554289", "0.6553941", "0.65536594", "0.6547032", "0.65470016", "0.6544168" ]
0.0
-1
Update the specified resource in storage.
public function sua_database(Request $request, $id) { $khachhang= Khachhang::find($id); $khachhang->hoten=$request->txthoten; $khachhang->sdt=$request->txtsdt; $khachhang->diachi=$request->txtdiachi; $khachhang->sanpham=$request->txtsanpham; $khachhang->updated_at= new Datetime(); $khachhang->save(); return redirect()->route('danhsach'); }
{ "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 xoa($id) { $khachhang=Khachhang::find($id); $khachhang->delete(); return redirect()->route('danhsach'); }
{ "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
Display a listing of the resource.
public function index() { $products = $this->objProduct->all(); $users=$this->objUser->all(); return view('index',compact('products')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n {\n $this->booklist();\n }", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7447426", "0.73628515", "0.73007894", "0.7249563", "0.7164474", "0.7148467", "0.71320325", "0.7104678", "0.7103152", "0.7100512", "0.7048493", "0.6994995", "0.69899315", "0.6935843", "0.6899995", "0.68999326", "0.6892163", "0.6887924", "0.6867505", "0.6851258", "0.6831236", "0.68033123", "0.6797587", "0.6795274", "0.67868614", "0.67610204", "0.67426085", "0.67303514", "0.6727031", "0.67257243", "0.67257243", "0.67257243", "0.67195046", "0.67067856", "0.67063624", "0.67045796", "0.66655326", "0.666383", "0.66611767", "0.66604036", "0.66582054", "0.6654805", "0.6649084", "0.6620993", "0.66197145", "0.6616024", "0.66077465", "0.6602853", "0.6601494", "0.6593894", "0.65878326", "0.6586189", "0.6584675", "0.65813804", "0.65766823", "0.65754175", "0.657203", "0.657202", "0.65713936", "0.65642136", "0.6563951", "0.6553249", "0.6552584", "0.6546312", "0.6536654", "0.6534106", "0.6532539", "0.6527516", "0.6526785", "0.6526042", "0.65191233", "0.6518727", "0.6517732", "0.6517689", "0.65155584", "0.6507816", "0.65048593", "0.6503226", "0.6495243", "0.6492096", "0.6486592", "0.64862204", "0.6485348", "0.6483991", "0.64789015", "0.6478804", "0.64708763", "0.6470304", "0.64699143", "0.6467142", "0.646402", "0.6463102", "0.6460929", "0.6458856", "0.6454334", "0.6453653", "0.645357", "0.6450551", "0.64498454", "0.64480853", "0.64453584" ]
0.0
-1
Show the form for creating a new resource.
public function create() { $users=$this->objUser->all(); return view('cadastroProduto',compact('users')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n 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 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('libro.create');\n }", "public function create()\n {\n return view('libro.create');\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 {\n return view('saldo.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\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.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 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 newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create()\n {\n return view('student::students.student.create');\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}" ]
[ "0.7593278", "0.7593278", "0.75862813", "0.7577653", "0.7570922", "0.7499259", "0.743598", "0.7431475", "0.738692", "0.7351195", "0.7336038", "0.73110175", "0.7294184", "0.7280905", "0.7272454", "0.72410536", "0.7229507", "0.72239184", "0.7184587", "0.7177518", "0.7172079", "0.7148124", "0.7142547", "0.71422434", "0.713585", "0.712646", "0.7121425", "0.7113886", "0.7113886", "0.7113886", "0.71099454", "0.7091995", "0.70838404", "0.70796615", "0.70783395", "0.70560604", "0.70560604", "0.7053403", "0.7037733", "0.7037483", "0.7034196", "0.7032379", "0.7028811", "0.70255613", "0.7025196", "0.7018564", "0.7015596", "0.7003297", "0.7002209", "0.6999467", "0.6994898", "0.69925386", "0.69918746", "0.69880474", "0.6985266", "0.69648707", "0.69642234", "0.69544894", "0.6950107", "0.6949808", "0.6946825", "0.69433236", "0.6939847", "0.6938437", "0.6936151", "0.69359493", "0.69359493", "0.6932416", "0.69302046", "0.6927174", "0.69250137", "0.6922311", "0.6917047", "0.69137764", "0.6910701", "0.6909241", "0.6908554", "0.69062465", "0.69030714", "0.6900927", "0.689929", "0.6898352", "0.6893204", "0.68918675", "0.6891051", "0.68910086", "0.6889982", "0.6889982", "0.68871695", "0.6886071", "0.68850255", "0.6882077", "0.688044", "0.6879478", "0.6874531", "0.6871747", "0.6871178", "0.686907", "0.6868627", "0.6868156", "0.68674266" ]
0.0
-1
Store a newly created resource in storage.
public function store(ProductRequest $request) { $this->objProduct->create([ 'produto'=>$request->produto, 'preco'=>$request->preco, 'id_user'=>$request->id_user ]); }
{ "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) { $products = $this->objProduct->find($id); return view('cadastroProduto',compact('products')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show(Resena $resena)\n {\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function get_resource();", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "public function display() {\n echo $this->render();\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n {\n //\n $this->_show($id);\n }", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public abstract function display();", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "abstract public function resource($resource);", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8232636", "0.81890994", "0.68296117", "0.64987075", "0.649589", "0.64692974", "0.64633286", "0.63640857", "0.6307513", "0.6281809", "0.621944", "0.61926234", "0.61803305", "0.6173143", "0.61398774", "0.6119022", "0.61085826", "0.6106046", "0.60947937", "0.6078597", "0.6047151", "0.60409963", "0.6021287", "0.5989136", "0.5964405", "0.5962407", "0.59518087", "0.59309924", "0.5921466", "0.5908002", "0.5908002", "0.5908002", "0.59051657", "0.5894554", "0.5871459", "0.5870088", "0.586883", "0.5851384", "0.58168566", "0.58166975", "0.5815869", "0.58056176", "0.5799148", "0.5795126", "0.5791158", "0.57857597", "0.5783371", "0.5761351", "0.57592535", "0.57587147", "0.5746491", "0.57460666", "0.574066", "0.5739448", "0.5739448", "0.57295275", "0.57293373", "0.5729069", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57214445", "0.57149816", "0.5712036", "0.5710076", "0.57073003", "0.5707059", "0.5705454", "0.5705454", "0.5700382", "0.56997055", "0.5693362", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $products=$this->objProduct->find($id); $users=$this->objUser->all(); return view('cadastroProduto',compact('products','users')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit(form $form)\n {\n //\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.7854417", "0.7692986", "0.72741747", "0.72416574", "0.7173436", "0.706246", "0.70551765", "0.698488", "0.6948513", "0.694731", "0.69425464", "0.6929177", "0.6902573", "0.6899662", "0.6899662", "0.6878983", "0.6865711", "0.6861037", "0.6858774", "0.6847512", "0.6836162", "0.68129057", "0.68083996", "0.68082106", "0.6803853", "0.67966306", "0.6794222", "0.6794222", "0.6789979", "0.67861426", "0.678112", "0.677748", "0.67702436", "0.67625374", "0.6748088", "0.67475355", "0.67475355", "0.67446774", "0.6742005", "0.67374676", "0.6727497", "0.6714345", "0.6696231", "0.6693851", "0.6689907", "0.6689746", "0.6687102", "0.66870165", "0.6684574", "0.6670877", "0.66705006", "0.6667089", "0.6667089", "0.6663205", "0.66626745", "0.66603845", "0.66593564", "0.66560745", "0.66545844", "0.66447026", "0.6633528", "0.66319114", "0.66298395", "0.66298395", "0.6622365", "0.6621021", "0.66170275", "0.661664", "0.6612467", "0.66107714", "0.6608453", "0.65979743", "0.659645", "0.6596389", "0.6592672", "0.6591205", "0.6588125", "0.6582166", "0.6581656", "0.65811247", "0.65785724", "0.65782833", "0.6576397", "0.6570971", "0.6569483", "0.6568432", "0.656811", "0.6563493", "0.6563493", "0.65622604", "0.65602434", "0.65585065", "0.6557997", "0.65574414", "0.6556701", "0.65565753", "0.6556226", "0.6556107", "0.6549118", "0.65485924", "0.65463555" ]
0.0
-1
Update the specified resource in storage.
public function update(ProductRequest $request, $id) { $this->objProduct->where(['id'=>$id])->update([ 'produto'=>$request->produto, 'preco'=>$request->preco, 'id_user'=>$request->id_user ]); return redirect('products'); }
{ "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 update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "public function update($request, $id);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "abstract public function put($data);", "public function testUpdateSupplierUsingPUT()\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 update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(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, $input);", "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(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "public function 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 put($path, $data = null);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\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.7424714", "0.70635", "0.7058482", "0.68981785", "0.6581708", "0.6451537", "0.634705", "0.62108016", "0.61452574", "0.61245036", "0.6117", "0.61005783", "0.6088965", "0.6055291", "0.6020192", "0.60089755", "0.5974869", "0.594607", "0.5940399", "0.5940387", "0.5893692", "0.5861878", "0.58555347", "0.58555347", "0.58521295", "0.5816296", "0.580588", "0.5754183", "0.5754183", "0.573585", "0.57248604", "0.57152486", "0.5696124", "0.56926364", "0.5686974", "0.56704843", "0.5657175", "0.5652319", "0.56505626", "0.56371164", "0.5636333", "0.5634292", "0.5633077", "0.56302124", "0.56226414", "0.5608414", "0.56038505", "0.55932486", "0.55845344", "0.55840373", "0.5583145", "0.55769825", "0.5572918", "0.5568501", "0.55649704", "0.5564084", "0.5562276", "0.5562276", "0.5562276", "0.5562276", "0.5562276", "0.5560055", "0.5556887", "0.5555794", "0.5555651", "0.55555624", "0.55542725", "0.5545186", "0.5545042", "0.554096", "0.5540548", "0.5537395", "0.55360836", "0.55359083", "0.55250585", "0.55194676", "0.55176675", "0.5514794", "0.55101085", "0.5510089", "0.5507262", "0.5504258", "0.55022335", "0.5501283", "0.5500848", "0.5499872", "0.5497986", "0.5497986", "0.5495836", "0.54956913", "0.5494868", "0.5494812", "0.5493479", "0.5484617", "0.54805785", "0.54803264", "0.54791373", "0.546626", "0.54649556", "0.5463194", "0.54580057" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $del=$this->objProduct->destroy($id); return($del)?"sim":"não"; }
{ "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
Para hacer una conexion por un puerto especifico $serverName = "DESKTOP2POHOQ5\\JUAN, 1542"; /$serverName = "DESKTOP2POHOQ5\\JUAN"; $connectionInfo = array("Database" => "bahia", "UID" => "sa", "PWD"=>"Enterprice9"); $conn = sqlsrv_connect($serverName, $connectionInfo); CONEXION A SQL SERVER
function constructS() { if(isset($_SESSION['DB'])){ $conexionInfo = array("Database" => $_SESSION['DB'], "UID" => S_DB_USER, "PWD" => S_DB_PASS); }else { $conexionInfo = array("Database" => S_DB_NOMBRE, "UID" => S_DB_USER, "PWD" => S_DB_PASS); } $conn = sqlsrv_connect(S_DB_SERVER, $conexionInfo); if($conn){ return $conn; }else{ $result = ""; $result = "Conexion no establecida<br>"; $result .= die( print_r(sqlsrv_errors(), true)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function conectar()\n\t\t{\n\t\t\t//$connectionInfo = array(\"Database\"=>$this->db, \"UID\"=>$this->user, \"PWD\"=>$this->pass);\n\n\t\t\t$connectionInfo = array(\"Database\"=>$this->db);\n\t\t\t$this->conexion = sqlsrv_connect($this->server,$connectionInfo);\n\t\t\tif(!$this->conexion)\n\t\t\t{\n\t\t\t\techo \"Error al Conectar\";\n\t\t\t\tdie( print_r( sqlsrv_errors(), true));\n\t\t\t}\n\t\t}", "public function open_connection(){\n $srv=self::$db_host;\n $opc=array(\"Database\"=>$this->db_name, \"CharacterSet\"=>\"UTF-8\", \"UID\"=>self::$db_user, \"PWD\"=>self::$db_pass);\n $this->conn = sqlsrv_connect($srv,$opc) or die (print_r('Error al conectar con la Base de Datos SQLSRV !!! Favor de Informar a Sistemas!!!'));\n #(print_r(sqlsrv_errors(), true));\n }", "function connect(){\n $servername = \"LOBNA-PC\";\n // $username = \"username\";\n // $password = \"password\";\n \n try {\n\t\t\t//$con = new PDO(\"sqlsrvr:host=$servername;dbname=wages\" );\n\t\t\t$con = new PDO(\"sqlsrv:Server=$servername;Database=wages\");\n // set the PDO error mode to exception\n $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n //echo \"Connected successfully\"; \n }\n catch(PDOException $e)\n {\n echo \"Connection failed: \" . $e->getMessage();\n\t\t }\n\t\t\n\t\t// $serverName = \"DESKTOP-B9U461U\"; //serverName\\instanceName\n\n\t\t// // Since UID and PWD are not specified in the $connectionInfo array,\n\t\t// // The connection will be attempted using Windows Authentication.\n\t\t// $connectionInfo = array( \"Database\"=>\"wages\");\n\t\t// $con = sqlsrv_connect( $serverName, $connectionInfo);\n\t\t\n\t\t// if( $con ) {\n\t\t// \t echo \"Connection established.<br />\";\n\t\t// }else{\n\t\t// \t echo \"Connection could not be established.<br />\";\n\t\t// \t die( print_r( sqlsrv_errors(), true));\n\t\t// }\n\n //----------------------------------------------- \n // Perform operations with connection. \n //----------------------------------------------- \n \n /* Close the connection. */ \n // sqlsrv_close( $conn); \n\t\t// $dsn = 'sqlserver:host=DESKTOP-B9U461U;dbname=wages';//data source name\n\t\t// $user= '';\n\t\t// $pass='';\n\t\t// $options = array (\n\t\t// \t\tPDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',\n\t\t// \t\t//PDO::ATTR_PERSISTENT => true\n\t\t// \t);\n\n\t\t// try{\n\t\t// \t//new connection to db\n\t\t// \t\tstatic $con;\n\t\t// \t if ($con == NULL){ \n\t\t// \t $con = new PDO($dsn, $user, $pass, $options);\n\t\t// \t\t\t$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); \n\t\t// }\n\t\t// \t// $con = new PDO($dsn, $user, $pass, $options);\n\t\t// \t// $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); \n\t\t// \t//QUERY\n\t\t// \t// $q = \"INSERT INTO test(name,phone)VALUES('لبنى','محمد')\";\n\t\t// \t// $con->exec($q);\n\t\t// \t//echo \"success\";\n\t\t// \t//print_r($con) ;\n\n\t\t// }\n\t\t// catch(PDOexception $e){\n\t\t// \techo \"failed\" . $e->getMessage();\n // }\n // print_r($con);\n\t\treturn $con;\n\t}", "public function connect() {\r\n\t\t//$\t\tconn = new PDO(\"sqlsrv:server=$this->serverName; Database = $this->dbName\", $userName, $userPassword);\r\n\t\t//$\t\tconn->setAttribute(PDO::SQLSRV_ATTR_ENCODING, PDO::SQLSRV_ENCODING_UTF8);\r\n\t\t// \t\t$sql_Connect_str = \"sqlsrv:server=$this->serverName; Database = $this->dbName\";\r\n\t\t// \t\t$dbConnection = new PDO($sql_Connect_str, $this->userName, $this->userPassword);\r\n\t\t//$\t\tdbConnection->setAttribute(PDO::SQLSRV_ATTR_ENCODING, PDO::SQLSRV_ENCODING_UTF8);\r\n\t\t// \t\t$dbConnection->setAttribute(PDO::SQLSRV_ATTR_ENCODING, PDO::SQLSRV_ENCODING_UTF8);\r\n\t\t//r\t\teturn $dbConnection;\r\n\t\t\r\n\t\t$mssql = new PDO('dblib:host=RPT00024;dbname=eqcas', 'sa', 'dsc2007!@');\r\n\t\t//$\t\tmssql->setAttribute(PDO::SQLSRV_ATTR_ENCODING, PDO::SQLSRV_ENCODING_UTF8);\r\n\t\t$mssql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n\t\treturn $mssql;\r\n\t}", "public function conect_ssql(){\n\n $conn = mssql_connect($this->servidor, $this->usuario, $this->senha);\n if($conn == FALSE) die(\"Couldn't connect\");\n\n if(mssql_select_db($this->dbname, $conn))\n $result = \"Selected {$this->dbname} ok<br />\";\n else\n die('Failed to select DB');\n }", "function dbConnect($serverName, $connectionInfo){\n\n\t//$serverName = \"RaviKumarJangra\";\n\t//$connectionInfo = array(\"Database\"=>\"joe\");\t\n\t$connection = sqlsrv_connect($serverName, $connectionInfo);\n\tif (!$connection) {\n\t\t\tdie(print_r(sqlsrv_errors(), true));\n\t\t\t//return die(\"Unable to Connect to the Server\");\n\t} else {\n\t\t\treturn $connection;\n\t}\n}", "function connect()\n{\n //db connection\n $server = 'CMT-CIMS\\CIMS';\n $connectionInfo = array( \"Database\"=>\"CMT\", \"UID\"=>\"CIMSADMIN\", \"PWD\"=>\"Hook2015\");\n return sqlsrv_connect($server, $connectionInfo);\n}", "public function connect(){\n\t//boi the phai dua no vao mang $this->_connection = sqlsrv_connect($this->_hostname,array($this->_user,$this->_pass) or die ('Không thể kết nối đến CSDL');\n\t// thi no bao k ket noi CSDL duoc\n\t//con neu chi chay $this->_connection = sqlsrv_connect($this->_hostname) or die ('Không thể kết nối đến CSDL'); thi no vo duoc,nhung thang sqlsrv nay no k co cau lenh select database(sqlsrv_seleect_db) nhu cua thang mysql_select_db va mssql_select_db boi the o khuc duoi phai lam sao hien tai mac dinh dang de la sqlsrv_query($this->_connection,$this->_database);\n\t\t$this->_connection = sqlsrv_connect($this->_hostname,$this->_params) or die ('Không thể kết nối đến CSDL');\n\t\t//$smst = sqlsrv_query($this->_connection,$this->_database);\n\t\t//câu lệnh cũ \n\t\t//$this->_connection = mysql_connect(\"$this->_hostname\",\"$this->_user\",\"$this->_pass\") or die ('Không thể kết nối đến CSDL');\n\t\t//mysql_select_db($this->_database,$this->_connection);\n\t}", "function conectaDb()\n{\n try {\n $db = new PDO(\"sqlsrv:Server=INFORMATICA09\\SQL2008 ; Database = BDDESA \", \"sa\", \"guillermo\");\n $db->setAttribute(PDO::SQLSRV_ATTR_DIRECT_QUERY, true);\n return($db);\n } catch (PDOException $e) {\n \t\tprint \"<p><b>Error : </b> No puede conectarse con la base de datos.</p>\\n\";\n exit();\n }\n}", "function dbConections () {\r\n $conexion = null; \r\n \r\n // Se inicializa variable a nul\r\n $hostname = \"BRANDONANSWER\\SQLANSWER\"; \r\n \t// Nombre del Servidor SQL Server\\Instancia, puerto\r\n // $port = 1433; \r\n // no siempre lo usa\r\n $dbname = \"tutores_ut\"; \r\n \t // Nombre de la BD\r\n //$username = \"brand\"; \r\n \t // Usuario de la BD\r\n $pw = \"\"; \r\n try {\r\n $conexion = new PDO (\"sqlsrv:Server=\".$hostname.\";Database=\".$dbname.\";Encrypt=false\"); // Se ejecutan los parametros\r\n //$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n \t }\r\n \t \r\n \t \r\n catch(PDOException $e){\r\n $msgErrorSQL = \"<div style='display:table-cell; vertical-align:middle; text-align:center'>\";\r\n $msgErrorSQL .= \"<img src='images/DB-conexion-error.png'><br />\";\r\n $msgErrorSQL .= \"La Conexión SQL Server no se pudo establecer.<br />\";\r\n $msgErrorSQL .= \"Informe al Administrador del Sistema. <br />\";\r\n $msgErrorSQL .= \"Failed to get DB handle: \" . $e->getMessage() . \"\\n\";\r\n $msgErrorSQL .= \"</div></br>\";\r\n \techo $msgErrorSQL;\r\n exit; \r\n }\r\n return $conexion;\r\n \t}", "function getConn()\n{\n // Naam van server\n $hostname = 'host.docker.internal';\n // Naam van database\n $dbname = 'FLETNIX';\n // Hier je eigen gebruikersnaam\n $username = 'Groepje8';\n // Hier je eigen password.\n // Zet het wachtwoord in het echt nooit letterlijk in de broncode.\n $pw = 'helloworld';\n\n $dbh = new PDO(\n \"sqlsrv:Server=$hostname;Database=$dbname;ConnectionPooling=0\",\n $username,\n $pw\n );\n // Tijdens het ontwikkelen is het handig om meteen ook de foutmeldingen vanuit de database te kunnen lezen.\n $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n return $dbh;\n}", "function ms_conect_casa(){\n\t\t\t$ms_connection = mssql_connect(SERVER_CASA,USER_CASA,PASS_CASA);\n\t\t\t$ms_SelectedDB = mssql_select_db(DB_CASA);\n\t\t\treturn $ms_connection;\n\t\t}", "public function openConnection(){\n\n $this->conn = null;\n\n // for non PDO Connection:\n $serverName = \"tcp:\" . $this->host . \",\" . $this->port;\n $connectionOptions = array(\"Database\"=>$this->db_name,\"Uid\"=>$this->username, \"PWD\"=>$this->password);\n\n // for PDO Connection:\n// $serverName = \"tcp:$this->host,$this->port\";\n $serverName = \"tcp:$this->host,$this->port\";\n $connectionString = \"sqlsrv:server=$serverName; Database=$this->db_name\";\n\n try{\n// $this->conn = sqlsrv_connect($serverName, $connectionOptions);\n $this->conn = new PDO( $connectionString, $this->username, $this->password);\n\n if($this->conn == false){\n die(FormatErrors(sqlsrv_errors()));\n }\n }catch(Exception $exception){\n echo \"Connection error: \" . $exception->getMessage();\n }\n\n return $this->conn;\n }", "function createConnect()\r\n\t\t{\r\n\t\t$this->conn=mysql_pconnect($this->host,$this->user,$this->password);\r\n\t\tif(!is_resource($this->conn))\r\n\t\t\t{\r\n\t\t\t$this->errors=\"Could Not able to connect to the SQL Server.\";\r\n\t\t\t}\r\n\t\t$d = mysql_select_db($this->dbname, $this->conn);\r\n\t\tif(!is_resource($d))\r\n\t\t\t{\r\n\t\t\t$this->errors=\"Could Not able to Use database \".$this->dbname.\".\";\r\n\t\t\t}\r\n\t\t}", "function mssql_connect($servername = NULL, $username = NULL, $password = NULL, $new_link = false)\n{\n}", "function koneksi() {\n $conn = mysqli_connect(\"localhost\", \"root\", \"\");\n mysqli_select_db($conn, \"pw_tubes_203040051\");\n\n return $conn;\n }", "public function connect()\r\n\t{\r\n\t\t$this->conn = mssql_connect( $this->host, $this->user, $this->pwd );\r\n\t\tif( !$this->conn )\r\n\t\t\ttrigger_error( $this->lastError(), E_USER_ERROR );\r\n\t\t\r\n\t\tmssql_select_db( $this->dbname, $this->conn );\r\n\t\treturn $this->conn;\r\n\t}", "function mssqlnative_driver_ADOConnection()\n\t{\n\t\t$this->dbtype = 'mssqlnative';\n\t\t$this->dataProvider = 'mssqlnative';\n\t}", "private function connect()\n {\n //variable con el nombre del server\n $server = \"localhost\";\n //variable con el nombre de la base\n $database = \"candidatossv\";\n //variable con el usuario de la base\n $username = \"root\";\n //variable con la contra de la base\n $password = \"\";\n try {\n //realizando conexion\n @self::$connection = new PDO(\"mysql:host=$server; dbname=$database; charset=utf8\", $username, $password);\n } catch (PDOException $exception) {\n //mostrando el tipo de excepcion al realizar la conexion\n throw new Exception($exception->getCode());\n }\n }", "public function SqlServer_Insert($PostArray , $hostname , $username , $password , $dbname, $tablename)\r\n{\r\n //TODO Handle custom PORT\r\n $serverName = $hostname; //Ex: serverName\\instanceName or IP or hostname\r\n $connectionInfo = array( \"Database\"=>$dbname, \"UID\"=>$username, \"PWD\"=>$password);\r\n // TODO : Handle diffrement maping between the FORM items and the SQl Server Table Columns names\r\n // need to use the following ext in the PHP.ini ==>> extension=php_sqlsrv_7_ts_x64.dll\r\n $conn = sqlsrv_connect( $serverName, $connectionInfo);\r\n $keys = array_keys($PostArray); // Assume the form items names are the same the columns names in the SQL Server\r\n $values = array_values($PostArray); // Get the values which will be inesrted into the DB\r\n $Count = count($keys);\r\n $query3 = array_fill(0, $Count, '?'); //will be used to complete the SQL Query format\r\n $query3 = implode(\",\",$query3);\r\n \r\n $query1 = implode(\",\",$keys);\r\n \r\n $sqlquery = \"INSERT INTO \". $tablename . \" (\" . $query1 . \") VALUES (\" . $query3 .\")\";\r\n $params = $values;\r\n\r\n $stmt = sqlsrv_query( $conn, $sqlquery, $params);\r\n $errors = sqlsrv_errors();\r\n // TODO : Handle the ERROR\r\n sqlsrv_close( $conn );\r\n \r\n \r\n\r\n\r\n}", "function koneksi() \n{\n $conn = mysqli_connect(\"localhost\", \"pw20153_pw203040153\", \"gP[](Fkl--3L\");\n mysqli_select_db($conn, \"pw20153_tubes_203040153\");\n\n return $conn;\n}", "function connectsql(){\n\t$mysqlhost=\"localhost\";\n\t$mysqluser=\"pool_insert\";\n\t$mysqlpwd=\"poolinsert\";\n\t$mysqldb=\"knappe\";\n\t\t// --- Write Data to DB ---\n\t\t$connection=mysql_connect($mysqlhost, $mysqluser, $mysqlpwd) or syslog(LOG_WARNING,\"** Keine Verbindung zum Server! **\". mysql_error());\n\t\tmysql_select_db($mysqldb, $connection) or syslog(LOG_WARNING,\"** kein Select zur DB! ** **\". mysql_error());\n\t\n\t\t//mit mysql_close wird die Verbindung geschlossen\n}", "function connectsql(){\n\t$mysqlhost=\"localhost\";\n\t$mysqluser=\"pool_insert\";\n\t$mysqlpwd=\"poolinsert\";\n\t$mysqldb=\"knappe\";\n\t// --- Write Data to DB ---\n\t$connection=mysql_connect($mysqlhost, $mysqluser, $mysqlpwd) or syslog(LOG_WARNING,\"** Keine Verbindung zum Server! **\". mysql_error());\n\tmysql_select_db($mysqldb, $connection) or syslog(LOG_WARNING,\"** kein Select zur DB! ** **\". mysql_error());\n\t//mit mysql_close wird die Verbindung geschlossen\n}", "function db_conectar(){\n\t$servername = \"localhost\";\n\t\n\t$username = \"mianbr1718\";\n\t$password = \"mA29PIX8\";\n\t$dbname = \"mianbr1718\";\n\n\t// $servername = \"localhost\";\n\t// $username = \"root\";\n\t// $password = \"admin\";\n\t// $dbname = \"mianbr1718\";\n\n\n\t$conn = new mysqli($servername, $username, $password, $dbname);\n\t$conn->set_charset(\"utf8\");\n\n\tif ($conn->connect_error) {\n\t\tdie(\"Connection failed: \" . $conn->connect_error);\n\t}\n\treturn $conn;\n}", "public function __construct()\n {\n \t$connectionInfo = array(\"Database\" => DATABASE);\n if (defined('UID')) {\n \t$connectionInfo['UID'] = UID;\n \t$connectionInfo['PWD'] = PWD; \t\t\n \t}\n\n $this->_connectionHandle = sqlsrv_connect(SERVER, $connectionInfo);\n if ( $this->_connectionHandle ) { \t\n } else {\n $errorAsString = self::_getSQLSRVError();\n \tthrow ODataException::createInternalServerError($errorAsString);\n }\n\n $this->_northWindSQLSRVExpressionProvider = null;\n }", "final public function Selado ()\n {\n if(!self::$conn)\n {\n try\n {\n self::$conn = new PDO(\n $this->param['socket'].\n \":host=\".$this->param['endereco'].\n \";dbname=\".$this->param['bdados'].\n \";charset=\".$this->param['charset'].\n \";\",$this->param['usuario']\n ,$this->param['senha']);\n self::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n self::$conn->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);\n } catch (PDOException $e)\n {\n print \"***********<br/><h3>Servidor de dados não responde!. <br/><a href=''>tente novamente...</a></h3> \";\n die(\"****************************\");\n }\n }\n }", "function conexion()\n{\n /*$con= mysql_connect(\"localhost\",\"root\",\"\");\n mysql_select_db(\"bd_conal_\",$con);*/\n $con=mysql_connect(\"conaldb.db.12058720.hostedresource.com\",\"conaldb\",\"nC15@ags\");\n mysql_select_db(\"conaldb\",$con);\n date_default_timezone_set(\"Mexico/General\");\n mysql_set_charset('utf8');\n if (!$con) {\n die('No pudo conectarse: ' . mysql_error());\n }\n}", "function koneksi()\n{\n $conn = mysqli_connect(\"localhost\", \"root\", \"\");\n mysqli_select_db($conn, \"pw_tubes_203040020\");\n\n return $conn;\n}", "function koneksi(){\n\n\t$con=mysqli_connect(\"localhost\",\"root\",\"\");\n\tmysqli_select_db($con,\"osis\");\n\n\treturn $con ;\n}", "public function Conecta()\n\t{\n\t\t$this->conn = new PDO(\"mysql:host=\".$this->host.\";dbname=\".$this->database, $this->user, $this->password);\n\n\t}", "protected function connect() {\n try {\n $options = array(\n \\PDO::ATTR_PERSISTENT => TRUE,\n \\PDO::ATTR_ERRMODE => \\PDO::ERRMODE_EXCEPTION,\n \\PDO::ATTR_EMULATE_PREPARES => FALSE,\n \\PDO::MYSQL_ATTR_FOUND_ROWS => TRUE,\n \\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE'\n );\n\n $this->connection = new \\PDO(\"sqlsrv:Server={$this->server};Database={$this->db};charset=utf8\", $this->user, $this->password, $options);\n } catch (\\PDOException $e) {\n throw new AppException('Connection failed: ' . $e->getMessage());\n }\n \n return $this->connection;\n }", "function conexion($consulta){\r\n\t\t\t$servername = \"localhost\";\r\n\t\t\t$username = \"adminPlayas\";\r\n\t\t\t$password = \"cjwSA2F2mEpZZrBc\";\r\n\t\t\t$dbname = \"playasdb\";\r\n\t\t\t//Create connection\r\n\t\t\t$conn = new mysqli(\"localhost\", \"adminPlayas\", \"cjwSA2F2mEpZZrBc\", \"playasdb\");\r\n\t\t\t//Check connection\r\n\t\t\tif($conn->connect_error){\r\n\t\t\t\tdie(\"La conexión ha fallado: \" .$conn->connect_error);\r\n\t\t\t}\r\n\t\t\t//Cambiamos la codificación\t\t\r\n\t\t\tif(!$conn->set_charset(\"utf8\")){\r\n\t\t\t\tprintf(\"Error cargando el conjunto de caracteres utf8: %s\\n\");\r\n\t\t\t}else{\r\n\t\t\t}\r\n\t\t\t$resultado = mysqli_query($conn, $consulta);\r\n\t\t\treturn($resultado);\r\n\t\t}", "function connectToDatabase() {\n\n $host = self::servername;\n $databaseName = self::dbname;\n $password = self::password;\n $username = self::username;\n //To create the connection\n $conn = new mysqli($host, $username, $password, $databaseName);\n self::$conn = $conn;\n //Connection Checking, if there is a connection error, print the error\n if ($conn->connect_error) {\n exit(\"Failure\" . $conn->connect_error);\n }\n }", "function apriConnessione() {\n$this->connessione= mysqli_connect('62.149.150.212', 'Sql749552', '88ik7syf56', 'Sql749552_2');\n\nif (!$this->connessione) {\n\tdie('Errore durante la connessione al server MySQL' .mysqli_error($this->connessione));\n\t\n}\n\n}", "function koneksi()\n{\n $conn = mysqli_connect(\"localhost\", \"pw20141\", \"#Akun#203040141#\") or die(\"koneksi ke DB gagal\");\n mysqli_select_db($conn, \"pw20141_tubes_203040141\") or die(\"Database salah!\");\n\n return $conn;\n}", "public function connect(){\n\t\t$this->conn=mysqli_connect($this->host,$this->user,$this->pass); //menghubungkan ke localhost\n\t\tmysqli_select_db($this->conn,$this->database); //menghubungkan ke database\n\t\tif(!$this->conn){ //menghubungkan ke database\n\t\t\treturn die('Maaf, koneksi belum tersambung: '.mysqli_connect_error()); //Maaf,koneksi belum tersambung\n\t\t}\n\t}", "public function connToDB(){\n $this->conn=new mysqli(\"localhost\",\"root\",\"SQLroot\",\"Dispensary\");\n if(($this->conn)->connect_error){\n return 0;\n }\n }", "function conecta_alumno($nombrebase) {\n\n // --- Realizar la conexion\n @ $db = mysqli_pconnect($mihost,\"PequeLiante\",\"H@y59ONGs\"); \n\n if (!$db){\n echo mensaje_error('No se ha podido abrir la base de datos. Inténtelo más tarde',1);\n exit;\n }\n\n // --- Abrir la base de datos\n $mibase = mysqli_select_db($nombrebase);\n\n if (!$mibase){\n echo mensaje_error('No existe la base de datos donde se almacena la información. Inténtelo más tarde',1);\n exit;\n }\n }", "function connect_server()\n\t{\n\t\t// server : localhost\n\t\t// user name : root\n\t\t// password : mysql\n\t\t// database : inet_php45\n\t\t$link = mysqli_connect(\"localhost\", \"root\", \"mysql\", \"inet_php45\");\n\n\t\t// kiểm tra kết nối\n\t\tif (mysqli_connect_errno()) {\n\t\t\techo \"ket noi khong thanh cong\";\n\t\t\texit;\n\t\t}\n\n\t\treturn $link;\n\t}", "function PConnect($server_name, $user_name, $password, $database_name)\n {\n $this->connexion_ressource=mysql_pconnect($server_name, $user_name, $password);//connect\n mysql_select_db($database_name, $this->connexion_ressource);//select the db\n mysql_query ('set name utf8', $this->connexion_ressource) ;\n }", "public function conectar(){\n $this->conexion = mysqli_connect($this->hostname, $this->user, $this->password, $this->database);\n }", "function conexao()\n{\n\n\n\t$host = \"localhost\";\n\t$host = \"localhost\";\n\t$usuario = \"root\";\n\t$senha = \"\";\n\t$banco = \"helpp\";\n\n\t$conn = @mysqli_connect($host, $usuario, $senha, $banco) or die(\"Não foi possível conectar-se.\");\n\n\tmysqli_query($conn, \"SET NAMES 'utf8'\");\n\tmysqli_query($conn, \"SET character_set_connection=utf8\");\n\tmysqli_query($conn, \"SET character_set_client=utf8\");\n\tmysqli_query($conn, \"SET character_set_results=utf8\");\n\n\t// O 3308 é a porta que o MYSQL tá no meu pc (Lari), se der algum problema pode tirar e colocar o número da porta do teu pc \n\treturn $conn;\n}", "public function conectar() {\n $this->conexion=new mysqli($this->servidor, $this->usuario, $this->clave, $this->baseDatos);\n }", "function ConnecServ(){\n\t\t\t\n\t\t//mise en place du script de connexion\n\t\t\t$dsn=\"mysql:dbname=\".BASE.\";host=\".SERVEUR;\n\t\t\t\n\t\t//tentative de connexion à la base de données\n\t\t\ttry{\n\t\t\t\t$connexion=new PDO($dsn,USER,PASSWD);\n\t\t\t\t$connexion->exec(\"set names utf8\");\n\t\t\t}\n\t\t\t\n\t\t//affichage d'éventuelles erreurs\n\t\t\tcatch(PDOExecption $e){\n\t\t\t\tprintf(\"Echec de la connexion : %s\\n\", $e->getMessage());\n\t\t\t\texit();\n\t\t\t}\n\t\t\t\n\t\t//renvoi de la connexion\n\t\t\treturn $connexion;\n\t}", "function Conectar(){\n\n\n\t$servername = \"127.0.0.1\";\n\t$username = \"root\";\n\t$password = \"\";\n\t$dbname = \"normalizacion_beco_web\";\n\t\n\t\n\t// Create connection\n\t$conection = new mysqli($servername, $username, $password, $dbname);\n\t// Check connection\n\tif ($conection->connect_error) {\n\t\tdie(\"Connection failed: \" . $conection->connect_error);\n\t}else {\n\t\t//echo 'Connection OK '.$conection;\n\t}\n\treturn $conection;\n}", "public function koneksi(){\n\t\t\t$koneksi = mysql_connect($this->dbHost, $this->dbUser, $this->dbPass);\t\t// Menyambungkan ke server\n\t\t\t$database = mysql_select_db($this->dbName, $koneksi);\t// Memilih database\n\t\t}", "function koneksi()\n{\n $conn = mysqli_connect(\"localhost\", \"root\", \"\") or die(\"koneksi ke DB gagal\");\n mysqli_select_db($conn, \"tubes_193040181\") or die(\"Database salah!\");\n\n return $conn;\n}", "function setup_connect ()\n{\n$server = \"cs1.ucc.ie\";\n$database = \"2021_awf1\";\n$username = \"awf1\";\n$password = \"Shochel2\";\n$connection = mysqli_connect ($server, $username, $password, $database);\nif ($connection)\n return ($connection);\nreturn (FALSE);\n}", "function SQLConnect()\n\t{\n\t\t$host = \"107.22.222.166\";\n\t\t$username = \"ctecadmin\";\n\t\t$password = \"ctec227*user\";\n\t\t$db = \"Bid-well\";\n\n\t\t$dbc = mysqli_connect($host, $username, $password, $db) OR die(\"<p>Could not connect to Database.</p>\");\n\t\tmysqli_set_charset($dbc, 'utf8');\n\n\t\treturn $dbc;\n\t}", "function selectDB($db)\n\t{\n\n\t\tglobal $connections,$config;\n\n\t\tif (!isset($connections[$db]))\n\t\t\tdie('Core-Error: Invalid database in selectDB()');\n\n\t\tif ($connections[$db]===false)\n\t\t{\n\n\t\t\t$connections[$db]\t= @mssql_connect($config['db'][$db]['host'],$config['db'][$db]['user'],$config['db'][$db]['pass']);\n\n\t\t\tif ($connections[$db] === false)\n\t\t\t{\n\n\t\t\t\t$msg\t\t= mssql_get_last_message();\n\n\t\t\t\techo '<b>Core-Error</b>: Failed to connect to database!<br />';\n\n\t\t\t\tif (trim($msg)!='')\n\t\t\t\t\techo 'Error: '.htmlspecialchars($msg);\n\t\t\t\telse\n\t\t\t\t{\n\n\t\t\t\t\tif (trim(strtolower($config['db'][$db]['host'])) == '(local)')\n\t\t\t\t\t\t$config['db'][$db]['host']\t= 'localhost';\n\n\t\t\t\t\t// Lets see if we can establish a connection to the db-server\n\n\t\t\t\t\t$file = @fsockopen ($config['db'][$db]['host'], 80, $errno, $errstr, 10);\n\n\t\t\t\t\tif (!$file)\n\t\t\t\t\t\t$status = -1; // Site is down\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$status\t= 0;\n\t\t\t\t\t\tfclose($file);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($status == -1)\n\t\t\t\t\t\techo 'Error: #'.$errno.', '.htmlspecialchars($errstr).'';\n\t\t\t\t\telse\n\t\t\t\t\t\techo 'Error: Please check if MSSQL-service is running <b>and</b> reachable (firewall, etc.).';\n\n\t\t\t\t}\n\n\t\t\t\tif (DEBUG)\n\t\t\t\t{\n\t\t\t\t\techo '<br /><br />';\n\t\t\t\t\techo '<b>Connection-Details</b>:<br /><br />';\n\t\t\t\t\techo '<table width=\"400\">';\n\t\t\t\t\techo '<tr><td>Host:</td><td>'.htmlspecialchars($config['db'][$db]['host']).'</td></tr>';\n\t\t\t\t\techo '<tr><td>User:</td><td>'.htmlspecialchars($config['db'][$db]['user']).'</td></tr>';\n\t\t\t\t\techo '<tr><td>Password:</td><td>'.htmlspecialchars($config['db'][$db]['pass']).'</td></tr>';\n\t\t\t\t\techo '<tr><td>Database:</td><td>'.htmlspecialchars($config['db'][$db]['db']).'</td></tr>';\n\t\t\t\t\techo '</table>';\n\t\t\t\t}\n\n\t\t\t\tdie('');\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ($connections[$db]!==false)\n\t\t\tmssql_select_db($config['db'][$db]['db']);\n\n\t}", "function SetupServer(){\n\n $servername = \"localhost\";\n $username = \"cs411friends_cs411team34\";\n $password = \"MT@W[YBTvquf\";\n $dbname = \"cs411friends_PETFRIEND\";\n $conn = new mysqli($servername, $username, $password, $dbname);\n\n if($conn->connect_error){\n die(\"Connection failed: \" . $conn->connect_error);\n }\n\n return $conn;\n}", "function OpenCon() {\n $dbhost = \"\";\n $dbuser = \"\";\n $dbpass = \"\";\n if($_SERVER['SERVER_NAME'] == \"localhost\"){\n $dbhost = \"localhost\";\n $dbuser = \"root\";\n $dbpass = \"root\";\n }\n else{\n $dbhost = \"db.cs.dal.ca\";\n $dbuser = \"aio\";\n $dbpass = \"ge7ochooCae7\";\n }\n $db = \"aio\";\n $conn = new mysqli($dbhost, $dbuser, $dbpass, $db) or die(\"Connect failed: %s\\n\". $conn -> error);\n return $conn;\n }", "function databaseConn() {\n $servername = \"localhost\";\n $username = \"root\";\n $password = \"mysql\";\n $dbname = \"dynamische_applicatie\";\n $conn = null;\n\n try {\n $conn = new PDO(\"mysql:host=$servername;dbname=$dbname\", $username, $password);\n // set the PDO error mode to exception\n $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n // echo \"Connected successfully\";\n return $conn;\n }\n\n catch(PDOExeption $e) {\n echo \"Connection failed: \" . $e->getMessage();\n }\n }", "function koneksi_db() {\n $conn = mysqli_connect (\"localhost\", \"root\", \"\");\n mysqli_select_db ($conn, \"pw_tubes_203040093\");\n\n return $conn;\n }", "public function sellMSSQL($sql){\r\n //use mssql_XXX instead\r\n\r\n $tdsSever = Yii::app()->params['tds_SELL'];\r\n $tdsDB = Yii::app()->params['tds_dbname_BYDDATABASE'];\r\n $tdsUser = Yii::app()->params['tds_SELL_username'];\r\n $tdsPwd = Yii::app()->params['tds_SELL_password'];\r\n\r\n $mssql=mssql_connect($tdsSever, $tdsUser, $tdsPwd);\r\n if(empty($mssql)) {\r\n throw new Exception(\"cannot connet to sqlserver $tdsSever, $tdsUser \");\r\n }\r\n mssql_select_db($tdsDB ,$mssql);\r\n\r\n //query\r\n $result = mssql_query($sql);\r\n $datas = array();\r\n while($ret = mssql_fetch_assoc($result)){\r\n $datas[] = $ret;\r\n }\r\n //disconnect\r\n mssql_close($mssql);\r\n\r\n //convert to UTF-8\r\n foreach($datas as &$data){\r\n foreach($data as $key => $value){\r\n $data[$key] = iconv('GBK','UTF-8', $value);\r\n }\r\n }\r\n\r\n return $datas;\r\n }", "function conexion($srv,$usr,$cve,$bd)\n\t\t{\n\t\t\t$this->res_proced = array();\n\t\t\t$this->servidorbd = $srv;\n\t\t\t$this->usuario = $usr;\n\t\t\t$this->contrasena = $cve;\n\t\t\t$this->based = $bd;\n\t\t\t$this->numreg = -1; //no se a afectado nada\n\t\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\tif( !( $this->conn = @mysqli_connect($this->servidorbd,$this->usuario,$this->contrasena,$this->based) ) )\n\t\t\t\t\tthrow new Exception('Error al conectarse al servidor '.$srv.'.<br>');\n\t\t\t\t/*else\n\t\t\t\t\techo \"Conexion correcta...<br>\";*/\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\tdie ($e->getMessage().\" \".mysqli_connect_error() );\n\t\t\t}\n\t\t}", "function conectar(&$enlace){\r\n\t\t\t\t$enlace=mysqli_connect(\"localhost\",\"root\",\"\");\r\n\t\t\t\tif($enlace==false)\r\n\t\t\t\t\tdie (\"No puede establecer la conexión<br>\");\r\n else echo\"CONEXIÓN REALIZADA\". \"<BR>\";\r\n\t\t\t\t//Seleccionar la base de datos\r\n\t\t\t\t$seleccion=mysqli_select_db($enlace,\"universidad\");\r\n\t\t\t\tif($seleccion==false)\r\n\t\t\t\t\tdie (\"No se pudo seleccionar la base de datos<br>\");\r\n else echo\"BASE DE DATOS SELECCIONADA\". \"<BR><BR>\";\r\n\t\t\t}", "function Connect($Server,$Username,$Password,$DBname){\r\n global $con;\r\n $dsn = 'mysql:host='.$Server.';dbname='.$DBname;\r\n $option = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',);\r\n try{\r\n $con = new PDO($dsn, $Username, $Password, $option);\r\n $con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n }catch(PDOException $e){echo 'Failed To Connect: ' . $e->getMessage();}\r\n }", "private function conectarDB(){\n\t\t$dsn = 'mysql:dbname='.self::nombre_db.' ;host='.self::servidor;\n\t\ttry {\n\t\t\t#metodo abstracto para la conexion a la bd\n\t\t\t$this->_conn = new PDO($dsn, self::usuario_db, self::pwd_db);\n\t\t \t\n\t\t } catch (PDOException $e) {\n\t\t \techo \"Falló la conexión: \".$e->getMessage();\n\t\t } \n\t}", "public function closeConnection(){\n sqlsrv_close($this->conn);\n }", "public function conectar(){\n\t\t\t\n\t\t\t\n\t\t\t$host = \"localhost\";\n\t\t\t$user = \"root\";\n\t\t\t$password = \"\";\n\t\t\t$database = \"ssca\";\n\t\t\t\n\t\t\n\t\t\t$conexion = mysqli_connect($host, $user, $password);\n\t\t\tmysqli_select_db($conexion, $database);\n\t\t\treturn $conexion;\n\t\t}", "public function connect()\n {\n \n $servername = 'localhost';\n $username = 'root';\n $password = '';\n $database = 'vairavimo_kursai';\n \n //kazka cia keist reik nes ne taip turi but\n $conn = new mysqli($servername, $username, $password, $database);\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n // echo \"Connected successfully\"; <- neprintinam, nes kitaip išvedinėja į ekraną srr\n return $conn;\n }", "function fconectar(){\n\t\t$this->conexion = new mysqli($this->servidor, $this->usuario, $this->pwd, $this->bd);\n\t\tif ($this->conexion->connect_error) {\n \t\tdie('Error de Conexión (' . $mysqli->connect_errno . ') ' . $mysqli->connect_error);\n\t\t}\t\t\n\t}", "static public function conectar(){\n /* SE CREA UN OBJETO LLAMADO PDO */\n $link = new PDO(\"mysql:host=localhost;dbname=sefaureo2\",\n \"jaengine_sef219\",\n \"yD$4QM4LJ2s2\");\n\n /* LA FUNCION EXEC SIRVE PARA QUE ACEPTE LOS CARACTERES LATINOS */\n $link->exec(\"set names utf8\");\n \n return $link;\n\n }", "function comprobar1($c) { \n $mysqli = new PDO(\"sqlsrv:Server=CPX-VQY8CZBYLXC;Database=MuOnline\", \"sa\", \"Juampilomas99\"); \n \n $sql = \"SELECT * FROM MEMB_INFO WHERE memb___id = '$c'\";\n $result = $mysqli->query($sql);\n if ($result->fetchColumn() == 0){\n echo 'no';\n }else{\n echo 'yes';\n }\n }", "function _connect($host = \"\", $username = \"\", $password = \"\", $database = \"\", $persistent, $forcenew)\n\t{\n\t\tif (!function_exists('sqlsrv_connect')) return null;\n $connectionInfo = array(\"Database\"=>$database,'UID'=>$username,'PWD'=>$password);\n if ($this->debug) error_log(\"<hr>connecting... hostname: $argHostname params: \".var_export($connectionInfo,true));\n if(!($this->connectionID = sqlsrv_connect($host,$connectionInfo))) { \n if ($this->debug) error_log( \"<hr><b>errors</b>: \".print_r( sqlsrv_errors(), true));\n\t\t\tif ($fn = $this->raiseErrorFn) \n\t\t\t\t$fn($this->dbtype, 'CONNECT', $this->ErrorNo(), $this->ErrorMsg(), $this->host, $this->database, $this);\n return false;\n }\n\t\treturn true;\t\n\t}", "public static function connToDB()\n {\n\t if(!defined('DB_SERVER')) define('DB_SERVER', '127.0.0.1');\n\t if(!defined('DB_USERNAME')) define('DB_USERNAME', 'root');\n\t if(!defined('DB_PASSWORD')) define('DB_PASSWORD', 'root');\n\t if(!defined('DB_NAME')) define('DB_NAME', 'NAA');\n\n\t /* Attempt to connect to MySQL database */\n\t $link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD);\n\t /*if(!$link)\n\t {\n\t\t $server_error = 'Server error. Please try again sometime. CON';\n\t\t header( \"Location: /sitedown.php\" );\n\t\t exit ;\n\t }*/\n\n\t $select_db = mysqli_select_db($link,DB_NAME);\n\t /*if(!$select_db)\n\t {\n\t\t $server_error = 'Server error. Please try again sometime. DB';\n\t\t header( \"Location: /sitedown.php\" );\n\t\t exit ;\n\t }*/\n }", "function OpenCon()\r\n {\r\n \t//connection credentials to kyle's database\r\n \t$servername = \"98.207.235.91\";\r\n\t$username = \"chorechomper\";\r\n\t$password = \"chorechomper\";\r\n\t$database = \"chorechomper\";\r\n\r\n// Create connection\r\n\t$conn = mysqli_connect($servername, $username, $password,$database);\r\n\r\n// Check connection\r\n\tif (!$conn) {\r\n \t die(\"Connection failed: \" . mysqli_connect_error());\r\n\t}\r\n\techo \"Connected successfullyff\";\r\n\r\n \r\n \treturn $conn;\r\n }", "function connect_to_server()\n \t{\n \t\trequire(\"connection_credentials.php\");\n\t\t\t// Connecting to server\n\t \t\t$conn = new mysqli($servername, $username, $password, $dbname);\n\t \t\tif ($conn->connect_error) {\n\t \t\tdie(\"Connection failed: \" . $conn->connect_error);\n\t \t\t}\n\t \t\treturn $conn;\n \t}", "function OpenCon()\r\n {\r\n $servidor = \"localhost\";\r\n $usuario = \"root\";\r\n $password = \"\";\r\n $baseDatos = \"alfagada\";\r\n $conn = new mysqli($servidor,$usuario,$password,$baseDatos) or die(\"Connect failed:\" . $conn -> error);\r\n return $conn;\r\n\r\n }", "private function connect(){\n $servername = \"localhost\";\n $username = \"danne\";\n $password = \"danne123\";\n $dbname = \"museum\";\n $conn = mysqli_connect($servername, $username, $password, $dbname);\n mysqli_set_charset($conn,\"utf8\");\n\n if ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n }\n return $conn;\n }", "protected function connect() {\n if (!isset($this->connection)) {\n if (!extension_loaded('mssql')) {\n throw new Exception(t('You must configure the mssql extension in PHP.'));\n }\n\n if (isset($this->configuration['port'])) {\n $host = $this->configuration['servername'] . ':' . $this->configuration['port'];\n }\n else {\n $host = $this->configuration['servername'];\n }\n $this->connection = mssql_connect(\n $host,\n $this->configuration['username'],\n $this->configuration['password'],\n TRUE);\n if (isset($this->configuration['database'])) {\n return mssql_select_db($this->configuration['database'], $this->connection);\n }\n }\n }", "function Connection (){\r\n try\r\n {\r\n $dns = 'mysql:host=mysql-oyashiro.alwaysdata.net;dbname=oyashiro_inscription';\r\n $pdo = new PDO($dns, 'oyashiro', 'thepassword');\r\n $pdo->exec('SET CHARACTER SET utf8');\r\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n return $pdo;\r\n }\r\n catch (PDOException $e)\r\n {\r\n die('Erreur : '. $e->getMessage());\r\n }\r\n}", "public function conectar(){\r\n\t\t$this->conexion=mysqli_connect(\"localhost\",\"root\",\"\",\"digitalgamesBD\");\r\n\t\t//$this->conexion=mysqli_connect(\"52.40.90.253:3306\",\"usuario\",\"dg5\",\"digitalgamesbd\");\r\n\t\treturn $this->conexion;\r\n\t}", "public function connect()\n\t \t{\n\t \t$this->cnn = mysqli_connect($this->hostname,$this->username,$this->pass,$this->dbname);\n\n\n\t \t\tif(!$this->cnn)\n\t \t\t{\n\t \t\t\techo 'ket noi khong thanh cong';\n\t \t\t}\n\t \t\telse {\n\t \t\t\t\n\t \t\t}\n\n\t \t\t // echo '<script> alert(\"Connection success\");</script>';\n\t\t \t}", "function Conecta() {\r\n $conexao = mysqli_connect(\"mysql.hostinger.com.br\", \"u172114687_admin\", \"00Lavaauto\", \"u172114687_dados\");\r\n return $conexao;\r\n }", "public function open_connection() {\n\n $this->connection = mysqli_connect(\"sql7.freemysqlhosting.net\", \"sql7293366\", \"cgApy8fEvJ\") or die(\"Connection failed: \" . mysqli_connect_error());\n \n// $this->connection = mysqli_connect(Config::DB_HOST, Config::DB_USERNAME, Config::DB_PASSWORD) or die(\"Connection failed: \" . mysqli_connect_error());\n// var_dump($this->connection);\n //die :print message \n //mysqli_connect_error():returns the error description from the last connection error if there is no error return null\n// or die('Could not connect: ' . mysqli_error($this->connection));\n $this->select_database();\n }", "function conectarse()\n{\n$enlace =mysqli_connect(\"localhost\",\"Kim\", \"revick93\",\"dbweb\");//nombreservidor, usuario,contraseña,nombre base datos\nif (!$enlace)\n {\n\n\techo \"ERROR: No se pudo conectar a MYSQL\".PHP_EOL;\n\techo \"ERROR de depuracion\".mysqli_connect_error().PHP_EOL;\n\techo \"ERROR de depuracion\".mysqli_connect_error().PHP_EOL;\n\texit;\t\n\n }\n mysqli_close($enlace);\n}", "public static function conectar()\n {\n\n // $link->exec(\"set names utf8\");\n\n // // return $link;\n\n $link = new PDO(\"mysql:host=88.198.24.90;dbname=inventar_proyectofinal\", \"inventariosadsi\", \"SETQDnuHgv(_\");\n $link->exec(\"set names utf8\");\n return $link;\n\n $link->exec(\"set names utf8\");\n\n return $link;\n\n }", "public function setConnection(){\n try {\n $connection = new PDO(\"mysql:host=\".$this->serverName.\";dbname=\".$this->dbName,$this->userName,$this->password);\n $connection->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION);\n echo json_encode(\"Connected successfully to database!!!\");\n return $connection;\n } catch (PDOException $e) {\n echo json_encode(\"Connection failed: \".$e->getMessage());\n }\n }", "public function ProcedureConnection(){\n\n $conection = mysqli_connect($this->db_host, \n $this->db_user, \n $this->db_password, \n $this->db_name); \n \n if(mysqli_connect_error()){\n echo 'Se ha producido un error en la consulta';\n exit;\n }\n mysqli_set_charset($conection, $this->db_charset);\n return $conection;\n }", "public static function mostrarDevengos()\n {\n $q = \"SELECT * FROM rrhh_db.tipodevengo\";\n\n self::getConexion();\n\n $resultado = sqlsrv_query(self::$conexion, $q) or die(print_r(sqlsrv_errors(), true));\n\n return $resultado;\n }", "private function connect()\r\n {\r\n\r\n /**\r\n * A TENTATIVA DE CRIAR UM OBJETO COM A CONEXAO DO BANCO É FEITA\r\n */\r\n try {\r\n /**\r\n * SALVA NA VARIAVEL ESTATICA O OBJETO REFERENTE A CONEXÃO COM O BANCO.\r\n * AS VARIAVEIS QUE SAO USADAS PARA CONEXAO SÃO DA CLASSE PAI\r\n */\r\n self::$con = new PDO('mysql:host=' . $this->getHost() . ';dbname=' . $this->getDatabase() . '', $this->getUser(), $this->getPassword(), array(PDO::MYSQL_ATTR_INIT_COMMAND => \"SET NAMES 'utf8'\"));\r\n /**\r\n * DEFINE O TIPO DE MANIPULAÇÃO DE ERRO SERÁ USADO PELO PDO\r\n */\r\n self::$con->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\r\n /**\r\n * CAPTURA O ERRO, SE GERADO\r\n */\r\n } catch (\\PDOException $error) {\r\n /**\r\n * O ERRO É IMPRESSO NA TELA\r\n */\r\n echo $error->getMessage();\r\n }\r\n }", "function abrirConexion() {\n\n // remote\n\n \n $server = \"b1gtrg162sfxnptw1ej0-mysql.services.clever-cloud.com\";\n $username = \"ua3vfykjoh8vdshz\";\n $password = \"jPz18bzSnP2YAeEXTS8f\";\n $database = \"b1gtrg162sfxnptw1ej0\"; \n\n // local\n\n /*\n $server = \"localhost\";\n $username = \"root\";\n $password = \"\";\n $database = \"modelosin\"; */\n\n try {\n $connection = new PDO(\"mysql:host=$server;dbname=$database;\", $username, $password);\n $connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n return $connection;\n\n } catch (PDOException $e) {\n die(\"Connection failed: \" . $e->getMessage());\n }\n}", "function sql_select_db($db,&$dbh=NULL)\n {\n global $MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD, $MYSQL_DATABASE, $MYSQL_CONN, $MYSQL_HANDLER, $SQL_DBH;\n global $CONF;\n//echo '<hr />'.print_r($dbh,true).'<hr />';\n//exit;\n if ( !is_null($dbh) )\n {\n if ($dbh->exec(\"USE $db\") !== false)\n return 1;\n return 0;\n }\n\n try\n {\n $SQL_DBH = NULL;\n list($host,$port) = explode(\":\",$MYSQL_HOST);\n if (isset($port)) {\n $portnum = $port;\n $port = ';port='.trim($port);\n }\n else {\n $port = '';\n $portnum = '';\n }\n //$SQL_DBH = new PDO($MYSQL_HANDLER[1].':host='.trim($host).$port.';dbname='.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n //$SQL_DBH = sql_connect();\n switch ($MYSQL_HANDLER[1]) {\n case 'sybase':\n case 'dblib':\n if (is_numeric($portnum)) $port = ':'.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':host='.$host.$port.';dbname='.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n case 'mssql':\n if (is_numeric($portnum)) $port = ','.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':host='.$host.$port.';dbname='.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n case 'oci':\n if (is_numeric($portnum)) $port = ':'.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':dbname=//'.$host.$port.'/'.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n case 'odbc':\n if (is_numeric($portnum)) $port = ';PORT='.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':DRIVER={IBM DB2 ODBC DRIVER};HOSTNAME='.$host.$port.';DATABASE='.$db.';PROTOCOL=TCPIP;UID='.$MYSQL_USER.';PWD='.$MYSQL_PASSWORD);\n break;\n case 'pgsql':\n if (is_numeric($portnum)) $port = ';port='.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':host='.$host.$port.';dbname='.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n case 'sqlite':\n if (is_numeric($portnum)) $port = ':'.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':'.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n case 'sqlite2':\n trigger_error(\"Critical Error : sqlite2 driver is not suported. \", E_USER_ERROR);\n break;\n default:\n //mysql\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':host='.$host.$port.';dbname='.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n }\n return 1;\n }\n catch (PDOException $e)\n {\n if ($CONF['debug'])\n $msg = '<p>a3 Error!: ' . $e->getMessage() . '</p>';\n else\n {\n $msg = '<p>a3 Error!: ';\n $pattern = '/(Access denied for user|Unknown database)/i';\n if (preg_match($pattern, $e->getMessage(), $m))\n $msg .= $m[1];\n $msg .= '</p>';\n }\n startUpError($msg, 'Connect Error');\n return 0;\n }\n }", "function conectar(){\n $this->conexion_bd = pg_connect(\"host=190.109.100.36 port=5432 dbname=scdat user=postgres password=invepal1nv3p4l\") or die('No pudo conectarse: ' . pg_last_error());\n// $this->conexion_bd = pg_connect(\"host=localhost port=5432 dbname=scdat user=postgres password=l4v1rg3n\") or die('No pudo conectarse: ' . pg_last_error());\n return ($this->conexion_bd);\n }", "private function connect(){\n\t\t\t$this->conn = mysql_connect($this->host, $this->user, $this->pass) or die(\"dbGreska (conn)\"); \n\t\t\tmysql_select_db($this->db_name, $this->conn) or die(\"dbGreska (select)\");\n\t\t\tmysql_query(\"SET NAMES UTF8\");\n\t\t}", "private function conect(){\r\n\t\tglobal $HOST;\r\n\t\tglobal $BASEDEDATOS;\r\n\t\tglobal $USUARIO;\r\n\t\tglobal $PASS;\r\n\t\t$this->myconn = mysql_connect($HOST,$USUARIO,$PASS);\r\n\t\tif (! $this->myconn){\r\n\t\t\techo \"Error al intentar conectarse con el servidor MySQL\";\r\n\t\texit(); \r\n\t\t}\r\n\r\n\t\tif (! @mysql_select_db($BASEDEDATOS,$this->myconn)){\r\n\t\t\techo \"No se pudo conectar correctamente con la Base de datos\";\r\n\t\t\texit();\r\n\t\t}\r\n\t\r\n\t}", "function conectar(){\n\n\t\t$conec= pg_connect(\"host='\".HOST.\"' dbname=\".DBNAME.\" port=\".PORT.\" user=\".USER.\" password=\".PASSWORD) or die(\"ERROR EN LA CONEXION\".pg_last_error());\n\t\treturn $conec;\n\t}", "public function conectarBD() {\n $db_host=\"127.0.0.1\"; \n $db_port=\"3306\";\n $db_name=\"exempel\"; \n $db_user=\"root\"; \n $db_pass=\"\";\n \n $conn = mysqli_connect($db_host.':'.$db_port, $db_user, $db_pass) or die (\"Error conectando a la base de datos.\");\n mysqli_select_db($conn,$db_name) or die(\"Error seleccionando la base de datos.\");\n mysqli_set_charset($conn,\"utf8\");\n return $conn;\n }", "public function conectar()\n{\n// $host = 'localhost:c:\\Embebed21\\SOCIOS.FDB';\n$host='localhost:socioss';\n // $host = '192.168.10.201:base';\n $nombre_usuario='SYSDBA';\n $contrasenya='masterkey';\n $this->conexion = ibase_connect($host, $nombre_usuario, $contrasenya,'UTF-8') or die( ibase_errmsg() );\n}", "public function open()\n {\n $this->conexion= mysqli_connect(\"localhost:3306\",\"root\") or die (msql_error());\n mysqli_select_db($this->conexion, 'alsaplane') or die (msql_error());\n }", "function conexion(){\n $server = \"localhost\";\n $user = \"root\"; \n $pass = \"\";\n\n //$conexion = new mysqli($server, $user, $pass);\n try{\n $conexion = new PDO('mysql:host=localhost;dbname=tarea02', $user, $pass);\n // echo \"conexion exitosa\";\n } catch (PDOException $e) {\n print \"¡Error!: \" . $e->getMessage() . \"<br/>\";\n die();\n }\n}", "function PhpDbCommonFunction($sql, $successtext){\r\n\t\t$conn = new mysqli($servername, $username, $password, $dbname);\r\n\t\t// Check connection\r\n\t\tif ($conn->connect_error) {\r\n\t\t\tdie(\"Connection failed: \" . $conn->connect_error);\r\n\t\t} \r\n\r\n\t\tif ($conn->query($sql) === TRUE) {\r\n\t\t\techo $successtext;\r\n\t\t} else {\r\n\t\t\techo \"Error : \" . $conn->error;\r\n\t\t}\r\n\r\n\t\t$conn->close();\r\n\t}", "function conectar() \n\t {\n\t\t//conectarme con el servidor de base de datos\n\t\t$con=mysql_connect($this->Servidor,$this->Usuario,$this->Clave);\n\t\t// si hubo problemas al conectarme con el servidor de base de datos\n\t\tif (!$con)\n\t\t{\n\t\t\tdie(\"Error al conectarme con el Servidor de Base de Datos\");\n\t\t}\n\t\t//Seleccionar la base de datos\n\t\t$bd=mysql_select_db($this->BaseDatos,$con);\n\t\t//error al seleccionar la base de datos\n\t\tif (!$bd)\n\t\t{\n\t\t\tdie(\"Error al seleccionar la Base de Datos\");\n\t\t}\n\t\t//almaceno la conexion en la propiedad conect\n\t\t$this->conect=$con;\n\t\t//devuelvo la conexion desde donde fue invocada\n\t\treturn true;\t\n\t}", "function __construct() {\n\n $conection['server']=\"localhost\"; //host\n $conection['user']=\"dario\"; // usuario\n $conection['pass']=\"dario\"; //password\n $conection['base']=\"INNSADB\"; //base de datos\n\n $conect = oci_connect($conection['user'], $conection['pass'], $conection['server'],'AL32UTF8');\n //el parametro 'AL32UTF8' soluciona todo el tema de los acentos\n if (!$conect) {\n $m = oci_error();\n echo $m['message'], \"\\n\";\n exit;\n } else {\n //echo \"Conexión con éxito a Oracle!\";\n $this->con=$conect;\n }\n\n }", "private function dbConnection() {\r\n //if (!is_resource($this->connessione))\r\n // $this->connessione = mysql_connect($this->db_server,$this->db_username,$this->db_pass) or die(\"Error connectin to the DBMS: \" . mysql_error());\r\n if (!is_resource($this->connessione)) {\r\n try {\r\n $this->connessione = new PDO($this->db_type . \":dbname=\" . $this->db_name . \";host=\" . $this->db_server, $this->db_username, $this->db_pass);\r\n //echo \"PDO connection object created\";\r\n $this->setupSQLStatement();\r\n } catch (PDOException $e) {\r\n echo $e->getMessage();\r\n die();\r\n }\r\n }\r\n }", "function connectDB(){\n $servername = \"localhost\";\n $username \t= \"tdiw-r4\";\n $password \t= \"CENSORED\";\n $dbname \t= \"tdiw-r4\";\n\n\t\ttry {\n\t\t\t// Create connection\n\t\t\t$conn \t= new PDO('mysql:host='.$servername.';dbname='.$dbname.';charset=utf8mb4', $username, $password);\n\t\t} catch (PDOException $e) {\n\t\t\t//If connection failed\n\t\t\techo 'Connection failed: '.$e->getMessage();\n\t\t}\n\n return $conn;\n }", "function conexion(){\n $server = \"localhost\";\n $user = \"root\"; \n $pass = \"\";\n\n //$conexion = new mysqli($server, $user, $pass);\n try{\n $conexion = new PDO('mysql:host=localhost;dbname=tarea02', $user, $pass);\n echo \"conexion exitosa\";\n } catch (PDOException $e) {\n print \"¡Error!: \" . $e->getMessage() . \"<br/>\";\n die();\n }\n}", "function conbd()\r\n{\r\n \r\n //se pone localhost root y sin contraseña porque ahora estamos usando la base de datos local\r\n\t$con = mysqli_connect(\"localhost\",\"root\",\"\",\"escandallos\");\r\n //$con = mysql_connect(\"localhost\",\"escandal\",\"Xrb9lr3Z76\");\r\n\tif (!$con) die(\"No se puede conectar con el servidor\");\r\n //aqui se pone el nombre de la base de datos a la que queremos conectarnos\r\n\t//$base=mysql_select_db(\"escandallos\",$con);\r\n //$base=mysql_select_db(\"escandal_escandallos\",$con);\r\n\t//if (!$base) die(\"No se puede conectar con la BD\");\r\n\treturn $con;\r\n}" ]
[ "0.83419806", "0.8173895", "0.8071906", "0.77799493", "0.76406866", "0.76102835", "0.7571889", "0.7376545", "0.7323251", "0.72627705", "0.7139919", "0.69405943", "0.66892093", "0.63270986", "0.6322389", "0.6286791", "0.62668216", "0.61932063", "0.6142051", "0.61314124", "0.6106901", "0.6100597", "0.60779417", "0.6073704", "0.6064505", "0.6062204", "0.6026701", "0.6022886", "0.60094786", "0.6007595", "0.6001285", "0.6000597", "0.59363365", "0.5925559", "0.590742", "0.59054315", "0.58857924", "0.5881285", "0.587262", "0.58678186", "0.5862133", "0.5822094", "0.58117604", "0.58026314", "0.579951", "0.5798219", "0.57972383", "0.5796647", "0.5764315", "0.57626295", "0.5761339", "0.5755558", "0.5718617", "0.57169104", "0.5710004", "0.5707628", "0.570664", "0.5706563", "0.5705648", "0.5695441", "0.56855285", "0.5684184", "0.56754285", "0.56747395", "0.56739074", "0.5667084", "0.5665499", "0.56636566", "0.56587046", "0.5651832", "0.564428", "0.56433094", "0.5642666", "0.56392866", "0.56239027", "0.5623801", "0.56150645", "0.5608204", "0.5606816", "0.5604771", "0.56045395", "0.5601209", "0.55849624", "0.5583781", "0.55709195", "0.5570259", "0.55684924", "0.5564656", "0.556107", "0.5559597", "0.5554765", "0.55536014", "0.5552678", "0.5550316", "0.55484354", "0.55468345", "0.55308276", "0.5530364", "0.5528885", "0.5528395" ]
0.7323633
8
How would you find all nodes between all H2's? Using Kayessian XPath formula `$ns1[count(.|$ns2) = count($ns2)]` you can select all the nodes that belong both to the node sets $ns1 and $ns2.
public function testGetAllNodesBetweenSiblings(): void { $html = new ElementFinder(' <html> <h2>Title1</h2> <p>Text 1</p> <h2>Title2</h2> <p>Text 2</p> <h2>Title3</h2> <p>Text 3</p> <h2>Title4</h2> <p>Text 4</p> <h2>Title5</h2> </html> '); $ns1 = '//*/h2[1]/following-sibling::p'; $ns2 = '//*/h2[count(//h2)]/preceding-sibling::p'; $result = $html->value($ns1 . '[count(.|' . $ns2 . ') = count(' . $ns2 . ')]')->all(); self::assertCount(4, $result); self::assertEquals($result[0], 'Text 1'); self::assertEquals($result[3], 'Text 4'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_h2($file){\r\n $h1tags = preg_match_all(\"/(<h2.*>)(\\w.*)(<\\/h2>)/isxmU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "protected function getHeadingNodes()\n {\n $xpath = new DomXpath($this->doc);\n $query = '/html/body/*[self::h1 or self::h2 or self::h3 or self::h4 '\n . ' or self::h5 or self::h6]';\n return $xpath->query($query);\n }", "public function appendH2(mixed $content = null): H2;", "function icu_drush_nodes_match($node1, $node2, $fullComparison=FALSE) {\n\n if ($node1->nodeName === $node2->nodeName) {\n if ($node1->nodeType === $node2->nodeType) {\n if ($node1->nodeValue === $node2->nodeValue) {\n $len = strlen(trim((string) $node1->nodeValue));\n if ($len > 0) {\n if (!$fullComparison) { return TRUE; }\n\n $sameAttr = TRUE;\n if ($node1->hasAttributes() && $node2->hasAttributes()) {\n $attr1 = $attr2 = array( );\n if (count($node1->attributes) != count($node2->attributes)) { $sameAttr = FALSE; }\n if ($sameAttr) {\n foreach ($node1->attributes as $attr) { $attr1[] = $attr; }\n foreach ($node2->attributes as $attr) { $attr2[] = $attr; }\n for ($i=0; $i<count($attr1); $i++) {\n if ($attr1[$i]->name != $attr2[$i]->name) { $sameAttr = FALSE; }\n if ($attr1[$i]->value != $attr2[$i]->value) { $sameAttr = FALSE; }\n }\n }\n }\n\n if ($node1->parentNode === $node2->parentNode && $sameAttr) { return TRUE; }\n }\n }\n }\n }\n\n return FALSE;\n}", "public static function mergeNodes($items1, $items2) {\n $ret = array();\n $items = array_merge($items1, $items2);\n $len = count($items);\n \n for ($i = 0; $i < $len; $i++) {\n $item = $items[$i];\n if (!CSSHelper::isNodeInList($item, $items, $i + 1)) {\n array_push($ret, $item);\n }\n }\n return $ret;\n }", "public function countSiblings();", "public function countDescendants();", "public function getHeadingLinks($html) {\n $dom = new \\DOMDocument();\n\n // Load HTML but suppress warnings.\n $libxml_previous_state = libxml_use_internal_errors(TRUE);\n $dom->loadHTML($html);\n libxml_clear_errors();\n libxml_use_internal_errors($libxml_previous_state);\n\n $finder = new \\DomXPath($dom);\n $elements = $finder->query(\"//h2\");\n $links = [];\n foreach ($elements as $el) {\n if ($el->hasAttribute('id')) {\n $links[] = [\n 'title' => $el->textContent,\n 'url' => '#' . $el->getAttribute('id'),\n ];\n }\n }\n return $links;\n }", "public function sameNodeJoinCondition($selector1Name, $selector2Name, $selector2Path = null);", "function h2tag ( $arguments = \"\" ) {\n $arguments = func_get_args();\n $rc = new ReflectionClass('th2tag');\n return $rc->newInstanceArgs( $arguments ); \n}", "public function get_hypernyms ($tag){\n//Kennedy, Jack Kennedy, John Fitzgerald Kennedy, JFK, President Kennedy, President John F. Kennedy\n// INSTANCE OF=> President of the United States, United States President, President, Chief Executive\n// => head of state, chief of state\n// => representative\n// => negotiator, negotiant, treater\n// => communicator\n// => person, individual, someone, somebody, mortal, soul\n// => organism, being\n// => living thing, animate thing\n// => object, physical object\n// => physical entity\n// => entity\n// => causal agent, cause, causal agency\n// => physical entity\n// => entity\n//\n//Sense 2\n//Kennedy, Kennedy Interrnational, Kennedy International Airport\n// INSTANCE OF=> airport, airdrome, aerodrome, drome\n// => airfield, landing field, flying field, field\n// => facility, installation\n// => artifact, artefact\n// => whole, unit\n// => object, physical object\n// => physical entity\n// => entity';\n// $matches1 = array ();\n// preg_match_all (\"/\\s+(.+)\\s+=>/\",\n// $raw_synonims1, $matches1, PREG_PATTERN_ORDER);\n// var_dump($raw_synonims1);\n// var_dump($matches1);\n//\n// $raw_synonims1 = 'Sense 1\n//Kennedy, Jack Kennedy, John Fitzgerald Kennedy, JFK, President Kennedy, President John F. Kennedy\n// INSTANCE OF=> President of the United States, United States President, President, Chief Executive';\n// $matches1 = array ();\n// preg_match_all (\"/\\s+(.+)\\s+=>/\",\n// $raw_synonims1, $matches1, PREG_PATTERN_ORDER);\n// var_dump($raw_synonims1);\n// var_dump($matches1);\n// exit();\n ini_set(\"xdebug.var_display_max_children\", -1);\n ini_set(\"xdebug.var_display_max_data\", -1);\n ini_set(\"xdebug.var_display_max_depth\", -1);\n\n // cmd commend\n $wn_command = '\"C:/Program Files (x86)/WordNet/2.1/bin/wn\" \"'.$tag.'\" \"-hypen\"';\n $raw_synonims = shell_exec ($wn_command);\n\n // if the word exist\n if (! $raw_synonims) {\n return null;\n }\n\n // get the result of cmmend\n $matches = array ();\n preg_match_all (\"/\\s+(.+)\\s+.+?=>/\",\n $raw_synonims, $matches, PREG_PATTERN_ORDER);\n\n // if no matched result\n if(!isset($matches[1][0])){\n return null;\n }\n\n// dd($matches);\n // get all accepted words\n $expanded_query = array();\n\n foreach ($matches[1] as $match){\n $match = explode (\", \", $match);\n foreach ($match as $word){\n array_push($expanded_query, strtolower($word));\n }\n }\n\n // remove repeated element\n $expanded_query = array_unique($expanded_query);\n\n // return the word\n return $expanded_query;\n }", "protected function findLayerNodes() {\n\t\treturn $this->selectMany(array('sos:Contents', 'sos:ObservationOfferingList', 'sos:ObservationOffering'), null, false);\n\t}", "function getChildNodes() ;", "private function get_subexpression_regex_position_for_nodes($leafs1, $leafs2) {\n $this->regex_hint_result->problem_indfirst = $leafs1[0]->position->indfirst;\n\n $this->regex_hint_result->problem_indlast = $leafs2[count($leafs2)-1]->position->indlast;\n foreach($leafs1 as $leaf) {\n if ($leaf->position->indfirst < $this->regex_hint_result->problem_indfirst) {\n $this->regex_hint_result->problem_indfirst = $leaf->position->indfirst;\n }\n if ($leaf->position->indlast > $this->regex_hint_result->problem_indlast){\n $this->regex_hint_result->problem_indlast = $leaf->position->indlast;\n }\n }\n\n foreach($leafs2 as $leaf) {\n if ($leaf->position->indfirst < $this->regex_hint_result->problem_indfirst) {\n $this->regex_hint_result->problem_indfirst = $leaf->position->indfirst;\n }\n if ($leaf->position->indlast > $this->regex_hint_result->problem_indlast){\n $this->regex_hint_result->problem_indlast = $leaf->position->indlast;\n }\n }\n\n $this->compare_parent_nodes_of_leafs2($leafs1, $leafs2);\n $this->compare_parent_nodes_of_leafs1($leafs1, $leafs2);\n }", "public function getNewsFeedSubHeading2()\n {\n return $this->newsFeedSubHeading2;\n }", "function simplexml_merge (SimpleXMLElement &$xml1, SimpleXMLElement $xml2) {\n $dom1 = new DomDocument();\n $dom2 = new DomDocument();\n $dom1->loadXML($xml1->asXML());\n $dom2->loadXML($xml2->asXML());\n // pull all child elements of second XML\n $xpath = new domXPath($dom2);\n $xpathQuery = $xpath->query('/*/*');\n for ($i = 0; $i < $xpathQuery->length; $i++)\n {\n // and pump them into first one\n $dom1->documentElement->appendChild(\n $dom1->importNode($xpathQuery->item($i), true));\n }\n $xml1 = simplexml_import_dom($dom1);\n}", "public function getSubNodeNames();", "public function getChildNodes();", "function _quail_server_count_nodes($html) {\n\treturn substr_count($html, '<');\n}", "protected function fetchElementNodes()\n {\n $elements = [];\n\n foreach ($this->map as $query) {\n $list = $this->document->xpath($query);\n\n if (0 == count($list)) {\n continue;\n }\n\n foreach ($list as $node) {\n $elements[] = new HtmlNode($node, $this->document->getDocument());\n }\n }\n\n return $elements;\n }", "function getHeaderTags()\n {\n $filter = '(';\n for ($i = 1; $i <= 20; $i++) {\n $filter .= '//h' . $i . '|';\n }\n $filter = trim($filter, '|') . ')';\n \n $elements = $this->xpath->query($filter);\n $tags = [];\n foreach ($elements as $index => $element) {\n $level = filter_var($element->tagName, FILTER_SANITIZE_NUMBER_INT) - 1;\n $innerHtml = $this->DOMinnerHTML($element);\n \n $tags[$index]['header'] = $element->tagName;\n $tags[$index]['level'] = $level;\n $tags[$index]['name'] = trim(strip_tags($innerHtml));\n $tags[$index]['content'] = $innerHtml;\n $tags[$index]['toc'] = $this->getTOCFromTag($innerHtml);\n }\n return $tags;\n }", "function get_h6($file){\r\n $h1tags = preg_match_all(\"/(<h6.*>)(\\w.*)(<\\/h6>)/ismU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "public static function merge($one, $two) {\n\t\t$elements = $one->elements;\n\t\tforeach($two->elements as $node) {\n\t\t\t$exists = false;\n\t\t\tforeach($elements as $node2) {\n\t\t\t\tif ($node2->isSameNode($node))\n\t\t\t\t\t$exists = true;\n\t\t\t}\n\t\t\tif (! $exists)\n\t\t\t\t$elements[] = $node;\n\t\t}\n\t\treturn $elements;\n//\t\t$one = $one->newInstance();\n//\t\t$one->elements = $elements;\n//\t\treturn $one;\n\t}", "public function getChildNodes() {}", "public function getChildNodes() {}", "private function _parseHead($H) {\n $result = array(\n 'meta' => array(),\n 'title' => '',\n 'script' => array(),\n 'stylesheets' => array(),\n 'custom' => array()\n );\n\n $H->select('head > meta')->each(function($index, $el) use (&$result) {\n $node = $el->nodes[0];\n $result['meta'][] = $node->ownerDocument->saveXML($node);\n });\n\n $H->select('head > title')->each(function($index, $el) use (&$result) {\n $node = $el->nodes[0];\n $result['title'] = $node->textContent;\n });\n\n $H->select('head > script')->each(function($index, $el) use (&$result) {\n $node = $el->nodes[0];\n if ($node->hasAttribute('src')) {\n $result['script'][] = array(\n 'tag' => $node->ownerDocument->saveXML($node),\n 'type' => $node->hasAttribute('type') ? $node->getAttribute('type') : 'text/javascript',\n 'src' => $node->getAttribute('src')\n );\n } else {\n // http://stackoverflow.com/questions/6399924/getting-nodes-text-in-php-dom\n foreach ($node->childNodes as $child) {\n if ($child->nodeType == XML_TEXT_NODE) {\n $result['script'][] = array(\n 'tag' => $node->ownerDocument->saveXML($node),\n 'type' => $node->hasAttribute('type') ? $node->getAttribute('type') : 'text/javascript',\n 'body' => $child->textContent\n );\n break;\n }\n }\n }\n });\n\n $H->select('head > link')->each(function($index, $el) use (&$result) {\n $node = $el->nodes[0];\n if ($node->hasAttribute('rel') && $node->getAttribute('rel') == 'stylesheet' && $node->hasAttribute('href')) {\n $result['stylesheets'][] = array(\n 'tag' => $node->ownerDocument->saveXML($node),\n 'rel' => 'stylesheet',\n 'type' => 'text/css',\n 'href' => $node->getAttribute('href')\n );\n } else {\n // Some other tag so add it to the custom array\n $result['custom'][] = $node->ownerDocument->saveXML($node);\n }\n });\n\n // Notably, remove() doesn't seem to work, so do it this way instead\n $H->select('head > *')->each(function($index, $el) use (&$result) {\n $node = $el->nodes[0];\n if (!in_array($node->tagName, array('meta', 'title', 'script', 'link')))\n $result['custom'][] = $node->ownerDocument->saveXML($node);\n });\n\n // For some reason the ordering gets reversed in the above, so fix it for the ones that matter\n $result['script'] = array_reverse($result['script']);\n $result['stylesheets'] = array_reverse($result['stylesheets']);\n $result['custom'] = array_reverse($result['custom']);\n\n return $result;\n }", "public function getTagsDropDownResultsXpath() {\n\t\t$resultXpath = $this->tagsSuggestDropDown .\n\t\t\t\"//ul[@class='select2-results']\" .\n\t\t\t\"//span\";\n\t\treturn $resultXpath;\n\t}", "public function getNamespaceCount();", "function get_h1($file){\r\n $h1tags = preg_match_all(\"/(<h1.*>)(\\w.*)(<\\/h1>)/isxmU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "protected function compareNodes($node1, $node2)\n {\n if (!($node1 instanceof DOMNode) || !($node2 instanceof DOMNode)) {\n return false;\n }\n $attributes = $node1->attributes;\n if ($attributes->length == $node2->attributes->length) {\n for ($i = 0; $i < $attributes->length; $i ++) {\n $name = $attributes->item($i)->name;\n $value = $attributes->item($i)->value;\n if (!$node2->hasAttribute($name)\n || $node2->getAttribute($name) != $value\n ) {\n return false;\n }\n }\n } else {\n return false;\n }\n \n $children = $node1->childNodes;\n if ($children->length == $node2->childNodes->length) {\n for ($i = 0; $i < $children->length; $i ++) {\n $node = $children->item($i);\n $matches = $this->getChildrenByName($node2, $node->nodeName);\n $test = false;\n foreach ($matches as $match) {\n if ($this->compareNodes($node, $match)) {\n $test = true;\n break;\n }\n }\n if (!$test) {\n return false;\n }\n }\n } else {\n return false;\n }\n \n return true;\n }", "public function findNodes($query)\n {\n $query = preg_replace('#/p:#', '/' . $this->_namespace_prefix, $query);\n return $this->_xpath->query($query);\n }", "function lca($node1, $node2) {\n // traverse each node all the way up, until root node\n // root has no parent\n // memoryaddress of parent => child node\n // spl_object_hash(node) = id \n // id => parent\n // http://php.net/manual/en/function.spl-object-hash.php\n if (empty($node1) || empty($node2)) {\n return NULL;\n }\n $table = [];\n $trav1 = $node1;\n // construct hash table from 1st node\n while (!empty($trav1)) {\n $id = spl_object_hash($trav1);\n $table[$id] = 1; // id of A => NULL\n $trav1 = $trav1->parent;\n }\n // id A => null\n \n // $table = [hash(a) -> null]\n \n // lookup node2's parent in hash table\n $trav2 = $node2;\n while (!empty($trav2)) {\n $id = spl_object_hash($trav2); \n if (isset($table[$id])) { // will not run for B\n return $trav2;\n }\n $trav2 = $trav2->parent;\n }\n \n return NULL;\n}", "function get_h3($file){\r\n $h1tags = preg_match_all(\"/(<h3.*>)(\\w.*)(<\\/h3>)/ismU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "protected function processHeadingNodes()\n {\n $nodes = $this->getHeadingNodes();\n $this->setPageTitle($nodes);\n $this->addHeadings($nodes);\n $this->setHtmlFromDomDocument();\n }", "public function fetchCoach()\n {\n $url = $this->domain . $this->uri;\n $dom = HtmlDomParser::file_get_html($url);\n $this->coach = $dom;\n $content = $this->coach->find('div[class=item-page]', 0);\n $h2s = $content->find('h2');\n $groups = array();\n foreach ($h2s as $h2) {\n $arr = $this->parseCoachGroup($h2->next_sibling(), trim($h2->innertext));\n $groups = array_merge($groups, $arr);\n }\n\n return $groups;\n }", "public function countNextSiblings();", "function xpath_register_ns($xpath_context, $prefix, $uri)\n{\n}", "public function test_group_two_group_node_appears_groupid_filter() {\n\n $params = array(\n 'coursemoduleid' => $this->assign1->cmid,\n 'groupid' => 'nextnodefilter',\n );\n\n $nodes = block_ajax_marking_nodes_builder_base::unmarked_nodes($params);\n\n $this->assertNotEmpty($nodes, 'No nodes returned');\n\n $foundnode = new stdClass();\n $count = 0;\n foreach ($nodes as $node) {\n if ($node->groupid == $this->group2->id) {\n $count++;\n $foundnode = $node;\n break;\n }\n }\n\n $this->assertNotEquals(0, $count, 'No nodes returned for groupid '.$this->group2->id);\n $this->assertEquals(1, $count, 'Too many nodes found');\n $this->assertEquals(1, $foundnode->itemcount,\n 'User should be hidden here due to other goup membership');\n }", "public function countAncestors();", "public function getDescendants();", "public function getSegCountX2() {}", "public function testParseProcessNamespaceDeclarations(): void\n {\n $sch = $this->sut->parse($this->getXs('extension_0006.xsd'));\n \n self::assertElementNamespaceDeclarations(\n [\n 'xs' => 'http://www.w3.org/2001/XMLSchema', \n ], \n $sch\n );\n self::assertSchemaElementHasNoAttribute($sch);\n self::assertCount(1, $sch->getElements());\n \n $ct = $sch->getComplexTypeElements()[0];\n self::assertElementNamespaceDeclarations([], $ct);\n self::assertComplexTypeElementHasNoAttribute($ct);\n self::assertCount(1, $ct->getElements());\n \n $sc = $ct->getContentElement();\n self::assertElementNamespaceDeclarations([], $sc);\n self::assertSimpleContentElementHasNoAttribute($sc);\n self::assertCount(1, $sc->getElements());\n \n $ext = $sc->getDerivationElement();\n self::assertElementNamespaceDeclarations(\n [\n '' => 'http://example.org', \n 'foo' => 'http://example.org/foo', \n ], \n $ext\n );\n self::assertSimpleContentExtensionElementHasNoAttribute($ext);\n self::assertSame([], $ext->getElements());\n }", "public function testDescendantsWithMultiplePaths() {\n $this->savePage('Category:Grandparent', '');\n $this->savePage('Category:Parent 1', '[[Category:Grandparent]]');\n $this->savePage('Category:Parent 2', '[[Category:Grandparent]]');\n $this->savePage('Parent 1', '[[Category:Grandparent]]');\n $this->savePage('Child 1', '[[Category:Parent 1]]');\n $this->savePage('Child 2', '[[Category:Parent 1]]');\n $this->savePage('Child 3', '[[Category:Parent 2]]');\n $decendants = $this->traverser->descendants('Category:Grandparent');\n $this->assertCount(4, $decendants);\n }", "public function getNumberDescendants();", "function get_h5($file){\r\n $h1tags = preg_match_all(\"/(<h5.*>)(\\w.*)(<\\/h5>)/ismU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "public function getRelation2()\n {\n return $this->getEmbeddedResource('relation2');\n }", "function icu_drush_build_XPath_array($datastream) {\n $simpleXML = new SimpleXMLElement($datastream->content); // create a SimpleXMLElement object from the XML document\n $contextElements = $simpleXML->xpath('/mods:mods'); // select the root MODS node\n $contextElement = $contextElements[0]; // grab the first context node\n $xpathList = XMLElementToXPath($contextElement->getName(), $contextElement);\n\n return $xpathList;\n\n // foreach ($xpathList as $xpath) { echo $xpath . \"\\n\"; }\n}", "function html5_shortcode_demo_2($atts, $content = null) // Demo Heading H2 shortcode, allows for nesting within above element. Fully expandable.\n{\n return '<h2>' . $content . '</h2>';\n}", "public function subTitleTest( AcceptanceTester $I ) {\n\t\t$I->see( 'Subheading', Locator::combine( 'h2', 'h3' ) );\n\t}", "public function testPrependMultiple()\n {\n $element1 = new Element('element1');\n $element2 = new Element('element2');\n\n $dummy1 = new Element('dummy1');\n $dummy2 = new Element('dummy2');\n\n $child1 = new Element('child1');\n $child2 = new Element('child2');\n $childDeep = new Element('child_deep');\n\n $element1->insertAfter($dummy1);\n $element2->insertAfter($dummy2);\n $child2->insertAfter($childDeep);\n\n $parentDom = (new Dom($element1))->add($element2);\n $childDom = (new Dom($child1))->add($child2);\n\n $parentDom->prepend($childDom);\n\n $this->assertCount(2, $parentDom);\n $this->assertCount(3, $parentDom->eq(0)->children());\n $this->assertCount(3, $parentDom->eq(1)->children());\n\n $this->assertSame($child1, $parentDom->eq(0)->children()->get(0));\n $this->assertSame($child2, $parentDom->eq(0)->children()->get(1));\n $this->assertSame($dummy1, $parentDom->eq(0)->children()->get(2));\n $this->assertSame($childDeep, $parentDom->eq(0)->children()->eq(1)->children()->get(0));\n\n // the second element from the collection receives cloned copies\n $this->assertSame($dummy2, $parentDom->eq(1)->children()->get(2));\n $this->assertNotSame($child1, $parentDom->eq(1)->children()->get(0));\n $this->assertNotSame($child2, $parentDom->eq(1)->children()->get(1));\n $this->assertNotSame($childDeep, $parentDom->eq(1)->children()->eq(1)->children()->get(0));\n $this->assertSame((string) $child1, (string) $parentDom->eq(1)->children()->get(0));\n $this->assertSame((string) $child2, (string) $parentDom->eq(1)->children()->get(1));\n $this->assertSame((string) $childDeep, (string) $parentDom->eq(1)->children()->eq(1)->children()->get(0));\n }", "public function getExpr2()\n {\n return $this->expr2;\n }", "public function hasNextSiblings();", "public function search2passes($suffix1, $filter1, $attrs1, $suffix2, $filter2, $attrs2, $as_scalar = true) {\n\t\t$results_1 = $this->search($suffix1, $filter1, array($attrs1 => true), false);\n\t\t$sub_searches = $results_1[0][$attrs1];\n\t\t\n\t\tif(!count($sub_searches))\n\t\t\treturn array();\n\t\t\n\t\t$results = array();\n\t\tforeach(array_unique($sub_searches) as $sub_search) {\n\t\t\t$sub_search = str_replace(\n\t\t\t\tarray('\\\\', '(', '*', ')', '\\0'),\n\t\t\t\tarray('\\\\5C', '\\\\28', '\\\\2A', '\\\\29', '\\\\00'),\n\t\t\t\t$sub_search\n\t\t\t);\n\t\t\t$suffix = str_replace('[attrs1]', $sub_search, $suffix2);\n\t\t\t$filter = str_replace('[attrs1]', $sub_search, $filter2);\n\t\t\t\n\t\t\t$results = array_merge($results, $this->search($suffix, $filter, $attrs2, $as_scalar));\n\t\t}\n\t\t\n\t\treturn $results;\n\t}", "function get_all_child_by_inner_html($inner_html,$exactly=false)\n\t{\t\t\n\t\t$params = array( \"inner_number\" => $this->inner_number , \"inner_html\" => $inner_html , \"exactly\" => $exactly );\n\t\t$child_inner_number=-1;\n\t\tif ($this->inner_number!=-1)\n\t\t\t$child_inner_number=$this->call_get(__FUNCTION__,$params);\n\t\treturn new XHEInterfaces($child_inner_number,$this->server,$this->password);\n\t}", "function get_h4($file){\r\n $h1tags = preg_match_all(\"/(<h4.*>)(\\w.*)(<\\/h4>)/ismU\",$file,$patterns);\r\n $res = array();\r\n array_push($res,$patterns[2]);\r\n array_push($res,count($patterns[2]));\r\n return $res;\r\n}", "public function test_sort_nodes2() {\n $category = new \\phpunit_fixture_myprofile_category('category', 'title', null);\n\n // Create nodes.\n $node1 = new \\core_user\\output\\myprofile\\node('category', 'node1', 'nodetitle', null, null, 'content');\n $node2 = new \\core_user\\output\\myprofile\\node('category', 'node2', 'nodetitle', 'node1', null, 'content');\n $node3 = new \\core_user\\output\\myprofile\\node('category', 'node3', 'nodetitle', null);\n $node4 = new \\core_user\\output\\myprofile\\node('category', 'node4', 'nodetitle', 'node3');\n $node5 = new \\core_user\\output\\myprofile\\node('category', 'node5', 'nodetitle', 'node3');\n $node6 = new \\core_user\\output\\myprofile\\node('category', 'node6', 'nodetitle', 'node1', null, 'content');\n\n // Add the nodes in random order.\n $category->add_node($node3);\n $category->add_node($node2);\n $category->add_node($node4);\n $category->add_node($node1);\n $category->add_node($node5);\n $category->add_node($node6);\n\n // After node 1 we should have node2 - node6 - node3 - node4 - node5.\n $category->sort_nodes();\n $nodes = $category->nodes;\n $this->assertCount(6, $nodes);\n $node = array_shift($nodes);\n $this->assertEquals($node1, $node);\n $node = array_shift($nodes);\n $this->assertEquals($node2, $node);\n $node = array_shift($nodes);\n $this->assertEquals($node6, $node);\n $node = array_shift($nodes);\n $this->assertEquals($node3, $node);\n $node = array_shift($nodes);\n $this->assertEquals($node4, $node);\n $node = array_shift($nodes);\n $this->assertEquals($node5, $node);\n }", "public function testNestedMf1() {\n\t\t$input = '<div class=\"hentry\"> <div class=\"vcard\"><span class=\"fn\">Jane Doe</span> and <div class=\"vcard\"><span class=\"fn\">John Doe</span></div> </div> </div>';\n\t\t$parser = new Parser($input);\n\t\t$output = $parser->parse();\n\n\t\t$this->assertEmpty($output['items'][0]['properties']);\n\t\t$this->assertArrayHasKey('children', $output['items'][0]);\n\t\t$this->assertEquals('h-card', $output['items'][0]['children'][0]['type'][0]);\n\t\t$this->assertEquals('Jane Doe', $output['items'][0]['children'][0]['properties']['name'][0]);\n\t\t$child_mf = $output['items'][0]['children'][0];\n\t\t$this->assertArrayHasKey('children', $child_mf);\n\t\t$this->assertEquals('h-card', $child_mf['children'][0]['type'][0]);\n\t\t$this->assertEquals('John Doe', $child_mf['children'][0]['properties']['name'][0]);\n\t}", "public function findNodesRelativeTo($query, $context)\n {\n $query = preg_replace('#/p:#', '/' . $this->_namespace_prefix, $query);\n return $this->_xpath->query($query, $context);\n }", "public function getNamespaceDeclarations(): array\n {\n $decls = [];\n \n if ($this->isElementNode()) {\n // $node is an instance of \\DOMNameSpaceNode.\n foreach ($this->xpath->query('namespace::*', $this->currentNode) as $node) {\n if ($this->currentNode->hasAttribute($node->nodeName)) {\n $decls[$node->prefix] = $node->nodeValue; \n }\n }\n }\n \n return $decls;\n }", "public static function css2xpath($selector) {\r\n $selector_chunks = preg_split('/(?<!\\\\\\\\)\\s+/',$selector);\r\n $xpath_parts = array();\r\n foreach ($selector_chunks as $selector_chunk) {\r\n $selector_chunk = str_replace(',',' | //',$selector_chunk);\r\n # .class or #id (without tagname)\r\n $selector_chunk = preg_replace('/^([\\W])\\w/','*$0',$selector_chunk);\r\n # [name] or [name=value]\r\n $selector_chunk = preg_replace('/\\[(.+?(\\=.+?)?)\\]/','[@$1]',$selector_chunk);\r\n # .class\r\n $selector_chunk = preg_replace('/\\.([\\w-]+)/','[contains(concat(\" \",normalize-space(@class),\" \"),\" $1 \")]',$selector_chunk);\r\n # #id\r\n $selector_chunk = preg_replace('/^([\\w\\-]*)\\#([\\w\\-]+)/','$1[@id=\"$2\"]$3',$selector_chunk);\r\n # :eq(n)\r\n $selector_chunk = preg_replace_callback('/\\:eq\\((\\d+)\\)/',function($matches) { return \"[\".($matches[1]+1).\"]\"; },$selector_chunk);\r\n # :first\r\n $selector_chunk = preg_replace('/\\:first/','[1]',$selector_chunk);\r\n $selector_chunk = preg_replace('/\\:last/','[last()]',$selector_chunk);\r\n $selector_chunk = preg_replace_callback('/\\:gt\\((\\d+)\\)/',function($matches) { return \"[position()>\".($matches[1]+1).\"]\"; },$selector_chunk);\r\n $selector_chunk = preg_replace_callback('/\\:lt\\((\\d+)\\)/',function($matches) { return \"[position()<\".($matches[1]+1).\"]\"; },$selector_chunk);\r\n $selector_chunk = str_replace(\"\\\\ \",\" \",$selector_chunk);\r\n $selector_chunk = preg_replace('/\\:contains\\((.+)\\)/','[contains(.,$1)]',$selector_chunk);\r\n $xpath_parts[] = $selector_chunk;\r\n }\r\n\r\n $xpath = array(\"/\");\r\n foreach ($xpath_parts as $i=>$xpath_part) {\r\n if ($i>0) {\r\n if ($xpath_part==\">\") {\r\n continue;\r\n }\r\n if ($xpath_parts[$i-1]!=\">\") {\r\n $xpath_part = \"/$xpath_part\";\r\n }\r\n //echo $xpath_parts[$i-1].\" - \".$xpath_part.\"<br />\";\r\n }\r\n $xpath[] = $xpath_part;\r\n }\r\n $xpath = implode(\"/\",$xpath);\r\n //add_debug::var_dump($xpath);\r\n return $xpath;\r\n }", "function initialize () {\n $this->set_openingtag ( \"<H2[attributes]>\" );\n\t$this->set_closingtag ( \"</H2>\" );\n }", "public function setK2($var)\n {\n GPBUtil::checkUint32($var);\n $this->k2 = $var;\n\n return $this;\n }", "private function find(DOMXPath $xpath, string $selector, ?DOMNode $context = null): DOMNodeList\n {\n $query = $this->selector->toXPath($selector);\n\n return $xpath->query($query, $context);\n }", "public function iHoverTheElementAndThenTheSpecificElement($locator2, $locator1)\n {\n $session = $this->getSession(); // get the mink session\n $element = $session->getPage()->find('css', $locator2); // runs the actual query and returns the element\n\n if (null === $element) {\n throw new \\InvalidArgumentException(sprintf('Could not evaluate CSS selector: \"%s\"', $locator2));\n }\n\n $element = $element->find('css', $locator1);\n if (null === $element) {\n throw new \\InvalidArgumentException(sprintf('Could not evaluate CSS selector: \"%s\"', $locator1));\n }\n\n $element->mouseOver();\n }", "public function xpath(): Xpath {\n if (\n $this->_xpath instanceof Xpath &&\n $this->_xpath->document === $this\n ) {\n return $this->_xpath;\n }\n $this->_xpath = new Xpath($this);\n foreach ($this->_namespaces as $prefix => $namespaceURI) {\n $this->_xpath->registerNamespace($prefix, $namespaceURI);\n }\n return $this->_xpath;\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 }", "function getNamespacePrefix(String $var1, String $var2): String;", "public function testFindAllByAttributeName(): void\n {\n $tree = new Soup('\n <a id=\"first\">Matching a.</a>\n <a id=\"second\">\n Non-matching <b id=\"first\">Matching b.</b>a.\n </a>');\n $this->assertSelects([\"Matching a.\", \"Matching b.\"], $tree->findAll(id: 'first'));\n }", "function nodeDist($node1, $node2){\n $n1 = getNode($node1);\n $n2 = getNode($node2);\n return 3*distance($n1['lat'],$n1['lon'],$n2['lat'],$n2['lon']);\n}", "public function testMf2DoesNotParseRelTag() {\n\t\t$input = '<div class=\"h-entry\">\n<a rel=\"tag\" href=\"/tags/tests\">Tests</a>\n</div>\n\n<div class=\"h-review\">\n<a rel=\"tag\" href=\"/tags/reviews\">Reviews</a>\n</div>\n';\n\t\t$parser = new Parser($input);\n\t\t$output = $parser->parse();\n\n\t\t$this->assertArrayNotHasKey('category', $output['items'][0]['properties']);\n\t\t$this->assertArrayNotHasKey('category', $output['items'][1]['properties']);\n\t}", "public function testFindAllOnNonRootElement(): void\n {\n $this->assertSelects(['Nested tag.'], $this->byNameTree->div?->findAll('a'));\n }", "public function getEdge($v1, $v2);", "public function hasNextSibling();", "function ting_openformat_feeds_get_xpath($xml) {\n $dom = new DOMDocument();\n if (!@$dom->loadXML($xml)) {\n return NULL;\n }\n $xpath = new DOMXPath($dom);\n $xpath->registerNamespace('dkabm', 'http://biblstandard.dk/abm/namespace/dkabm/');\n $xpath->registerNamespace('dc', 'http://purl.org/dc/elements/1.1/');\n $xpath->registerNamespace('os', 'http://oss.dbc.dk/ns/opensearch');\n return $xpath;\n}", "abstract function getheadings();", "public function collectData(){\n\t\t// Simple HTML Dom is not accurate enough for the job\n\t\t$content = getContents($this->getURI())\n\t\t\tor returnServerError('No results for LWNprev');\n\n\t\tlibxml_use_internal_errors(true);\n\t\t$html = new DOMDocument();\n\t\t$html->loadHTML($content);\n\t\tlibxml_clear_errors();\n\n\t\t$cat1 = '';\n\t\t$cat2 = '';\n\n\t\tforeach($html->getElementsByTagName('a') as $a){\n\t\t\tif($a->textContent === 'Multi-page format'){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$realURI = self::URI . $a->getAttribute('href');\n\t\t$URICounter = 0;\n\n\t\t$edition = $html->getElementsByTagName('h1')->item(0)->textContent;\n\t\t$editionTimeStamp = strtotime(\n\t\t\tsubstr($edition, strpos($edition, 'for ') + strlen('for '))\n\t\t);\n\n\t\tforeach($html->getElementsByTagName('h2') as $h2){\n\t\t\tif($h2->getAttribute('class') !== 'SummaryHL'){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$item = array();\n\n\t\t\t$h2NextSibling = $h2->nextSibling;\n\t\t\t$this->jumpToNextTag($h2NextSibling);\n\n\t\t\tswitch($h2NextSibling->getAttribute('class')){\n\t\t\tcase 'FeatureByline':\n\t\t\t\t$item['author'] = $h2NextSibling->getElementsByTagName('b')->item(0)->textContent;\n\t\t\t\tbreak;\n\t\t\tcase 'GAByline':\n\t\t\t\t$text = $h2NextSibling->textContent;\n\t\t\t\t$item['author'] = substr($text, strpos($text, 'by '));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$item['author'] = 'LWN';\n\t\t\t\tbreak;\n\t\t\t};\n\n\t\t\t$h2FirstChild = $h2->firstChild;\n\t\t\t$this->jumpToNextTag($h2FirstChild);\n\t\t\tif($h2FirstChild->nodeName === 'a'){\n\t\t\t\t$item['uri'] = self::URI . $h2FirstChild->getAttribute('href');\n\t\t\t}else{\n\t\t\t\t$item['uri'] = $realURI . '#' . $URICounter;\n\t\t\t}\n\t\t\t$URICounter++;\n\n\t\t\t$item['timestamp'] = $editionTimeStamp + $URICounter;\n\n\t\t\t$h2PrevSibling = $h2->previousSibling;\n\t\t\t$this->jumpToPreviousTag($h2PrevSibling);\n\t\t\tswitch($h2PrevSibling->getAttribute('class')){\n\t\t\tcase 'Cat2HL':\n\t\t\t\t$cat2 = $h2PrevSibling->textContent;\n\t\t\t\t$h2PrevSibling = $h2PrevSibling->previousSibling;\n\t\t\t\t$this->jumpToPreviousTag($h2PrevSibling);\n\t\t\t\tif($h2PrevSibling->getAttribute('class') !== 'Cat1HL'){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$cat1 = $h2PrevSibling->textContent;\n\t\t\t\tbreak;\n\t\t\tcase 'Cat1HL':\n\t\t\t\t$cat1 = $h2PrevSibling->textContent;\n\t\t\t\t$cat2 = '';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$h2PrevSibling = null;\n\n\t\t\t$item['title'] = '';\n\t\t\tif(!empty($cat1)){\n\t\t\t\t$item['title'] .= '[' . $cat1 . ($cat2 ? '/' . $cat2 : '') . '] ';\n\t\t\t}\n\t\t\t$item['title'] .= $h2->textContent;\n\n\t\t\t$node = $h2;\n\t\t\t$content = '';\n\t\t\t$contentEnd = false;\n\t\t\twhile(!$contentEnd){\n\t\t\t\t$node = $node->nextSibling;\n\t\t\t\tif(!$node || (\n\t\t\t\t\t\t$node->nodeType !== XML_TEXT_NODE && (\n\t\t\t\t\t\t\t$node->nodeName === 'h2' || (\n\t\t\t\t\t\t\t\t!is_null($node->attributes) &&\n\t\t\t\t\t\t\t\t!is_null($class = $node->attributes->getNamedItem('class')) &&\n\t\t\t\t\t\t\t\tin_array($class->nodeValue, array('Cat1HL', 'Cat2HL'))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t){\n\t\t\t\t\t$contentEnd = true;\n\t\t\t\t}else{\n\t\t\t\t\t$content .= $node->C14N();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$item['content'] = $content;\n\t\t\t$this->items[] = $item;\n\t\t}\n\t}", "public function testChains2()\n {\n $grammar1 = $this->grammar->parse(\" S ::= A \\n A ::= 'a' 'b' \");\n $this->assertEquals(array(array(\"a\", \"b\")), $grammar1->parse(\"ab\"));\n }", "public function getSiblings($includeNode = false);", "public function getK2()\n {\n return $this->k2;\n }", "function pi_authoring_convert_heirarchy_form_elements(&$hierarchy_elements)\n{\n\t$rows = array();\n\tforeach (element_children($hierarchy_elements) as $region)\n\t{\n\t\t$rows[$region] = array();\n\t\tforeach (element_children($hierarchy_elements[$region]) as $key)\n\t\t{\n\t\t\t$rows[$region][$key] = array();\n\t\t\t$hierarchy_elements[$region][$key]['weight']['#attributes']['class'] = 'sort_list-weight sort_list-weight-'. $region;\n\t\t\t$hierarchy_elements[$region][$key]['region']['#attributes']['class'] = 'sort_list-region-select sort_list-region-'. $region;\n\n\t\t\t$rows[$region][$key]['title'] = drupal_render($hierarchy_elements[$region][$key]['title']);\n\t\t\t$rows[$region][$key]['description'] = drupal_render($hierarchy_elements[$region][$key]['description']);\n\t\t\t\n\t\t\t$rows[$region][$key]['region'] = drupal_render($hierarchy_elements[$region][$key]['region']);\n\t\t\t$rows[$region][$key]['weight'] = drupal_render($hierarchy_elements[$region][$key]['weight']);\n\t\t}\n\t}\n\treturn $rows;\n}", "protected function getTargetNodeList($html) {\n\t\t$doc = new DOMDocument;\n\t\t$doc -> loadHTML($html);\n\n\t\t$xpath = new DOMXPath($doc);\n\t\t//table[@class=\"data\"]/tr[@class=\"odd\"] | //table[@class=\"data\"]/tr[@class=\"even\"]\n\t\t$query = '//table[@class=\"data\"]/tr[@class=\"odd\"] | //table[@class=\"data\"]/tr[@class=\"even\"]';\n\t\t$result = $xpath -> query($query);\n\n\t\treturn $result;\n\t}", "private function queryNodesStory()\n {\n //node.nid is the primary key, so all entries are unique by nid\n $result = $this->link->query(\"SELECT `node`.`nid` AS `node.nid`,\n `node`.`vid` AS `node.vid`,\n `node`.`type` AS `node.type`,\n `node`.`language` AS `node.language`,\n `node`.`title` AS `node.title`,\n `node`.`uid` AS `node.uid`,\n `node`.`status` AS `node.status`,\n `node`.`created` AS `node.created`,\n `node`.`changed` AS `node.changed`,\n `node`.`comment` AS `node.comment`,\n `node`.`promote` AS `node.promote`,\n `node`.`moderate`,\n `node`.`sticky`,\n `node`.`tnid`,\n `node`.`translate`,\n `node_revisions`.`title` AS `revisions.title`,\n `node_revisions`.`body` AS `revisions.body`,\n `node_revisions`.`teaser` AS `revisions.teaser`,\n `node_revisions`.`log`,\n `node_revisions`.`timestamp`,\n `node_revisions`.`format` AS `revisions.format`,\n `users`.`name` AS `user.name`\n FROM `node`\n LEFT JOIN `node_revisions`\n ON `node`.`nid`=`node_revisions`.`nid`\n AND `node`.`vid`=`node_revisions`.`vid`\n LEFT JOIN `users`\n ON `node`.`uid`=`users`.`uid`\n WHERE `node`.`type`='story'\n ORDER BY `node`.`title` ASC\");\n\n //$cyot_nodes = array();\n while ($row = $result->fetch_assoc()) {\n\n // get all the terms\n $terms = $this->link->query(\"SELECT `term_node`.`nid`,\n `term_node`.`vid`,\n `term_node`.`tid`,\n `term_data`.`name`,\n `term_data`.`description`,\n `term_data`.`weight`\n FROM `term_node`\n LEFT JOIN `term_data`\n ON `term_node`.`tid`=`term_data`.`tid`\n WHERE `term_node`.`nid` = \" . $row['node.nid'] . \"\n ORDER BY `term_data`.`name` ASC\");\n $terms_a = array();\n while ($r_t = $terms->fetch_assoc()) {\n $terms_a[] = array(\n 'name' => $r_t['name'],\n 'description' => $r_t['description']\n );\n }\n\n $this->nodelist_story[] = new CNodeStory($row, $terms_a);\n }\n }", "function scorm_element_cmp($a, $b) {\n preg_match('/.*?(\\d+)\\./', $a, $matches);\n $left = intval($matches[1]);\n preg_match('/.?(\\d+)\\./', $b, $matches);\n $right = intval($matches[1]);\n if ($left < $right) {\n return -1; // smaller\n } elseif ($left > $right) {\n return 1; // bigger\n } else {\n // look for a second level qualifier eg cmi.interactions_0.correct_responses_0.pattern\n if (preg_match('/.*?(\\d+)\\.(.*?)\\.(\\d+)\\./', $a, $matches)) {\n $leftterm = intval($matches[2]);\n $left = intval($matches[3]);\n if (preg_match('/.*?(\\d+)\\.(.*?)\\.(\\d+)\\./', $b, $matches)) {\n $rightterm = intval($matches[2]);\n $right = intval($matches[3]);\n if ($leftterm < $rightterm) {\n return -1; // smaller\n } elseif ($leftterm > $rightterm) {\n return 1; // bigger\n } else {\n if ($left < $right) {\n return -1; // smaller\n } elseif ($left > $right) {\n return 1; // bigger\n }\n }\n }\n }\n // fall back for no second level matches or second level matches are equal\n return 0; // equal to\n }\n}", "protected function generateSecondTable($elements)\n {\n $htmlContent = \"\";\n\n foreach ($elements as $name => $element) {\n $title = $this->reportGenerator->getTitleElement($name);\n $lines = \"\";\n foreach ($element as $scope => $entries) {\n foreach ($entries as $entry) {\n $lines .= $this->reportGenerator->getLine($entry['module'], $scope, $entry['instance']);\n $htmlContent .= $title . $this->reportGenerator->getBlock(\n 'Module', 'Scope', 'Instance', $lines);\n }\n }\n }\n\n return $htmlContent;\n }", "public function getChildElements() {}", "protected function nodesEqual($node1, $node2){\n\t\tif($node1->nodeName != $node2->nodeName) return false;\n\t\t$hash1 = $this->nodeAttrToHash($node1);\n\t\t$hash2 = $this->nodeAttrToHash($node2);\n\t\tforeach($hash1 as $name=>$value){\n\t\t\tif(!isSet($hash2[$name]) || $hash2[$name] != $value) return false;\n\t\t}\n\t\treturn true;\n\t}", "public function descendantNode($selectorName, $path);", "public function setNewsFeedSubHeading2($newsFeedSubHeading2)\n {\n $this->newsFeedSubHeading2 = $newsFeedSubHeading2;\n }", "public function assertXpathCount($path, $count, $message = '') {\r\n\t\t$this->_incrementAssertionCount();\r\n\t\trequire_once 'Zend/Test/PHPUnit/Constraint/DomQuery.php';\r\n\t\t$constraint = new Zend_Test_PHPUnit_Constraint_DomQuery($path);\r\n\t\t$constraint->registerXpathNamespaces($this->_xpathNamespaces);\r\n\t\t$content = $this->_response->outputBody();\r\n\t\tif (!$constraint->evaluate($content, __FUNCTION__, $count)) {\r\n\t\t\t$constraint->fail($path, $message);\r\n\t\t}\r\n\t}", "public function getNamespace() {\n $namespaces = $this\n ->getTree()\n ->getRootNode()\n ->selectDescendantsOfType('n_NAMESPACE')\n ->getRawNodes();\n\n foreach (array_reverse($namespaces) as $namespace) {\n if ($namespace->isAfter($this)) {\n continue;\n }\n\n $body = $namespace->getChildByIndex(1);\n if ($body->getTypeName() != 'n_EMPTY') {\n if (!$body->containsDescendant($this)) {\n continue;\n }\n }\n\n return $namespace->getNamespaceName();\n }\n\n return null;\n }", "function test1(){\n // format: $ns, $page, $output\n $tests = array();\n\n // relative current in root\n $tests[] = array('','page','page');\n $tests[] = array('','.page','page');\n $tests[] = array('','.:page','page');\n\n // relative current in namespace\n $tests[] = array('lev1:lev2','page','lev1:lev2:page');\n $tests[] = array('lev1:lev2','.page','lev1:lev2:page');\n $tests[] = array('lev1:lev2','.:page','lev1:lev2:page');\n\n // relative upper in root\n $tests[] = array('','..page','page');\n $tests[] = array('','..:page','page');\n\n // relative upper in namespace\n $tests[] = array('lev1:lev2','..page','lev1:page');\n $tests[] = array('lev1:lev2','..:page','lev1:page');\n $tests[] = array('lev1:lev2','..:..:page','page');\n $tests[] = array('lev1:lev2','..:..:..:page','page');\n\n // strange and broken ones\n $tests[] = array('lev1:lev2','....:....:page','lev1:lev2:page');\n $tests[] = array('lev1:lev2','..:..:lev3:page','lev3:page');\n $tests[] = array('lev1:lev2','..:..:lev3:..:page','page');\n $tests[] = array('lev1:lev2','..:..:lev3:..:page:....:...','page');\n\n foreach($tests as $test){\n $this->assertEquals(resolve_id($test[0],$test[1]),$test[2]);\n }\n }", "public function countChildren();", "private function getXmlB2($sheetData, $dphElement)\n {\n $sumZaklDane = 0;\n $sumZaklDaneSnizena = 0;\n \n foreach ($sheetData as $rowId => $row) {\n if ($row['vat_type'] == NULL) { continue; }\n\n array_key_exists('zakl_dane1', $row) ? $sumZaklDane += str_replace(',', '', $row['zakl_dane1']): '';\n array_key_exists('zakl_dane2', $row) ? $sumZaklDaneSnizena += str_replace(',', '', $row['zakl_dane2']): '';\n array_key_exists('zakl_dane3', $row) ? $sumZaklDaneSnizena += str_replace(',', '', $row['zakl_dane3']) : '';\n \n $element = $this->createElementB2($rowId, $row);\n $element ? $dphElement->appendChild($element) : '';\n }\n \n $this->totals['b2_zakl_dane1'] = $sumZaklDane;\n $this->totals['b2_zakl_dane_snizena'] = $sumZaklDaneSnizena;\n }", "protected function getXPath()\n {\n $xpath = parent::getXPath();\n $xpath->registerNamespace('m', OData::META);\n $xpath->registerNamespace('d', OData::DATA);\n\n return $xpath;\n }", "public function siblings ($selector = null) { \r\n\t\t\r\n\t\t$list = new XDTNodeList();\r\n\t\t\r\n\t\tforeach ($this as $node) {\r\n\t\t\t\r\n\t\t\t$node = $this->initListObject($node);\r\n\t\t\t$list->merge($node->parent()->children());\r\n\t\t}\r\n\t\t\r\n\t\tif (!isset($selector)) return $list;\r\n\t\t\r\n\t\treturn $list->filter($selector);\r\n\t}", "abstract protected function get_root_element();", "private function createRootElement(): \\DOMElement {\n $attribute = [\n 'office:version' => '1.2',\n 'xmlns:office' => 'urn:oasis:names:tc:opendocument:xmlns:office:1.0',\n 'xmlns:style' => 'urn:oasis:names:tc:opendocument:xmlns:style:1.0',\n 'xmlns:text' => 'urn:oasis:names:tc:opendocument:xmlns:text:1.0',\n 'xmlns:table' => 'urn:oasis:names:tc:opendocument:xmlns:table:1.0',\n 'xmlns:draw' => 'urn:oasis:names:tc:opendocument:xmlns:drawing:1.0',\n 'xmlns:fo' => 'urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0',\n 'xmlns:xlink' => 'http://www.w3.org/1999/xlink',\n 'xmlns:dc' => 'http://purl.org/dc/elements/1.1/',\n 'xmlns:meta' => 'urn:oasis:names:tc:opendocument:xmlns:meta:1.0',\n 'xmlns:number' => 'urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0',\n 'xmlns:svg' => 'urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0',\n 'xmlns:chart' => 'urn:oasis:names:tc:opendocument:xmlns:chart:1.0',\n 'xmlns:dr3d' => 'urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0',\n 'xmlns:math' => 'http://www.w3.org/1998/Math/MathML',\n 'xmlns:form' => 'urn:oasis:names:tc:opendocument:xmlns:form:1.0',\n 'xmlns:script' => 'urn:oasis:names:tc:opendocument:xmlns:script:1.0',\n 'xmlns:ooo' => 'http://openoffice.org/2004/office',\n 'xmlns:ooow' => 'http://openoffice.org/2004/writer',\n 'xmlns:oooc' => 'http://openoffice.org/2004/calc',\n 'xmlns:dom' => 'http://www.w3.org/2001/xml-events',\n 'xmlns:rpt' => 'http://openoffice.org/2005/report',\n 'xmlns:of' => 'urn:oasis:names:tc:opendocument:xmlns:of:1.2',\n 'xmlns:xhtml' => 'http://www.w3.org/1999/xhtml',\n 'xmlns:grddl' => 'http://www.w3.org/2003/g/data-view#',\n 'xmlns:tableooo' => 'http://openoffice.org/2009/table',\n 'xmlns:css3t' => 'http://www.w3.org/TR/css3-text/',\n 'xmlns:xforms' => 'http://www.w3.org/2002/xforms',\n 'xmlns:xsd' => 'http://www.w3.org/2001/XMLSchema',\n 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',\n 'xmlns:field' => 'urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0',\n 'xmlns:formx' => 'urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0'];\n\n $rootElement = $this->createNewElement('office:document-content', $attribute);\n $bodyElement = $this->createNewElement('office:body', $attribute);\n $textElement = $this->createNewElement('office:text');\n\n $this->getDocument()->appendChild($rootElement);\n $rootElement->appendChild($bodyElement);\n $bodyElement->appendChild($textElement);\n\n return $textElement;\n }", "function selectorToXPath($selector) {\r\n\t\t// a:link:link\r\n\t\t// a:visited\r\n\t\t// a:link:hover\r\n\t\t// a:active\r\n\t\t// a:visited:hover\r\n\t\t// They are put into the style attribute.\r\n\t\t$namespace = ReTidy::get_html_namespace();\r\n\t\t$selector = \" \" . $selector;\r\n\t\t$XPath = $selector;\r\n\t\t$replaceArray = array(\r\n\t\t' \\.' => '//' . $namespace . '*.',\r\n\t\t' #' => '//' . $namespace . '*#',\t\t\r\n\t\t'\\[([^\\[\\]]*)\\]' => '[@$1]',\r\n\t\t'\\s*>\\s*' => '/' . $namespace,\r\n\t\t// first-child and company are theoretically put into the style attribute\r\n\t\t//'([\\w\\-]*):first-child' => '*[1]/self::$1',\r\n\t\t// these are pseudo-selectors and could be part of either the selector or the style information for our purposes.\r\n\t\t// it is probably easier to consider them as style information.\r\n\t\t//'([\\w\\-]*):first-child' => 'child::$1[1]',\r\n\t\t'([\\w\\-]{1,}|\\*)(\\.[\\w\\-]{1,})*:first-child' => '*[1]/self::$1$2',\r\n\t\t//'([\\w\\-]*):last-child' => 'child::$1[last()]',\r\n\t\t'([\\w\\-]{1,}|\\*)(\\.[\\w\\-]{1,})*:last-child' => '*[last()]/self::$1$2',\r\n\t\t//'([\\w\\-]*):lang\\(([^\\(\\)]*)\\)' => '$1[@xml:lang=\"$2\" or starts-with(@xml:lang, concat(\"$2\",\"-\"))]',\r\n\t\t//'\\s*\\+\\s*' => '/following-sibling::*[1]/self::',\r\n\t\t'([\\w\\-]{1,}|\\*)\\s*\\+\\s*([\\w\\-\\*]*)' => '$1/following-sibling::*[1]/self::$2',\r\n\t\t//'([\\w\\-]*)\\s*\\+\\s*([\\w\\-]*)' => '$1/following-sibling::$2[0]',\r\n\t\t//'([\\w\\-]*)[([\\w\\-]*)~=(\"|\\')([^\\3]*)\\3]' => '$1[contains(concat(\" \",@$2,\" \"),concat(\" \",\"$4\",\" \"))]',\r\n\t\t//'([\\w\\-]*)[([\\w\\-]*)|=(\"|\\')([^\\3]*)\\3]' => '$1[@$2=\"$3\" or starts-with(@$2,concat(\"$3\",\"-\"))]',\r\n\t\t'#([\\w\\-]{1,})' => '[@id=\"$1\"]',\r\n\t\t' ' => '//' . $namespace,\r\n\t\t//'\\.([\\w\\-]*)' => '[@class=\"$1\"]',\r\n\t\t// the above is insufficient; elements may be multiply-classed:\r\n\t\t'\\.([\\w\\-]{1,})' => '[contains(concat(\" \",@class,\" \"),\" $1 \")]',\r\n\t\t// the following can simply be precatenated when doing the query.\r\n\t\t//'(.*)' => '//' . ReTidy::get_html_namespace() . '$1',\r\n\t\t//'\\*\\*' => '*',\r\n\t\t);\r\n\t\tforeach($replaceArray as $search => $replace) {\r\n\t\t\t$XPath = preg_replace('/' . $search . '/is', $replace, $XPath);\r\n\t\t}\r\n\t\treturn $XPath;\r\n\t}", "function xmlProvider() {\n\n return [\n [\n 'hello',\n 'hello',\n ],\n [\n '<element>hello</element>',\n '<element xmlns=\"http://sabredav.org/ns\">hello</element>'\n ],\n [\n '<element foo=\"bar\">hello</element>',\n '<element xmlns=\"http://sabredav.org/ns\" foo=\"bar\">hello</element>'\n ],\n [\n '<element x1:foo=\"bar\" xmlns:x1=\"http://example.org/ns\">hello</element>',\n '<element xmlns:x1=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\" x1:foo=\"bar\">hello</element>'\n ],\n [\n '<element xmlns=\"http://example.org/ns\">hello</element>',\n '<element xmlns=\"http://example.org/ns\">hello</element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\">hello</x1:element>',\n ],\n [\n '<element xmlns:foo=\"http://example.org/ns\">hello</element>',\n '<element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\">hello</element>',\n '<element>hello</element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\">hello</foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\">hello</foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\">hello</x1:element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\"><child>hello</child></foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\"><child>hello</child></foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\"><child>hello</child></x1:element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\"><child/></foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\"><child/></foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\"><child/></x1:element>',\n ],\n [\n '<foo:element xmlns:foo=\"http://example.org/ns\"><child a=\"b\"/></foo:element>',\n '<foo:element xmlns:foo=\"http://example.org/ns\" xmlns=\"http://sabredav.org/ns\"><child a=\"b\"/></foo:element>',\n '<x1:element xmlns:x1=\"http://example.org/ns\"><child a=\"b\"/></x1:element>',\n ],\n ];\n\n }", "function common_el($l1, $l2) {\n $vx = lvar('x');\n\n return conj(\n choice($vx, $l1),\n choice($vx, $l2));\n}" ]
[ "0.5921714", "0.5793756", "0.49752668", "0.49611178", "0.4709088", "0.47074506", "0.46300435", "0.45574737", "0.45186788", "0.45112315", "0.4501439", "0.45001787", "0.44959056", "0.44879273", "0.44746855", "0.44502056", "0.44493535", "0.44370976", "0.44134828", "0.43798295", "0.43728948", "0.43720368", "0.4369079", "0.4364903", "0.4363631", "0.43626505", "0.4352823", "0.43507218", "0.43419114", "0.43088797", "0.42944086", "0.4288791", "0.4254099", "0.4219143", "0.42134535", "0.4213408", "0.41835326", "0.41576666", "0.41504064", "0.41136238", "0.41097504", "0.40987998", "0.40662706", "0.4057892", "0.4050499", "0.40297225", "0.40224686", "0.40033564", "0.40013888", "0.400074", "0.3987551", "0.39439502", "0.3940104", "0.39258638", "0.39224508", "0.3905697", "0.3881939", "0.38781148", "0.38770798", "0.38726425", "0.38676557", "0.38630295", "0.38606426", "0.38560316", "0.38539147", "0.38536748", "0.38534626", "0.38513488", "0.3847738", "0.38423726", "0.38346228", "0.38322058", "0.3811534", "0.3807793", "0.3807124", "0.38024822", "0.38009882", "0.37985227", "0.3795852", "0.37946868", "0.37923753", "0.37891597", "0.37856802", "0.3784063", "0.37797523", "0.37763366", "0.37738085", "0.37733203", "0.37711978", "0.37657148", "0.3764667", "0.37526357", "0.37516934", "0.3749424", "0.37447193", "0.37427953", "0.37417895", "0.37417337", "0.3741414", "0.37405026" ]
0.68117213
0
show list of services
protected function index() { $service = new Model_Service(); //$service->set('active',true); $this->payload->services = $service->find(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n $services = Service::\n orderBy('status', 'asc')->\n orderBy('created_at', 'desc')->\n paginate(10);\n\n return view('services.services', compact('services'));\n }", "public function show(Services $services)\n {\n //\n }", "public function show(Services $services)\n {\n //\n }", "public function show(Services $services)\n {\n //\n }", "public function index()\n {\n $services = Services::OrderBy('sequence')->get();\n\n return view('services.list', ['services' => $services]);\n }", "public function displayAllServices() {\n $services = $this->userServiceManager->getServices(null, true);\n $this->addCss(['search.css', 'forms.css']);\n $this->showView('service/allServices', [\n 'services' => $services,\n ]);\n }", "public function index()\n {\n $services = $this->serviceRepositories->getServices();\n\n return view('backend.services.list', compact('services'));\n }", "public function getList()\n {\n $service = list_services::all();\n return view('page.services',compact('service'));\n }", "public function index()\n {\n $title = 'Services';\n $modulo = 'services';\n $models = Service::all();\n $total = Service::all()->count();\n $fields = [\n 'id',\n 'name',\n 'description',\n 'created_at',\n 'updated_at'\n ];\n return view('list', compact('title', 'models', 'total', 'fields', 'modulo'));\n }", "public function index()\n {\n $services = Service::all();\n return view(\"admin.services.index\", compact('services'));\n }", "public function index()\n {\n $services = $this->service->all();\n return view('admin.service.index')->with('services', $services);\n }", "public function listsServicesGet()\r\n {\r\n $response = Services::with('regimen')->get();\r\n return response()->json($response,200);\r\n }", "public function index()\n {\n $services = Service::latest()->paginate(10);\n return view('admin.services.index', compact('services'));\n }", "protected function renderServicesList() {}", "public function index()\n {\n $services = services::all();\n return view('widegts::services.index',compact('services'));\n }", "public function index()\n {\n\n return view('smmpro::services.index', [\n 'services' => Service::orderBy('created_at', 'desc')->get()\n ]);\n }", "public function index()\n {\n $services = Service::latest()->get();\n return view('admin.services.index', compact('services'));\n }", "public function listedesservicesAction()\r\n {\r\n $tservices = new Pits_Model_DbTable_TServicesplaces();\r\n $select = $tservices->select();\r\n $adapter = new Zend_Paginator_Adapter_DbTableSelect($select);\r\n $paginator = new Zend_Paginator($adapter);\r\n $paginator->setItemCountPerPage(10);\r\n $paginator->setCurrentPageNumber($this->view->page = $this->getRequest()->getParam('page', 1));\r\n $this->view->services = $paginator;\r\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $services = $em->getRepository('AppBundle:Service')->findAll();\n\n return $this->render('default/services.html.twig', array(\n 'services' => $services,\n ));\n }", "public function services()\n {\n $sahulatServices=$this->_service->getServices(\"Sahulat\");\n $vendorServices=$this->_service->getServices(\"Vendor\");\n return view('frontend.service.services')->with(compact('sahulatServices','vendorServices'));;\n }", "public function index()\n\t{\n\t\t$services = $this->service->all();\n\n\t\treturn View::make('services.index', compact('services'));\n\t}", "public function index()\n {\n $services = Service::paginate(10);\n return view('admin.service.index')->withServices($services);\n }", "public function index()\n {\n $Services = Service::all();\n return view('pagesystem.Service.index', compact('Services'));\n }", "public function index()\n {\t\t\n return ServicesResource::collection(Services::all());\n }", "public function getServices();", "public function index()\n {\n $services = Service::select('id', 'name', 'price')->paginate(10);\n return view('adminlte.services.index', ['data' => $services]);\n }", "public function showService(){\n \treturn View::make(\"adminservices\");\n }", "public function index()\n {\n $services = Service::get();\n\n \n return view('dashboard.service.index',compact('services'));\n }", "public function index()\r\n\t{\r\n\t\t$services = Service::all();\r\n\r\n\t\treturn View::make('services.index')\r\n\t\t\t->with('services', $services);\r\n\t}", "public function index()\n {\n \n $all_servive = Services::all();\n return view('all_service')->with('services', $all_servive);\n }", "public function index()\n {\n $services=Service::orderBy('sort')->paginate(10);\n return view('admin/service/service',compact('services'));\n }", "public function index()\n {\n return $this->service->list();\n }", "public static function getListServices () {\n return self::findByStatus(self::STATUS_ACTIVE);\n }", "public function index()\n {\n return ServicesApi::collection($this->services->whereNull('deleted_at')->get());\n\n }", "public function getServices()\n\t\t{\n\n\t\t\t$service_id = $this->input->get('service_id') ;\n\t\t\techo json_encode($this->mdl_services->all()->result() ) ;\n\t\t}", "public function index()\n {\n $data = Service::all();\n return view('admin.services.index',['data'=>$data]);\n }", "public function client_all_services(){\n $service = Service::where('user_id',Auth::user()->id)->where('status', 0)->get();\n //dd($service);\n return view('admin.pages.client_services.all_services', compact('service'));\n }", "public function index()\n {\n $services= Services::all();\n $data= array(\n 'services' => $services,\n\n );\n return view('admin.services.index')->with($data);\n }", "public function index()\n {\n $services = ServiceDetail::all();\n return view(\"backoffice.service_detail.all\", compact(\"services\"));\n }", "public function index()\n\t{\n\t\t$services = Service::all();\n\t\treturn View::make('services.index', array('services'=>$services));\n\t}", "public function actionIndex()\n {\n $searchModel = new ServiceSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function services()\n {\n\t return view('pages.services');\n }", "function listServices()\n{\n global $LANG_ADMIN, $LANG_TRB, $_CONF, $_IMAGE_TYPE, $_TABLES;\n\n require_once $_CONF['path_system'] . 'lib-admin.php';\n\n $retval = '';\n\n $header_arr = array( # display 'text' and use table field 'field'\n array('text' => $LANG_ADMIN['edit'], 'field' => 'edit', 'sort' => false),\n array('text' => $LANG_TRB['service'], 'field' => 'name', 'sort' => true),\n array('text' => $LANG_TRB['ping_method'], 'field' => 'method', 'sort' => true),\n array('text' => $LANG_TRB['service_ping_url'], 'field' => 'ping_url', 'sort' => true),\n array('text' => $LANG_ADMIN['enabled'], 'field' => 'is_enabled', 'sort' => false)\n );\n\n $defsort_arr = array('field' => 'name', 'direction' => 'asc');\n\n $menu_arr = array (\n array('url' => $_CONF['site_admin_url'] . '/trackback.php?mode=editservice',\n 'text' => $LANG_ADMIN['create_new']),\n array('url' => $_CONF['site_admin_url'],\n 'text' => $LANG_ADMIN['admin_home']));\n\n $retval .= COM_startBlock($LANG_TRB['services_headline'], '',\n COM_getBlockTemplate('_admin_block', 'header'));\n\n $retval .= ADMIN_createMenu(\n $menu_arr,\n $LANG_TRB['service_explain'],\n $_CONF['layout_url'] . '/images/icons/trackback.' . $_IMAGE_TYPE\n );\n\n $text_arr = array(\n 'has_extras' => true,\n 'form_url' => $_CONF['site_admin_url'] . '/trackback.php',\n 'help_url' => getHelpUrl() . '#ping'\n );\n\n $query_arr = array(\n 'table' => 'pingservice',\n 'sql' => \"SELECT * FROM {$_TABLES['pingservice']} WHERE 1=1\",\n 'query_fields' => array('name', 'ping_url'),\n 'default_filter' => \"\",\n 'no_data' => $LANG_TRB['no_services']\n );\n\n // this is a dummy variable so we know the form has been used if all services\n // should be disabled in order to disable the last one.\n $form_arr = array('bottom' => '<input type=\"hidden\" name=\"serviceChanger\" value=\"true\"' . XHTML . '>');\n\n $retval .= ADMIN_list('pingservice', 'ADMIN_getListField_trackback',\n $header_arr, $text_arr, $query_arr, $defsort_arr,\n '', SEC_createToken(), '', $form_arr);\n $retval .= COM_endBlock(COM_getBlockTemplate('_admin_block', 'footer'));\n\n if ($_CONF['trackback_enabled']) {\n $retval .= freshTrackback ();\n }\n if ($_CONF['pingback_enabled']) {\n $retval .= freshPingback ();\n }\n\n return $retval;\n}", "public function index()\n {\n // $services = Service::with(['shop', 'shop.user'])\n // ->select('shop_id', 'service_name', 'service_price', 'service_duration')\n // ->get()\n // ->groupBy('shop.shop_name');\n $shops = Shop::latest()->get();\n\n return view('services.index', compact('shops'));\n }", "public function services(){\n $results = DB::select('select * from services');\n return view('frontend.services')->with(['results'=>$results]);\n }", "public function index()\n {\n $services= Service::all();\n $data['services']=$services;\n return view('admin.services.index',$data);\n }", "public function services()\n {\n $services_active = true;\n\n $display_status_id = config('contants.display_status_display');\n $feedbacks = $this->feedback_services->allWithDisplayStatus($display_status_id);\n\n return view('client.services', compact('feedbacks', 'services_active'));\n }", "public function index()\n {\n $services = Services::all(); \n return view('backend.fleet.services', compact('services'));\n }", "private function _getServiceList()\n {\n Modules_CustomServices_DataLayer::init();\n $configs = Modules_CustomServices_DataLayer::loadServiceConfigurations();\n\n // Configs are objects, but the list view needs associative arrays.\n $config_to_array = function($config) {\n return [\n 'name' => '<a href=\"' . htmlspecialchars(pm_Context::getActionUrl('index', 'view') . '/id/' . urlencode($config->unique_id)) . '\">' . htmlspecialchars($config->display_name) . '</a>',\n 'type' => self::_configTypeName($config->config_type),\n 'plesk_service_id' => '<code>' . htmlspecialchars('ext-' . pm_Context::getModuleId() . '-' . $config->unique_id) . '</code>',\n 'run_as_user' => $config->run_as_user\n ];\n };\n $data = array_map($config_to_array, $configs);\n\n // Prepare the list for presentation.\n $list = new pm_View_List_Simple($this->view, $this->_request);\n $list->setData($data);\n $list->setColumns([\n 'name' => [\n 'title' => 'Name',\n 'noEscape' => TRUE,\n 'searchable' => TRUE,\n 'sortable' => TRUE\n ],\n 'type' => [\n 'title' => 'Type',\n 'noEscape' => FALSE,\n 'searchable' => FALSE,\n 'sortable' => FALSE\n ],\n 'plesk_service_id' => [\n 'title' => 'Service ID',\n 'noEscape' => TRUE,\n 'searchable' => TRUE,\n 'sortable' => FALSE\n ],\n 'run_as_user' => [\n 'title' => 'System user',\n 'noEscape' => FALSE,\n 'searchable' => TRUE,\n 'sortable' => TRUE\n ]\n ]);\n $list->setDataUrl(['action' => 'list-data']);\n $list->setTools([\n [\n 'title' => 'Add service (simple)',\n 'description' => 'Add a new service that wraps a process',\n 'class' => 'sb-add-new',\n 'link' => pm_Context::getActionUrl('index', 'add') . '/type/process'\n ],\n [\n 'title' => 'Add service (manual)',\n 'description' => 'Add a new manually controlled service',\n 'class' => 'sb-add-new',\n 'link' => pm_Context::getActionUrl('index', 'add') . '/type/manual'\n ]\n ]);\n return $list;\n }", "function showAllServiciosMVC()\n {\n $servicios = $this->serviciosModel->getServicios();\n $this->viewservices->showAllServicesPrint($servicios);\n }", "public function show(Service $service)\n {\n\n }", "public function services(){\n $data = array(\n 'title' => 'Services',\n 'services' => ['Tellen', 'Quality', 'Habitat']\n );\n return view('pages.services')->with($data);\n }", "public function services()\n {\n \t\t//$services = $data->get_services();\n \t\t//dd($cities->ZA);\n \t\t$services = KitApi::get_services();\n \t\treturn view('services', compact('services'));\n }", "public function index()\n {\n $type = \"sd\";\n $services = Service::get();\n return view('index') ->with(compact('services' , 'type'));\n }", "public function show(Service $service)\n {\n //\n }", "public function show(Service $service)\n {\n //\n }", "public function show(Service $service)\n {\n //\n }", "public function show(Service $service)\n {\n //\n }", "public function show(Service $service)\n {\n //\n }", "public function show(Service $service)\n {\n //\n }", "public function show(Service $service)\n {\n //\n }", "public function show(Service $service)\n {\n //\n }", "public function index()\r\n {\r\n\r\n\r\n return view('admin.service.services.index');\r\n }", "public function index()\n {\n //\n\t\t$services=Services::all()->toArray();\n\t\treturn view('services.index',compact('services'));\n\t\t\n }", "public function get_services() {\n return $this->linkemperor_exec(null, null,\"/api/v2/customers/services.json\");\n }", "public function show(Servicos $servicos)\n {\n //\n }", "public function index()\n {\n $service = Service::all();\n $product = Product::all();\n return view('dashboard.services.index', compact('service', 'product'));\n }", "public function index()\n {\n $services = Service::latest()->paginate(15);\n return view('servicios.index', compact('services'));\n }", "public function index()\n\t{\n\t\t$this->our_services();\n\t}", "public function index()\n {\n $services = Service::with('ship')->get();\n \n return view('service.index', compact('services'));\n }", "public function index(){\n $this->vars['page_header'] = OsMenuHelper::get_menu_items_by_id('services');\n $service_categories = new OsServiceCategoryModel();\n $service_categories = $service_categories->get_results_as_models();\n $this->vars['service_categories'] = $service_categories;\n\n $services = new OsServiceModel();\n $this->vars['uncategorized_services'] = $services->where(array('category_id' => ['OR' => [0, 'IS NULL']]))->order_by('order_number asc')->get_results_as_models();\n\n $this->format_render(__FUNCTION__);\n }", "public function actionserviceTypeListing()\n\t{\n ob_start();\n Yii::app()->theme='back'; \n $res=ServiceTypes::model()->findAll();\n //echo \"<pre>\";print_r($res);die;\n $this->render('servicetypelisting',array('list'=>$res));\n\t}", "public function index()\n {\n $aux = new ResponseService;\n\n $services = $aux->indexTecnico();\n $clientes = Cliente::OrderBy('nombre', 'Asc')->toBase()->get(['nombre', 'apellido', 'identificacion', 'id']);\n $equipos = Equipo::OrderBy('serie', 'Asc')->toBase()->get(['serie', 'id']);\n \n return view('admin.services.index', compact('services','clientes','equipos'));\n }", "public function index()\n {\n $serviceDetails = ServiceDetail::orderBy('id','DESC')->paginate(10);\n if(count($serviceDetails) > 0){\n foreach ($serviceDetails as $detail){\n $serviceName = Service::findOrFail($detail->idService);\n $detail->serviceName = $serviceName->name;\n }\n }\n return view('backend.service-detail.index',compact('serviceDetails'));\n }", "public function services()\n {\n $navbar = NavBar::first();\n $servicehead = ServiceHead::first();\n $featurehead = FeatureHead::first();\n $testimonial = TestimonialHead::first();\n $servicebody = ServiceBody::all();\n $featurebody = FeatureBody::all();\n $testimonials = Testimonial::all();\n\n return view('pages.home.services' , compact('servicehead' , 'featurehead' , 'servicebody' , 'navbar' , 'featurebody' , 'testimonial' , 'testimonials'));\n }", "public function our_services(){\n $all_services = Service::all();\n return view('front_end.pages_frontend.our_services',compact('all_services'));\n }", "public function index()\n {\n // $services = DB::table('services')\n // ->latest()\n // ->paginate(9);\n $services= Service::latest()->paginate('6');\n $trashedServices=Service::onlyTrashed()->latest()->paginate(5);\n return view('admin.activitie.services', compact('services','trashedServices'));\n }", "public function index()\n {\n $services = Service::all();\n $icon = Icon::all();\n return view('site.services', compact('services', 'icon'));\n }", "public function index()\n {\n $all_services = VideoService::query()->select('*')->orderBy('order_no','ASC')->get();\n return view('admin.video_service.video_service_list',compact('all_services'));\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $services = Service::all();\n foreach ($services as $s){\n $s->urlEdit = route(\"services.edit\",$s->id);\n }\n $this->data[\"services\"] = $services;\n return view(\"admin.pages.services\",$this->data);\n }", "public function show()\n {\n $services = DB::table('services')->get();\n // la recupperation des services de la DB :\n \n //dd($service);\n\n return view('create',array('services'=> $services));\n }", "public function getServices(): array;", "public function index()\n {\n $dokterService = DokterService::with('dokter','profile','service')->get();\n \n $dokterServiceCount = DokterService::with('dokter','profile','service')->count(); \n\n\n return response([\n 'success' => true,\n 'message' => 'List Semua Dokter Service',\n 'count' => $dokterServiceCount,\n 'data' => $dokterService\n ], 200);\n }", "public function typeServices()\n {\n $display_status_id = config('contants.display_status_display');\n $feedbacks = $this->feedback_services->allWithDisplayStatus($display_status_id);\n return view('client.services', compact('feedbacks', 'services_active'));\n }", "public function showAction(Services $service)\n {\n $deleteForm = $this->createDeleteForm($service);\n $em = $this->getDoctrine()->getManager();\n $this->denyAccessUnlessGranted('IS_AUTHENTICATED_FULLY');\n $user = $this->getUser();\n $tableName = [];\n $tableSettingsName = [];\n $tableName[$em->getClassMetadata('kiraxeAdminCrmBundle:Workers')->getTableName()] = \"Сотрудники\";\n $tableName[$em->getClassMetadata('kiraxeAdminCrmBundle:Services')->getTableName()] = \"Услуги\";\n $tableSettingsName[$em->getClassMetadata('kiraxeAdminCrmBundle:User')->getTableName()] = \"Пользователи\";\n $tableName[$em->getClassMetadata('kiraxeAdminCrmBundle:Materials')->getTableName()] = \"Материалы\";\n $tableName[$em->getClassMetadata('kiraxeAdminCrmBundle:Orders')->getTableName()] = \"Заказ-наряд\";\n $tableSettingsName[$em->getClassMetadata('kiraxeAdminCrmBundle:Measure')->getTableName()] = \"Единицы измерения\";\n $tableName[$em->getClassMetadata('kiraxeAdminCrmBundle:Expenses')->getTableName()] = \"Расход\";\n $tableCars = [];\n $tableCars[$em->getClassMetadata('kiraxeAdminCrmBundle:Brand')->getTableName()] = \"Бренд автомобиля\";\n $tableCars[$em->getClassMetadata('kiraxeAdminCrmBundle:Model')->getTableName()] = \"Модель автомобиля\";\n\n return $this->render('services/show.html.twig', array(\n 'service' => $service,\n 'delete_form' => $deleteForm->createView(),\n 'tables' => $tableName,\n 'user' => $user,\n 'tableSettingsName' => $tableSettingsName,\n 'tableCars' => $tableCars,\n ));\n }", "public function serviceInfo(){\n\n\t\t\t$service_id = $this->input->get('service_id') ;\n\t\t\t$info = $this->mdl_services->get_info($service_id) ;\n\t\t\techo json_encode($info) ;\n\t\t}", "public function index()\n {\n // return 0;\n $data['page_title'] = \" Service\";\n $data['mentors'] = Service::latest()->paginate(8);\n return view('admin.service.index', $data);\n }", "public function index()\n {\n $services = Service::withTrashed()->where('created_by',auth()->user()->id)->get();\n if (request()->ajax()){\n return DataTables::of($services)\n ->addIndexColumn()\n ->editColumn('actions', function(Service $service) {\n return view('actions.actions_service', compact('service'))->render();\n })\n ->editColumn('created_at', function(Service $service) {\n return date('m/d/y - H:i A',intval(strtotime($service->created_at)));\n })\n ->rawColumns(['actions'])\n ->toJson();\n }\n return view('services.index',compact('services'));\n }", "public function getService()\n {\n //\n \n $services = Service::all();\n $rates = Rate::all();\n return view('admin.service',compact('services','rates'));\n }", "public function index()\n {\n $services = Service::all();\n\n return response() -> json([\n \"success\" => true,\n \"services\" => $services\n ], 200);\n }", "function wsdl_docs_services_viewer($form, $form_state) {\n drupal_set_title(t('Web Services'));\n\n // @todo: Find and list all published services\n return $form;\n}", "public function service_listing() {\n // $user = array(\n // 'id' => encrypt($temp['id']),\n // 'email' => $temp['sClEmail'],\n // );\n \n $breadcrumbs = [['link' => \"/client-dashboard\", 'name' => \"Dashboard\"], ['name' => \"Service Listing\"]];\n\n $data = $this->getServiceData(\"all\", Auth::id());\n\n return view('/pages/client_user/client/client-service-listing',[\n 'breadcrumbs' => $breadcrumbs,\n // 'user'=> $user,\n ])->with(\"serviceList\", $data);\n }", "public function ServiceIndex($id)\n {\n\n $service = Service::findOrFail($id);\n \n return view('admin.service.index')->with([\n 'service' => $service\n ]);\n\n }", "public function index()\n {\n return Service::all();\n }", "static function getServiceList()\n {\n return session::get('ServerService');\n }", "public function index()\n {\n return view('servicos.list', ['servicos' => Servico::paginate(10),\n 'produtos' => Produto::all(),\n 'clientes' => Cliente::all(),\n ]);\n }", "public function index()\n {\n $data=service::all();\n return view('viewservices',['viewservices'=>$data]);\n }", "function getServices() {\n\t\t$results = \"\";\n\t\t$sql = 'SELECT * FROM Service';\n\n\t\t$results = queryDB($sql);\n\n\t\treturn $results;\n\t}", "public function actionIndex()\n {\n $searchModel = new ClinicServicesSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }" ]
[ "0.77450335", "0.76584405", "0.76584405", "0.76584405", "0.7620393", "0.75888187", "0.7584513", "0.7511054", "0.7493076", "0.74602944", "0.74114066", "0.7350322", "0.734144", "0.7327312", "0.7317585", "0.7297456", "0.7290423", "0.7270584", "0.7269891", "0.7237382", "0.7234098", "0.7214293", "0.7194273", "0.7180139", "0.7179698", "0.71765375", "0.7137505", "0.71270907", "0.7123203", "0.71174395", "0.7105001", "0.7081115", "0.70387703", "0.70354015", "0.70353186", "0.7009855", "0.7001248", "0.69867766", "0.6978914", "0.6965943", "0.696035", "0.6949622", "0.6938218", "0.6938211", "0.6913232", "0.6907928", "0.69045347", "0.6902333", "0.6887157", "0.68867916", "0.68862087", "0.687754", "0.6872275", "0.6858412", "0.6852016", "0.6852016", "0.6852016", "0.6852016", "0.6852016", "0.6852016", "0.6852016", "0.684727", "0.6846163", "0.68360496", "0.68273944", "0.67979807", "0.6790651", "0.6787934", "0.6782838", "0.6773478", "0.6757001", "0.6746043", "0.67446494", "0.67250985", "0.6664837", "0.665672", "0.6639685", "0.66382074", "0.66371006", "0.66342527", "0.6615836", "0.66091114", "0.66056645", "0.6604867", "0.66042024", "0.66005665", "0.66003376", "0.65943307", "0.6586884", "0.6584532", "0.6561486", "0.6559983", "0.6554973", "0.6547893", "0.65395427", "0.65388674", "0.65372694", "0.6531714", "0.6526206", "0.6525582" ]
0.6875711
52
Functions used to present a table of attributes and their values.
function present_list($attr) { if (is_array($attr) && count($attr) > 1) { $str = '<ul>'; foreach ($attr as $value) { $str .= '<li>'.htmlspecialchars($attr).'</li>'; } $str .= '</ul>'; return $str; } else { return htmlspecialchars($attr[0]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function list_attributes() {\n\t\t$attributes = $this->get_attributes();\n\t\tif ($attributes && sizeof($attributes)>0) :\n\t\t\t\n\t\t\techo '<table cellspacing=\"0\" class=\"shop_attributes\">';\n\t\t\t$alt = 1;\n\t\t\tforeach ($attributes as $attribute) :\n\t\t\t\tif ($attribute['visible'] == 'no') continue;\n\t\t\t\t$alt = $alt*-1;\n\t\t\t\techo '<tr class=\"';\n\t\t\t\tif ($alt==1) echo 'alt';\n\t\t\t\techo '\"><th>'.wptexturize($attribute['name']).'</th><td>';\n\t\t\t\t\n\t\t\t\tif (is_array($attribute['value'])) $attribute['value'] = implode(', ', $attribute['value']);\n\t\t\t\t\n\t\t\t\techo wpautop(wptexturize($attribute['value']));\n\t\t\t\t\n\t\t\t\techo '</td></tr>';\n\t\t\tendforeach;\n\t\t\techo '</table>';\n\n\t\tendif;\n\t}", "public function attributes();", "function html_table($data) {\r\n\r\n $row = mysqli_fetch_assoc($data);\r\n $rows = array();\r\n array_push($rows, $row);\r\n $attributes = array_keys($row);\r\n\r\n if(mysqli_num_rows($data) > 0) {\r\n while($row = mysqli_fetch_assoc($data)) {\r\n array_push($rows, $row);\r\n }\r\n }\r\n\r\n print(\"<table>\\n\");\r\n print(\"<tr>\\n\");\r\n for($i = 0; $i < count($attributes); $i++) {\r\n print(\"<th>{$attributes[$i]}</th>\\n\");\r\n }\r\n print(\"</tr>\\n\");\r\n for($j = 0; $j < count($rows); $j++) {\r\n print(\"<tr>\\n\");\r\n foreach($attributes as $attribute) {\r\n print(\"<td>{$rows[$j][$attribute]}</td>\\n\");\r\n }\r\n print(\"</tr>\\n\");\r\n }\r\n\r\n print(\"</table>\\n\");\r\n\r\n}", "function print_table($database_connection, $table_name) {\r\n\r\n $attributes = get_attributes($database_connection, $table_name);\r\n $tuples = get_rows($database_connection, $table_name);\r\n\r\n print(\"<table>\\n\");\r\n print(\"<tr>\\n\");\r\n for($i = 0; $i < count($attributes); $i++) {\r\n print(\"<th>{$attributes[$i]}</th>\\n\");\r\n }\r\n print(\"</tr>\\n\");\r\n for($j = 0; $j < count($tuples); $j++) {\r\n print(\"<tr>\\n\");\r\n foreach($attributes as $attribute) {\r\n print(\"<td>{$tuples[$j][$attribute]}</td>\\n\");\r\n }\r\n print(\"</tr>\\n\");\r\n }\r\n\r\n print(\"</table>\\n\");\r\n }", "public function getViaTableAttributesValue();", "function printAttributes( $element )\n{\n $NCardinalityDictionary = array(\"Species\",\"Phase\",\"Factor\",\"Cultivar\",\"PhotSynType\",\"Point\",\n\t\t\t\t\t\t\t\t\t\t\"Crop_Par\",\"Fert_Par\",\"Irr_Par\",\"Residue_Par\",\"Till_Par\",\n\t\t\t\t\t\t\t\t\t\t\"C)2_Trend_XY\",\"Soil_Bio_Kinectic_Par\",\"Stations\",\n\t\t\t\t\t\t\t\t\t\t\"Storm_Intensity\",\"Hourly_Rainfall\",\"Soil\",\"Layer\",\n\t\t\t\t\t\t\t\t\t\t\"Experiment\",\"Rotation_Components\",\"Component\",\n\t\t\t\t\t\t\t\t\t\t\"Mgt_Chemical_App\",\"Mgt_EncMod_App\",\"Mgt_Harvest_App\",\n\t\t\t\t\t\t\t\t\t\t\"Mgt_Tillage_App\",\"Mgt_Fertilizer_App\",\"Mgt_Residu_App\",\n\t\t\t\t\t\t\t\t\t\t\"Mgt_Irrigation_App\");\n $name = $element->getName();\n //echo \"<table class='attributeTable' type='attributeTable' name='$name' border=1><tr>\";\n\techo \"<div class='attributes'>\";\n\t//If version make readonly\n\tif( $name == \"Version\")\n\t{\n\t\tforeach($element->attributes() as $a => $b)\n\t\t{\n\t\t\techo \"<div class='attribute' id='$a'><b>$a</b><br /><input type='text' value='$b' readonly></input></div>\";\n \t}\n\t}\n\telse \n\t{\n\t\tif( in_array($name,$NCardinalityDictionary) )\n\t\t{\n\t\t\techo \"<button onClick='newTab( $(this).parent() )'>New \" . $name . \"</button>\";\n\t\t\techo \"<button onClick='clearValues( $(this).parent() )'>Clear Values</button><br />\";\n\t\t}\n\t\tforeach($element->attributes() as $a => $b)\n\t\t{\n\t\t\techo \"<div class='attribute' id='$a'><b>$a</b><br /><input type='text' value='$b'></input></div>\";\n\t\t}\n\t}\n\techo \"</div><br />\";\n}", "function as_table() \n {\n #$str = \"<table> \\n\";\n $str = \"\";\n foreach(get_object_vars($this) as $name => $obj) \n {\n if ($obj != NULL) \n {\n $str .= \"<tr>\\n\\t<td>\".$obj->label().\"</td>\\n\\t\";\n $str .= \"<td>\".$obj.\"</td>\\n</tr>\\n\";\n }\n }\n #$str .= \"</table>\\n\";\n return $str;\n }", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public function getAttributes();", "public static function getSummaryAttributes()\n {\n return array(\n 'id' => array(\n 'name' => 'id',\n 'display' => 'ID',\n 'type' => 'numeric',\n 'link' => 'endpoint',\n ),\n 'external_id' => array(\n 'name' => 'external_id',\n 'display' => 'External ID',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'name' => array(\n 'name' => 'name',\n 'display' => 'Name',\n 'type' => 'alpha',\n ),\n 'arena' => array(\n 'name' => 'arena',\n 'display' => 'Arena',\n 'type' => 'alpha',\n 'hide' => 'phone,tablet',\n ),\n 'arena_id' => array(\n 'name' => 'arena_id',\n 'display' => 'Arena ID',\n 'type' => 'numeric',\n 'hide' => 'all',\n 'link' => 'endpoint2',\n ),\n 'length' => array(\n 'name' => 'length',\n 'display' => 'Length',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'width' => array(\n 'name' => 'width',\n 'display' => 'Width',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'radius' => array(\n 'name' => 'radius',\n 'display' => 'Radius',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'seating' => array(\n 'name' => 'seating',\n 'display' => 'Seating Capacity',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'tags' => array(\n 'name' => 'tags',\n 'display' => 'Tags',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'description' => array(\n 'name' => 'description',\n 'display' => 'Description',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'notes' => array(\n 'name' => 'notes',\n 'display' => 'Notes',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'type' => array(\n 'name' => 'type',\n 'display' => 'Type',\n 'type' => 'alpha',\n ),\n 'status' => array(\n 'name' => 'status',\n 'display' => 'Status',\n 'type' => 'alpha',\n ),\n );\n }", "function PDFTable($attrs) \n\t{\n\t\tglobal $DC,$DG;\n\n\t\t// recupera ogni proprietà passata dall'XML\n\t\tforeach($attrs as $key=>$value){\n\t\t\teval('$this->'.$key.' = \"$value\";');\n\t\t}\n\n\t\t// dichiara i valori di default...\n\t\t$default['COLS'][] = 1; // numero di ripetizioni orrizzontali dell'area di disegno\n\n\t\t// ... e li imposta\n\t\tforeach($default as $key=>$value){\n\t\t\tforeach ($value as $local){ eval('if ($local and !$this->'.$key.') { $this->'.$key.' = \"'.$local.'\"; }'); \t}\n\t\t}\n\t\t\n\t\t// dichiara la lista degli attributi obbligatori...\n\t\t$reqiured[] = \"GEOMETRY\";\n\t\t$reqiured[] = \"ROWS\";\n\t\t$reqiured[] = \"DSN\";\n\t\t\n\t\t// ... e li verifica\n\t\tforeach($reqiured as $value){\n\t\t\teval('if(!isset($this->'.$value.')){die (\"The property \".$value.\" in PDFTable ID -> \".$this->ID.\" is required.\");}');\n\t\t}\n\n\t\t$this->GEOMETRY = explode(',',$this->GEOMETRY);\n\n\t\t$this->LEFT = $this->GEOMETRY[0];\n\t\t$this->TOP = $this->GEOMETRY[1];\n\t\t$this->WIDTH = $this->GEOMETRY[2];\n\t\t$this->HEIGHT = $this->GEOMETRY[3];\n\t}", "function GetAttributes();", "public function list()\n {\n $attrs = Attribute::all();\n $html = view('partials.table-tbody.table-attribute', compact('attrs'))->render();\n\n return response()->json(['html' => $html], 200);\n }", "public function getAttributes() {}", "public function getAttributes() {}", "public function table_attributes() {\n return static::find_by_sql(\"SHOW COLUMNS FROM \".static::$table_name);\n }", "public function attributes() : array;", "public function get_attributes()\n {\n }", "public function get_attributes()\n {\n }", "abstract protected function attributes();", "public function attributes() // atribūtu savi nosaukumi\n {\n return[ \n 'fname' => 'Vārds',\n 'lname' => 'Uzvārds',\n 'email' => 'E-pasts',\n 'oldpassword' => 'Paroles lauks',\n 'password' => 'Jaunas paroles lauks',\n 'buttontitle' => 'Pogas virsraksts',\n 'buttonlink' => 'Pogas links',\n 'reciever' => 'Saņēmēju lauks',\n 'emailtitle' => 'Ziņas virsrsksts',\n 'emailtext' => 'Ziņas teksts',\n 'transport' => 'Pasākumu lauks'\n ];\n }", "public function print_table_description()\n {\n }", "function metastudent()\r\n{\r\n return array(\r\n array(\r\n //Attributes\r\n 'ID','Name','Age','Degree'\r\n ),\r\n array(\r\n //datatypes\r\n 'ID'=>'INT',\r\n 'Name'=>'VARCHAR',\r\n 'Age'=>'INT',\r\n 'Degree'=>'VARCHAR'\r\n ),\r\n array(\r\n //numeric\r\n 'ID',\r\n 'Age'\r\n )\r\n );\r\n}", "public function getAttributes(){ }", "protected function attributeTableHTML($field)\r\n\t{\r\n\t\t$attributes = json_decode($field->attributes);\r\n\t\t\r\n\t\tif(empty($attributes))\r\n\t\t\t$attributes = array(\"\" => \"\");\r\n\t\t\r\n\t\t?>\r\n\t\t<input name=\"attributes[]\" type=\"hidden\"/>\r\n\t\t<table class=\"attributes\">\r\n\t\t\t<tbody>\r\n\t\t\t\t<?php\r\n\t\t\t\tforeach($attributes as $key => $value)\r\n\t\t\t\t{\r\n\t\t\t\t?>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input\r\n\t\t\t\t\t\t\t\tplaceholder=\"<?php _e('Name', 'wp-google-maps'); ?>\"\r\n\t\t\t\t\t\t\t\tclass=\"attribute-name\"\r\n\t\t\t\t\t\t\t\tvalue=\"<?php echo $key; ?>\"\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t<td>\r\n\t\t\t\t\t\t\t<input \r\n\t\t\t\t\t\t\t\tplaceholder=\"<?php _e('Value', 'wp-google-maps'); ?>\"\r\n\t\t\t\t\t\t\t\tclass=\"attribute-value\"\r\n\t\t\t\t\t\t\t\tvalue=\"<?php echo $value; ?>\"\r\n\t\t\t\t\t\t\t\t/>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t<?php\r\n\t\t\t\t}\r\n\t\t\t\t?>\r\n\t\t\t</tbody>\r\n\t\t</table>\r\n\t\t<?php\r\n\t}", "function displayAttribute($i, $row)\n{\n global $title;\n global $year;\n global $star;\n global $country;\n global $director;\n global $actor;\n global $screen;\n global $cine;\n global $oscar;\n $separator = true;\n\n switch ($i)\n {\n //title\n case $title:\n echo \"<font size=\\\"2\\\" face=\\\"palatino\\\"><b>\" . $row[$i] . \"</b>\\n\";\n break;\n\n //year\n case $year:\n echo \"<font size=\\\"2\\\" face=\\\"palatino\\\">\" . $row[$i] . \"\\n\";\n break;\n\n //star rating\n case $star:\n if (!$row[$i])\n echo \"<font size=\\\"2\\\" face=\\\"palatino\\\"><i>not seen</i>\\n\";\n else\n echo \"<font size=\\\"2\\\" face=\\\"palatino\\\">\" . $row[$i] . \"\\n\";\n break;\n\n //country\n case $country:\n if (!$row[$i])\n $separator = false;\n else\n echo \"<font size=\\\"2\\\" face=\\\"palatino\\\">\" . $row[$i] . \"\\n\";\n break;\n\n //director\n case $director:\n if (!$row[$i])\n $separator = false;\n else\n {\n echo \"<font color=\\\"maroon\\\" size=\\\"2\\\"><i>Directed by: </i></font>\";\n echo \"<font color=\\\"black\\\" size=\\\"2\\\"><b>\" . $row[$i] . \"</b>\\n\";\n }\n break;\n\n //actor\n case $actor:\n if (!$row[$i])\n $separator = false;\n else\n {\n echo \"<font color=\\\"maroon\\\" size=\\\"2\\\"><i>Starring: </i></font>\";\n echo \"<font color=\\\"black\\\" size=\\\"2\\\">\" . $row[$i] . \"\\n\";\n }\n break;\n\n //screenwriter\n case $screen:\n if (!$row[$i])\n $separator = false;\n else\n {\n echo \"<font color=\\\"maroon\\\" size=\\\"2\\\"><i>Written by: </i></font>\";\n echo \"<font color=\\\"black\\\" size=\\\"2\\\">\" . $row[$i] . \"\\n\";\n }\n break;\n\n //cinematographer\n case $cine:\n if (!$row[$i])\n $separator = false;\n else\n {\n echo \"<font color=\\\"maroon\\\" size=\\\"2\\\"><i>Cinematographer: </i></font>\";\n echo \"<font color=\\\"black\\\" size=\\\"2\\\">\" . $row[$i] . \"\\n\";\n }\n break;\n\n //oscar category\n case $oscar:\n $separator = false;\n if ($row[$i])\n {\n echo \"<font color=\\\"maroon\\\" size=\\\"2\\\"><i>Oscar category: </i></font>\";\n echo \"<font color=\\\"black\\\" size=\\\"2\\\">\" . $row[$i] . \" (</font>\";\n }\n break;\n\n //oscar recipient\n case $oscar+1:\n $separator = false;\n if ($row[$i])\n echo \"<font color=\\\"black\\\" size=\\\"2\\\">\" . $row[$i] . \", </font>\";\n break;\n\n //oscar status\n case $oscar+2:\n if (!$row[$i])\n $separator = false;\n else\n echo \"<font color=\\\"black\\\" size=\\\"2\\\">\" . $row[$i] . \")\\n\";\n break;\n }\n\n if ($separator)\n {\n echo \" / \";\n echo \"</font>\\n\";\n }\n}", "protected function attributes() {\n\t $attributes = array();\n\t foreach(static::$table_fields as $field) {\n\t if(property_exists( $this, $field)) {\n\t $attributes[$field] = $this->$field;\n\t }\n\t }\n\t return $attributes;\n }", "public static function getSummaryAttributes()\n {\n return array(\n 'id' => array(\n 'name' => 'id',\n 'display' => 'ID',\n 'type' => 'numeric',\n 'link' => 'endpoint',\n ),\n 'event_id' => array(\n 'name' => 'event_id',\n 'display' => 'Event ID',\n 'type' => 'numeric',\n 'hide' => 'all',\n 'link' => 'endpoint2',\n ),\n 'event_start' => array(\n 'name' => 'event_start',\n 'display' => 'Event Start',\n 'type' => 'numeric',\n ),\n 'arena' => array(\n 'name' => 'arena',\n 'display' => 'Arena',\n 'type' => 'alpha',\n 'hide' => 'phone,tablet',\n ),\n 'arena_id' => array(\n 'name' => 'arena_id',\n 'display' => 'Arena ID',\n 'type' => 'numeric',\n 'hide' => 'all',\n 'link' => 'endpoint3',\n ),\n 'location' => array(\n 'name' => 'location',\n 'display' => 'Location',\n 'type' => 'alpha',\n 'hide' => 'phone,tablet',\n ),\n 'location_id' => array(\n 'name' => 'location_id',\n 'display' => 'Location ID',\n 'type' => 'numeric',\n 'hide' => 'all',\n 'link' => 'endpoint4',\n ),\n 'requester_name' => array(\n 'name' => 'requester_name',\n 'display' => 'Requested By',\n 'type' => 'alpha',\n 'hide' => 'phone',\n ),\n 'created_on' => array(\n 'name' => 'created_on',\n 'display' => 'Requested On',\n 'type' => 'alpha',\n 'hide' => 'phone',\n ),\n 'acknowledged_by' => array(\n 'name' => 'acknowledged_by',\n 'display' => 'Acknowledged By',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'acknowledged_on' => array(\n 'name' => 'acknowledged_on',\n 'display' => 'Acknowledged On',\n 'type' => 'numeric',\n 'hide' => 'all'\n ),\n 'accepted_by' => array(\n 'name' => 'accepted_by',\n 'display' => 'Accepted By',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'accepted_on' => array(\n 'name' => 'accepted_on',\n 'display' => 'Accepted On',\n 'type' => 'numeric',\n 'hide' => 'all'\n ),\n 'rejected_by' => array(\n 'name' => 'rejected_by',\n 'display' => 'Rejected By',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'rejected_on' => array(\n 'name' => 'rejected_on',\n 'display' => 'Rejected On',\n 'type' => 'numeric',\n 'hide' => 'all'\n ),\n 'rejected_reason' => array(\n 'name' => 'rejected_reason',\n 'display' => 'Rejection Reason',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'notes' => array(\n 'name' => 'notes',\n 'display' => 'Notes',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'type' => array(\n 'name' => 'type',\n 'display' => 'Type',\n 'type' => 'alpha',\n ),\n 'status' => array(\n 'name' => 'status',\n 'display' => 'Status',\n 'type' => 'alpha',\n ),\n );\n }", "abstract function attributes(): array;", "public function getAttributes()\n {\n }", "public function attributes()\r\n {\r\n return array_keys($this->getDb()->getTableSchema($this->layoutName())->columns);\r\n }", "function getAttributes()\n {\n }", "public function render(): array\n {\n return array_merge($this->attributes, [\n 'cols' => $this->table->toArray()\n ]);\n }", "static function getAttributesInfo ()\n {\n return array (\n 'section1' => array (\n 'name' => _('Argonaut mirror settings'),\n 'attrs' => array (\n new StringAttribute (\n _('Local debian mirror directory'),\n '',\n 'argonautMirrorDir',\n FALSE,\n '/srv/www/debian'\n )\n )\n ),\n 'section2' => array (\n 'name' => _('Argonaut Debconf Crawler configuration'),\n 'attrs' => array (\n new StringAttribute (\n _('Local packages folder'),\n _('Folder in which the crawler will store packages during analysis'),\n 'argonautCrawlerPackagesFolder',\n FALSE,\n '/var/cache/argonaut/packages'\n )\n )\n ),\n 'section3' => array (\n 'name' => _('Argonaut Repository configuration'),\n 'attrs' => array (\n new StringAttribute (\n _('Proxy'),\n '',\n 'argonautLdap2repProxy',\n FALSE\n ),\n new StringAttribute (\n _('Log directory'), '',\n 'argonautLdap2repLogDir', FALSE,\n '/var/log/argonaut/'\n ),\n new BooleanAttribute (\n _('Errors'),\n '',\n 'argonautLdap2repErrors',\n FALSE,\n TRUE\n ),\n new BooleanAttribute (\n _('Source'),\n '',\n 'argonautLdap2repSource',\n FALSE,\n FALSE\n ),\n new BooleanAttribute (\n _('GPG Check'),\n '',\n 'argonautLdap2repGPGCheck',\n FALSE,\n FALSE\n ),\n new BooleanAttribute (\n _('Contents'),\n '',\n 'argonautLdap2repContents',\n FALSE,\n FALSE\n ),\n new BooleanAttribute (\n _('Verbose'),\n _('Wether to activate verbose mode'),\n 'argonautLdap2repVerbose',\n FALSE,\n FALSE\n ),\n )\n )\n );\n }", "function get_product_atrribute_matrix($attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_products_attributes_mm'){\n \t\t\n \t\treturn $this->get_product_attribute_matrix($attribute_include, $showHiddenValues,$sortingTable );\n \t}", "public function index()\n\t{\n $attributes = $this->showAttribute->getTopAttributesWithSite(\n\t\t\tapp('veer')->siteId\n\t\t); \n\t\t\n\t\treturn $this->viewIndex('attributes', $attributes);\n\t}", "abstract public function attributeNames();", "public function getTableDescription();", "public function displayInfoTable() {\n $html = \"\n <tr>\n <td>$this->id</td>\n <td>$this->email</td>\n <td>$this->firstName</td>\n <td>$this->lastName</td>\n <td>$this->phone</td>\n <td>$this->birthday</td>\n <td>$this->gender</td>\n <td>$this->password</td>\n </tr>\";\n return $html;\n }", "function Info()\n\t{\n\t\t$arrReturn['TableName'] = $this->_strName;\n\t\tif ($this->_bolRowHighlighting)\n\t\t{\n\t\t\t$arrReturn['RowHighlighting'] = \"True\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrReturn['RowHighlighting'] = \"False\";\n\t\t}\n\t\t\n\t\tif ($this->_bolDetail)\n\t\t{\n\t\t\t$arrReturn['ShowDetail'] = \"True\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrReturn['ShowDetail'] = \"False\";\n\t\t}\n\n\t\tif ($this->_bolToolTips)\n\t\t{\n\t\t\t$arrReturn['ToolTips'] = \"True\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrReturn['ToolTips'] = \"False\";\n\t\t}\n\t\t\n\t\tif ($this->_bolLinked)\n\t\t{\n\t\t\t$arrReturn['Linked'] = \"True\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrReturn['Linked'] = \"False\";\n\t\t}\n\t\t\n\t\t$arrReturn['Header']\t\t= $this->_arrHeader;\n\t\t$arrReturn['Widths']\t\t= $this->_arrWidths;\n\t\t$arrReturn['Alignments']\t= $this->_arrAlignments;\n\t\t$arrReturn['LinkedTables']\t= $this->_arrlinkedTables;\n\t\t$arrReturn['Rows']\t\t\t= $this->_arrRows;\n\t\t\n\t\t\n\t\treturn $arrReturn;\n\t}", "public function getAttributesList()\n {\n }", "function table_row($p_data, $p_tr_attr = '', $p_td_attr = array()){\n\techo '<tr ' . $p_tr_attr . '>';\n\n\tfor($t_i=0; $t_i<count($p_data); $t_i++){\n\t\t$t_td = (isset($p_td_attr[$t_i]) ? $p_td_attr[$t_i] : '');\n\t\techo '<td ' . $t_td . '>' . $p_data[$t_i] . '</td>';\n\t}\n\n\techo '</tr>';\n}", "public function attributes(): array\n {\n return [\n 'name' => '角色名称',\n 'staff' => '关联员工',\n 'brand' => '关联品牌',\n 'department' => '关联部门',\n ];\n }", "function box_build_attributes($properties, $i, $showtrunc = true, $showfont = true, $showborder = true, $showfill = true, $pre = '', $title = '') {\n global $kFonts, $kFontSizes, $kFontAlign, $kFontColors, $kLineSizes;\n $fields = array('font', 'size', 'align', 'color', 'bordershow', 'bordersize', 'bordercolor', 'fillshow', 'fillcolor');\n\tforeach ($fields as $value) {\n $temp = $pre . $value;\n\t $$value = $properties->$temp;\n\t}\n $output = NULL;\n $output .= '<table class=\"ui-widget\" style=\"border-collapse:collapse;margin-left:auto;margin-right:auto;\">' . nl;\n $output .= ' <thead class=\"ui-widget-header\">' . nl;\n $output .= ' <tr><th colspan=\"5\">' . ($title ? $title : TEXT_ATTRIBUTES) . '</th></tr>' . nl;\n $output .= ' </thead>' . nl;\n $output .= ' <tbody class=\"ui-widget-content\">' . nl;\n if ($showtrunc) {\n $output .= ' <tr>' . nl;\n $output .= ' <td colspan=\"2\">' . TEXT_TRUNCATE . html_radio_field($pre.'box_trun_' . $i, '0', (!$properties->truncate) ? true : false) . TEXT_NO . html_radio_field($pre.'box_trun_' . $i, '1', ($properties->truncate) ? true : false) . TEXT_YES . '</td>' . nl;\n $output .= ' <td colspan=\"3\">' . TEXT_DISPLAY_ON . html_radio_field($pre.'box_last_' . $i, '0', (!$properties->display || $properties->display == '0') ? true : false) . TEXT_ALL_PAGES . html_radio_field($pre.'box_last_' . $i, '1', ($properties->display == '1') ? true : false) . TEXT_FIRST_PAGE . html_radio_field($pre.'box_last_' . $i, '2', ($properties->display == '2') ? true : false) . TEXT_LAST_PAGE . '</td>' . nl;\n $output .= ' </tr>' . nl;\n }\n if ($showfont) {\n $output .= ' <tr class=\"ui-widget-header\">' . nl;\n $output .= ' <th>' . '&nbsp;' . '</th>' . nl;\n $output .= ' <th>' . TEXT_STYLE . '</th>' . nl;\n $output .= ' <th>' . TEXT_SIZE . '</th>' . nl;\n $output .= ' <th>' . TEXT_ALIGN . '</th>' . nl;\n $output .= ' <th>' . TEXT_COLOR . '</th>' . nl;\n $output .= ' </tr>' . nl;\n $output .= ' <tr>' . nl;\n $output .= ' <td>' . TEXT_FONT .'</td>' . nl;\n $output .= ' <td>' . html_pull_down_menu($pre.'box_fnt_' . $i, $kFonts, $font) . '</td>' . nl;\n $output .= ' <td>' . html_pull_down_menu($pre.'box_size_'. $i, $kFontSizes, $size) . '</td>' . nl;\n $output .= ' <td>' . html_pull_down_menu($pre.'box_aln_' . $i, $kFontAlign, $align) . '</td>' . nl;\n $output .= ' <td id=\"' . $pre.'box_td_' . $i . '\" style=\"background-color:#' . convertPfColor($color) . '\">' . nl;\n $output .= ' <div id=\"' . $pre.'box_whl_' . $i . '\" \n\t onmousemove=\"moved(event, \\''.$pre.'box_whl_' . $i . '\\', \\''.$pre.'box_td_' . $i . '\\', \\''.$pre.'box_clr_' . $i . '\\')\" \n\t onclick=\"setCustom(\\''.$pre.'box_whl_' . $i . '\\', \\''.$pre.'sel_clr_' . $i . '\\')\" style=\"position:absolute; display:none; top:0px; left:0px; z-index:10000\">\n\t <img src=\"'.DIR_WS_MODULES.'phreeform/images/colorwheel.jpg\" width=\"256\" height=\"256\" alt=\"\" />' . nl;\n $output .= ' </div>' . nl;\n $output .= html_hidden_field($pre.'box_clr_' . $i, $color ? $color : '0:0:0') . nl;\n $output .= html_pull_down_menu($pre.'sel_clr_' . $i, $kFontColors, $color ? $color : '0:0:0', 'onchange=\"colorSet(\\''.$pre.'sel_clr_' . $i . '\\', \\''.$pre.'box_td_' . $i . '\\', \\''.$pre.'box_clr_' . $i . '\\')\"') . nl;\n $output .= html_icon('categories/applications-graphics.png', TEXT_CUSTOM, 'small', 'onclick=\"showCustom(\\''.$pre.'box_whl_' . $i . '\\', \\''.$pre.'sel_clr_' . $i . '\\')\"') . nl;\n $output .= ' </td>'. nl;\n $output .= ' </tr>' . nl;\n }\n if ($showborder) {\n $output .= ' <tr>' . nl;\n $output .= ' <td>' . TEXT_BORDER_AREA . '</td>' . nl;\n $output .= ' <td>' . html_checkbox_field($pre.'box_bdr_' . $i, '1', ($bordershow) ? true : false) . '</td>' . nl;\n $output .= ' <td>' . html_pull_down_menu($pre.'box_bsz_' . $i, $kLineSizes, $bordersize) . TEXT_POINTS . '</td>' . nl;\n $output .= ' <td>' . '&nbsp;' . '</td>' . nl;\n $output .= ' <td id=\"'.$pre.'box_btd_' . $i . '\" style=\"background-color:#' . convertPfColor($bordercolor) . '\">' . nl;\n $output .= ' <div id=\"'.$pre.'box_bwhl_' . $i . '\" \n\t onmousemove=\"moved(event, \\''.$pre.'box_bwhl_' . $i . '\\', \\''.$pre.'box_btd_' . $i . '\\', \\''.$pre.'box_bclr_' . $i . '\\')\" \n\t onclick=\"setCustom(\\''.$pre.'box_bwhl_' . $i . '\\', \\''.$pre.'sel_bclr_' . $i . '\\')\" style=\"position:absolute; display:none; top:0px; left:0px; z-index:10000\">\n\t <img src=\"'.DIR_WS_MODULES.'phreeform/images/colorwheel.jpg\" width=\"256\" height=\"256\" alt=\"\" />' . nl;\n $output .= ' </div>' . nl;\n $output .= html_hidden_field($pre.'box_bclr_' . $i, $bordercolor ? $bordercolor : '0:0:0') . nl;\n $output .= html_pull_down_menu($pre.'sel_bclr_' . $i, $kFontColors, $bordercolor ? $bordercolor : '0:0:0', 'onchange=\"colorSet(\\''.$pre.'sel_bclr_' . $i . '\\', \\''.$pre.'box_btd_' . $i . '\\', \\''.$pre.'box_bclr_' . $i . '\\')\"') . nl;\n $output .= html_icon('categories/applications-graphics.png', TEXT_CUSTOM, 'small', 'onclick=\"showCustom(\\''.$pre.'box_bwhl_' . $i . '\\', \\''.$pre.'sel_bclr_' . $i . '\\')\"') . nl;\n $output .= ' </td>'. nl;\n $output .= '</tr>' . nl;\n }\n if ($showfill) {\n $output .= '<tr>' . nl;\n $output .= ' <td>'. TEXT_FILL_AREA . '</td>' . nl;\n $output .= ' <td>'. html_checkbox_field($pre.'box_fill_' . $i, '1', ($fillshow) ? true : false) . '</td>' . nl;\n $output .= ' <td>'. '&nbsp;' . '</td>' . nl;\n $output .= ' <td>'. '&nbsp;' . '</td>' . nl;\n $output .= ' <td id=\"'.$pre.'box_ftd_' . $i .'\" style=\"background-color:#' . convertPfColor($fillcolor) .'\">' . nl;\n $output .= ' <div id=\"'.$pre.'box_fwhl_' . $i . '\" \n\t onmousemove=\"moved(event, \\''.$pre.'box_fwhl_' . $i . '\\', \\''.$pre.'box_ftd_' . $i . '\\', \\''.$pre.'box_fclr_' . $i . '\\')\" \n\t onclick=\"setCustom(\\''.$pre.'box_fwhl_' . $i . '\\', \\''.$pre.'sel_fclr_' . $i . '\\')\" style=\"position:absolute; display:none; top:0px; left:0px; z-index:10000\">\n\t <img src=\"'.DIR_WS_MODULES.'phreeform/images/colorwheel.jpg\" width=\"256\" height=\"256\" alt=\"\" />' . nl;\n $output .= ' </div>' . nl;\n $output .= html_hidden_field($pre.'box_fclr_' . $i, $fillcolor ? $fillcolor : '0:0:0') . nl;\n $output .= html_pull_down_menu($pre.'sel_fclr_' . $i, $kFontColors, $fillcolor ? $fillcolor : '0:0:0', 'onchange=\"colorSet(\\''.$pre.'sel_fclr_' . $i . '\\', \\''.$pre.'box_ftd_' . $i . '\\', \\''.$pre.'box_fclr_' . $i . '\\')\"') . nl;\n $output .= html_icon('categories/applications-graphics.png', TEXT_CUSTOM, 'small', 'onclick=\"showCustom(\\''.$pre.'box_fwhl_' . $i . '\\', \\''.$pre.'sel_fclr_' . $i . '\\')\"') . nl;\n $output .= ' </td>'. nl;\n $output .= '</tr>' . nl;\n }\n $output .= '</tbody></table>' . nl;\n return $output;\n}", "function ss_print_attributes($arr_data){\n\t\t$str_data = \"\";\n foreach ($arr_data as $key => $value) {\n \t$str_data .= $key.\"='\".$value.\"'\";\n }\n return $str_data;\n\t}", "public function getTableContent() {\n\t\treturn \"<tr data-key='\" . $this -> getKey() . \"'><td>\" . $this -> key . \"</td><td contenteditable='true'>\" . $this -> value . \"</td><td>\" . $this -> dataType . \"</td></tr>\";\n\t}", "public function index()\n {\n\n return view('admin.attribute.attr_list');\n }", "public function attributes()\n {\n return [\n 'name' => '商品名',\n 'price' => '価格',\n 'description' => '説明文',\n 'tag_for_search' => '検索用タグ',\n 'img' => '画像',\n 'stock' => '在庫数'\n ];\n }", "abstract protected function getModelAttributes();", "static function renderAttributes($attributes = null)\n {\n if (is_array($attributes))\n {\n foreach($attributes as $name => $value)\n {\n echo ' '.$name.'=\"'.textH8($value).'\"';\n }\n }\n }", "function attributer($attributes){\n\t$output = '';\n\tforeach ($attributes as $attribute => $value) {\n\t \tif(is_array($value)){ //breaks down any array into a string\n\t \t\tswitch ($attribute) {\n\t \t\t\tcase 'class': \t$output .= 'class=\"'.implode(' ', $value).'\" '; break;\n\t \t\t\tcase 'onclick': $output .= $value.'()'; break;\n\t \t\t\tcase 'data': \tforeach ($value as $name=>$val) { $output .= 'data-'.$key.'= \"'.$val.'\" '; } break;\t \t\t\t\n\t \t\t\tdefault: \t\t$output .= $attribute.' '; break;\n\t \t\t}\t \t\t \n\t \t}\n\t \telse{ $output .= ' '.$attribute.'=\"'.$value.'\" ';\t} \t\n\t}\n\treturn $output;\n}", "function get_attributes($database_connection, $table_name) {\r\n \r\n $sql = \"SELECT * FROM {$table_name}\";\r\n $result = mysqli_query($database_connection, $sql);\r\n $row = mysqli_fetch_assoc($result);\r\n $attributes = array_keys($row);\r\n return $attributes;\r\n }", "public function getAttributeSetDetails();", "public function attributes()\n {\n return [\n 'description' => 'Descrição',\n 'gender' => 'Gênero',\n ];\n }", "public function getAtributos($atributo){\n\t\t$sql = \"describe {$this->entidade->getTable()}\";\n\t\t$stmt = $this->db->getDb()->query($sql);\n\t\t\n\t\t$resultado = $stmt->fetchAll(\\PDO::FETCH_COLUMN);\n\t\treturn $resultado[$atributo];\n\t}", "public function visualizzazione(){\n $nameColumn = $this->getColumnName();\n $tuple = $this->read();\n foreach($nameColumn as $nome){\n $x = ' <td> '. $nome . ' </td> ';\n echo $x;\n }\n \n foreach($tuple as $ris){\n $str ='<tr> <td> '.$ris->getId(). ' </td> '.\n '<td> '.$ris->getNome(). '</td>'.\n '<td> '.$ris->getUsername(). '</td>'.\n '<td> '.$ris->getPassword(). '</td>'.\n '<td> '.$ris->getEmail(). '</td>'.\n '<td> '.$ris->getMuseo(). '</td>'.\n '</tr>';\n echo $str;\n };\n }", "static function getAttributesInfo ()\n {\n return array (\n 'section1' => array (\n 'name' => _('Informations'),\n 'attrs' => array (\n new StringAttribute('', '', 'k', FALSE, 'kolab'),\n new SetAttribute(new StringAttribute('', '', 'kolabHost')),\n new StringAttribute(\n _('Postfix mydomain'), _('Postfix domain name'),\n 'postfix-mydomain'\n ),\n new StringAttribute(\n _('Cyrus admins'), _('Cyrus admins for kolab server'),\n 'cyrus-admins'\n ),\n new SetAttribute(\n new StringAttribute(\n _('Mail domains').', '._('Postfix mydestination'), _('Mail domains'),\n 'postfix-mydestination', FALSE\n )\n )\n )\n ),\n 'section2' => array (\n 'name' => _('Services'),\n 'attrs' => array (\n new BooleanAttribute (\n _('POP3 service'), _('Enable POP3 service'),\n 'cyrus-pop3', FALSE, FALSE\n ),\n new BooleanAttribute (\n _('POP3/SSL service'), _('Enable POP3/SSL service'),\n 'cyrus-pop3s', FALSE, TRUE\n ),\n new BooleanAttribute (\n _('IMAP service'), _('Enable IMAP service'),\n 'cyrus-imap', FALSE, TRUE\n ),\n new BooleanAttribute (\n _('IMAP/SSL service'), _('Enable IMAP/SSL service'),\n 'cyrus-imaps', FALSE, TRUE\n ),\n new BooleanAttribute (\n _('Sieve service'), _('Enable Sieve service'),\n 'cyrus-sieve', FALSE, TRUE\n ),\n new BooleanAttribute (\n _('FTP FreeBusy service (legacy)'),\n _('FTP FreeBusy service (legacy, not interoperable with Kolab2 FreeBusy)'),\n 'proftpd-ftp', FALSE, FALSE\n ),\n new BooleanAttribute (\n _('HTTP FreeBusy service (legacy)'), '',\n 'apache-http', FALSE, TRUE\n ),\n new BooleanAttribute (\n _('Amavis email scanning'), _('Amavis email scanning (virus/spam)'),\n 'postfix-enable-virus-scan', FALSE, TRUE\n ),\n )\n ),\n 'section3' => array (\n 'name' => _('Quota settings'),\n 'attrs' => array (\n new IntAttribute (\n _('Quota occupation limit before warning users (%)'),\n _('Warn users when using more than X% of their mail quota'),\n 'cyrus-quotawarn', FALSE,\n FALSE, FALSE, // min and max\n 80 // default value\n )\n )\n ),\n 'section4' => array (\n 'name' => _('Free/Busy settings'),\n 'attrs' => array (\n new BooleanAttribute (\n _('Allow unauthenticated downloading of Free/Busy information'),\n _('Allow unauthenticated downloading of Free/Busy information'),\n 'apache-allow-unauthenticated-fb', FALSE, TRUE\n ),\n new IntAttribute (\n _('Number of days to include when creating free/busy lists'),\n _('Include data from X days in the past when creating free/busy lists'),\n 'kolabFreeBusyFuture', FALSE,\n FALSE, FALSE, // min and max\n 1 // default value\n )\n )\n ),\n 'section5' => array (\n 'name' => _('SMTP privileged networks'),\n 'attrs' => array (\n new StringAttribute (\n _('Hosts/networks allowed to relay'),\n _('Hosts/networks allowed to relay (multiple values comma-seperated)'),\n 'postfix-mynetworks',\n FALSE,\n '127.0.0.1/8'\n )\n )\n ),\n 'section6' => array (\n 'name' => _('SMTP smarthost/relayhost'),\n 'attrs' => array (\n new RelayHostKolabAttribute (\n _('Host used to relay mails'), 'postfix-relayhost'\n )\n )\n ),\n 'section7' => array (\n 'name' => _('Accept Internet Mail'),\n 'attrs' => array (\n new BooleanAttribute (\n _('Accept mail from other domains over non-authenticated SMTP'),\n _('Accept mail from other domains over non-authenticated SMTP'),\n 'postfix-allow-unauthenticated'\n )\n )\n )\n );\n }", "public function render()\n\t{\n\n\t\t$table = \"<table\";\n\n\t\t// Add all attributes\n\t\tforeach ($this->attributes as $key => $value) {\n\t\t\t$table .= ' ' . $key . '=\"' . $value .'\"';\n\t\t}\n\n\t\t$table .= \">\"; // Close table\n\n\t\t// Add the head\n\t\tif ($this->showHeadRow) {\n\t\t\t$table .= \"<thead><tr>\";\n\n\t\t\t// Show the number header.\n\t\t\tif ($this->showNumberColumn) {\n\t\t\t\t$table .= \"<th>#</th>\";\n\t\t\t}\n\n\t\t\tforeach ($this->columns as $column) {\n\t\t\t\t$columnHeadTitle = isset($column['headTitle']) ? $column['headTitle'] : $column[0];\n\t\t\t\t$table .= \"<th>\" . $columnHeadTitle . \"</th>\";\n\t\t\t}\n\n\t\t\t$table .= \"</tr></thead>\"; // finish head\n\t\t}\n\n\t\t// Body\n\t\t$table .= \"<tbody>\";\n\n\t\t$row = $this->numberColumnOffset;\n\n\t\tif (count($this->data) == 0) {\n\t\t\t// Show a no data entry\n\t\t\t$colspan = count($this->columns) + ($this->showNumberColumn ? 1 : 0);\n\t\t\t$table .= '<tr><td colspan=\"'.$colspan.'\"><p align=\"center\" style=\"font-weight:bold;\">Keine Einträge</p></td></tr>';\n\t\t}\n\t\telse {\n\t\t\tforeach ($this->data as $dataObject) {\n\n\t\t\t\t// Row attributes\n\t\t\t\t$attributes = $this->rowAttributes;\n\t\t\t\tif (!is_array($attributes)) {\n\t\t\t\t\tif (is_callable($this->rowAttributes)) {\n\t\t\t\t\t\t$callable = $this->rowAttributes;\n\t\t\t\t\t\t$attributes = $callable($dataObject);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$attributeString = '';\n\t\t\t\tif ($attributes) {\t\t// Add attributes if we have some\n\t\t\t\t\tforeach ($attributes as $attributeName => $attributeValue) {\n\t\t\t\t\t\t$attributeString .= $attributeName . '=\"' . $attributeValue . '\" ' ;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($this->rowIdDataMethod) {\n\t\t\t\t\t// method name or closure?\n\t\t\t\t\t$id = '';\n\t\t\t\t\tif (is_string($this->rowIdDataMethod)) {\n\t\t\t\t\t\t$id = $dataObject->{$this->rowIdDataMethod}(); // Call the row data method\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$rf = new \\ReflectionFunction($this->rowIdDataMethod);\n\t\t\t\t\t\tif ($rf->isClosure()) {\n\t\t\t\t\t\t\t// we got a closure\n\t\t\t\t\t\t\t$closure = $this->rowIdDataMethod;\n\t\t\t\t\t\t\t$id = $closure($dataObject);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t$table .= '<tr id=\"'. $id .'\" ' . $attributeString . '>'; // Start row with id\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$table .= \"<tr \". $attributeString .\">\";\t// Start row without id\n\t\t\t\t}\n\n\t\t\t\t// Number?\n\t\t\t\tif ($this->showNumberColumn) {\n\t\t\t\t\t$table .= \"<td>\" . $row . \"</td>\";\n\t\t\t\t}\n\n\t\t\t\tforeach ($this->columns as $column) {\n\t\t\t\t\t$dataMethod = isset($column['dataMethod']) ? $column['dataMethod'] : $column[1];\n\t\t\t\t\tif (is_string($dataMethod)) {\n\t\t\t\t\t\t// Just call the method an insert the return value into the table cell\n\t\t\t\t\t\t$table .= \"<td>\". $dataObject->$dataMethod() .\"</td>\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$rf = new \\ReflectionFunction($dataMethod);\n\t\t\t\t\t\tif ($rf->isClosure()) {\n\n\t\t\t\t\t\t\t// Call the closure and get the result\n\t\t\t\t\t\t\t$value = $dataMethod($dataObject, $this);\n\n\t\t\t\t\t\t\t$table .= \"<td>\". $value .\"</td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$table .= \"</tr>\";\t// End the table row\n\t\t\t\t$row++;\n\t\t\t}\n\n\t\t\t// Render the footer row\n\t\t\t$table = $this->renderFooter($table);\n\n\t\t}\n\n\t\t$table .= \"</tbody>\";\n\n\t\t$table .= \"</table>\";\n\t\treturn $table;\n\t}", "function get_atrribute_matrix($articleList=false, $attribute_include=false, $showHiddenValues=true,$sortingTable = 'tx_commerce_articles_article_attributes_mm'){\n \t\treturn $this->get_attribute_matrix($articleList, $attribute_include, $showHiddenValues,$sortingTable);\n \t}", "public function attributes()\n {\n return parent::attributes();\n }", "public static function getPropertiesForTable(): array\n {\n return [\n 'date', 'volume', 'routedVolume', 'marketShare', 'litVolume',\n ];\n }", "public function overlayUserdefinedHtmlAttributeValues() {}", "protected function _getAttributes(){\n\t\treturn ActiveRecordMetaData::getAttributes($this->_source, $this->_schema);\n\t}", "function diy_table_row_attr($str_value, $attributes) {\n\t\t$attr = $attributes;\n\t\tif (is_array($attributes)) {\n\t\t\t$attribute = [];\n\t\t\tforeach ($attributes as $key => $value) {\n\t\t\t\t$attribute[] = \"{$key}=\\\"{$value}\\\"\";\n\t\t\t}\n\t\t\t$attr = implode(' ', $attribute);\n\t\t}\n\t\t\n\t\treturn \"{$str_value}{:}$attr\";\n\t}", "public function getAttributes(): iterable;", "function make_table($query) {\r\n\t\techo \"<table><tr>\";\r\n\t\t$row = mysqli_fetch_assoc($query);\r\n\t\tforeach ($row as $attr => $value) {\r\n\t\t\techo \"<th>$attr</th>\";\r\n\t\t}\r\n\t\techo \"</tr>\";\r\n\t\twhile ($row = mysqli_fetch_assoc($query)) { \r\n\t\t\techo \"<tr>\";\r\n\t\t\tforeach($row as $value) {\r\n\t\t\t\techo \"<td>$value</td>\";\r\n\t\t\t}\r\n\t\t\techo \"</tr>\";\r\n\t\t}\r\n\t\techo \"</table>\";\r\n\t}", "function getTableName_attributeslists($attribId) \n\t{\n\t\t$success = false;\n\t\t$database = PhplistHelperPhplist::getDBO();\n\t\t\t\t\n\t\t$table = JTable::getInstance( 'Attributes', 'PhplistTable' );\n\t\t$query = new PhplistQuery( );\n\t\t$query->select( \"tablename\" );\n\t\t$query->from( $table->getTableName( ) . \" AS tbl\" );\n\t\t$query->where( \"tbl.id = \" . ( int ) $attribId );\n\t\t\n\t\t$database->setQuery( ( string ) $query );\n\t\t$data = $database->loadObject();\n\t\t\n\t\t$tablename_attributeslists = $data->tablename;\n\t\t$phplist_prefix = PhplistHelperPhplist::getPrefix();\n\t\t$success = \"{$phplist_prefix}_listattr_{$tablename_attributeslists}\";\n\t\t\n\t\treturn $success;\n\t}", "public function attributes($layout = 'table')\n\t{\n\t switch ($layout) {\n\t default:\n \t\t$ret = array(\n \t\t\tarray(\n \t\t\t\t'attribute' => 'year',\n \t\t\t\t'orderclause' => 'invoice.year',\n \t\t\t\t'class' => 'number',\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'number'\n \t\t\t\t)\n \t\t\t),\n \t\t\tarray(\n \t\t\t\t'attribute' => 'm',\n \t\t\t\t'orderclause' => 'invoice.m',\n \t\t\t\t'class' => 'number',\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'number'\n \t\t\t\t)\n \t\t\t),\n \t\t\tarray(\n \t\t\t\t'attribute' => 'd',\n \t\t\t\t'orderclause' => 'invoice.d',\n \t\t\t\t'class' => 'number',\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'number'\n \t\t\t\t)\n \t\t\t),\n array(\n \t\t\t 'attribute' => 'invoicetype_id',\n \t\t\t 'orderclause' => 'invoicetype.name',\n \t\t\t 'class' => 'text',\n \t\t\t 'callback' => array(\n \t\t\t 'name' => 'invoicetypeName'\n \t\t\t ),\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'text'\n \t\t\t\t)\n \t\t\t),\n \t\t\tarray(\n \t\t\t\t'attribute' => 'name',\n \t\t\t\t'orderclause' => 'invoice.name',\n \t\t\t\t'class' => 'number',\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'number'\n \t\t\t\t),\n \t\t\t\t'callback' => array(\n \t\t\t\t 'name' => 'invoiceName'\n \t\t\t\t)\n \t\t\t),\n \t\t\tarray(\n \t\t\t\t'attribute' => 'deleted',\n \t\t\t\t'orderclause' => 'invoice.deleted',\n \t\t\t\t'class' => 'bool',\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'bool'\n \t\t\t\t),\n \t\t\t\t'callback' => array(\n \t\t\t\t 'name' => 'isDeletedHumanReadable'\n \t\t\t\t)\n \t\t\t),\n \t\t\tarray(\n \t\t\t 'attribute' => 'client_id',\n \t\t\t 'orderclause' => 'client.nickname',\n \t\t\t 'class' => 'text',\n \t\t\t 'callback' => array(\n \t\t\t 'name' => 'clientNickname'\n \t\t\t ),\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'text'\n \t\t\t\t)\n \t\t\t),\n array(\n \t\t\t 'attribute' => 'clientcode',\n \t\t\t 'orderclause' => 'invoice.clientcode',\n \t\t\t 'class' => 'text',\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'text'\n \t\t\t\t)\n \t\t\t),\n \t\t\tarray(\n \t\t\t 'attribute' => 'card_id',\n \t\t\t 'orderclause' => 'card.name',\n \t\t\t 'class' => 'text',\n \t\t\t 'callback' => array(\n \t\t\t 'name' => 'cardName'\n \t\t\t ),\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'text'\n \t\t\t\t)\n \t\t\t),\n \t\t\tarray(\n \t\t\t 'attribute' => 'attorney_id',\n \t\t\t 'orderclause' => 'attorney.name',\n \t\t\t 'class' => 'text',\n \t\t\t 'callback' => array(\n \t\t\t 'name' => 'attorneyName'\n \t\t\t ),\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'text'\n \t\t\t\t)\n \t\t\t),\n \t\t\tarray(\n \t\t\t 'attribute' => 'user_id',\n \t\t\t 'orderclause' => 'user.name',\n \t\t\t 'class' => 'text',\n \t\t\t 'callback' => array(\n \t\t\t 'name' => 'userName'\n \t\t\t ),\n \t\t\t\t'filter' => array(\n \t\t\t\t 'tag' => 'text'\n \t\t\t\t)\n \t\t\t)\n \t\t);\n }\n return $ret;\n\t}", "public function showAthletesTable(){\r\n\t\t//fait le query voulu\r\n\t\t$stmt = $this->connect()->query(\"SELECT * FROM athletes\");\r\n\t\t//creer la table avec les tuples\r\n\t\techo \"<h3>Athletes Table</h3>\";\r\n\t\techo \"<table><tr><td>\" . \"id\" . \"</td><td>\" . \"name\" . \"</td><td>\" . \"identified_gender\" . \"</td><td>\" . \"email\" . \"</td><td>\" . \"date_of_birth\" . \"</td></tr>\";\r\n\t\twhile ($row = $stmt->fetch()) {\r\n\t\t\techo \"<tr><td>\" . $row['id'] . \"</td><td>\" . $row['name'] . \"</td><td>\" . $row['identified_gender'] . \"</td><td>\" . $row['email'] . \"</td><td>\" . $row['date_of_birth'] . \"</td></tr>\"; \r\n\t\t}\r\n\t\techo \"</table>\";\r\n\t}", "function showDataTable(){\n\t\t$output = \"\";\n\t\t// print the table\n\t\t$output .= \"<table summary=\\\"\".$this->summary.\"\\\">\\n\";\n\t\t// print the caption\n\t\t$output .= \"<caption>\".$this->caption.\"</caption>\\n\";\n\t\t$output .= $this->showHeader();\n\t\t// initialise variables\n\t\t$altCounter = 0;\n\t\t$altClass = \"\";\n\t\t$h = 1;\n\t\t// loop each row\n\t\tfor ($x=0; $x<count($this->rows); $x++) {\n\t\t\t// if it is time to show the header\n\t\t\tif ($h==$this->headerRepeat){\n\t\t\t\t// show the header\n\t\t\t\t$output .= $this->showHeader();\n\t\t\t\t$h = 1;\n\t\t\t}\n\t\t\t$row = $this->rows[$x];\n\t\t\t// alternate the row classes\n\t\t\tif ($this->altClasses){\n\t\t\t\tif ($this->altClasses[$altCounter]!=\"\"){ $altClass = \" class=\\\"\".$this->altClasses[$altCounter].\"\\\"\"; } else { $altClass=\"\"; }\n\t\t\t\tif ($altCounter==count($this->altClasses)-1){ $altCounter=0; } else { $altCounter++; }\n\t\t\t}\n\t\t\t// set the parameters to nothing\n\t\t\t$params = \"\";\n\t\t\t// if there are parameters for this row set\n\t\t\tif (count($this->rowParams[$x])>0){\n\t\t\t\t// loop the parameters\n\t\t\t\twhile (list($attribute, $parameter) = each($this->rowParams[$x])) {\n\t\t\t\t\t// if the parameter is 'class'\n\t\t\t\t\tif (strtolower($attribute)==\"class\"){\n\t\t\t\t\t\t// replace the altClass variable\n\t\t\t\t\t\t$altClass = \" \".strtolower($attribute).\"=\\\"$parameter\\\"\";\n\t\t\t\t\t} else{\n\t\t\t\t\t\t// otherwise build the parameters\n\t\t\t\t\t\t$params .= \" \".strtolower($attribute).\"=\\\"$parameter\\\"\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// print the row\n\t\t\t$output .= \"\t<tr$altClass$params>\\n\";\n\t\t\t\t// set the colSpan to 0\n\t\t\t\t$colSpan = 0;\n\t\t\t\t$colSpanAttribute = \"\";\n\t\t\t\t// if this row has less columns than the number of fields\n\t\t\t\tif (count($row)<count($this->fields)){\n\t\t\t\t\t$colSpan = (count($this->fields)-count($row))+1;\n\t\t\t\t}\n\t\t\t\t// loop each cell\n\t\t\t\tfor ($i=0; $i<count($row); $i++) {\n\t\t\t\t\t$value = $row[$i];\n\t\t\t\t\t$value = $this->formatField($i, $x);\n\t\t\t\t\t// make the colspan attribute\n\t\t\t\t\tif ($colSpan>0 && $i==(count($row)-1)){ $colSpanAttribute = \" colspan=\\\"$colSpan\\\"\"; }\n\t\t\t\t\t// print the cell\n\t\t\t\t\t$output .= \"\t\t<td$colSpanAttribute>\".$value.\"</td>\\n\";\n\t\t\t\t}\n\t\t\t// end the row\n\t\t\t$output .= \"\t</tr>\\n\";\n\t\t\t// increment the header repeat variable\n\t\t\t$h++;\n\t\t}\n\t\t// end the table\n\t\t$output .= \"</table>\\n\\n\";\n\t\tprint $output;\n\t}", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function getAttributes(): array;", "public function index()\n {\n // $allAttributes = ModelAttributes::all();\n // $modelAttributes = new ModelAttributes();\n\n // $attr = [];\n // $attrItems = [];\n\n // foreach ($allAttributes as $attribute) {\n // // echo $attribute->name;\n \n // array_push($attr, [\n // 'name' => $attribute->name\n // ]);\n\n // $items = $modelAttributes->listItemsByAttributeId($attribute->id);\n // foreach($items as $item) {\n \n // array_push($attr, [$item->value, $item->qtty]);\n\n // // echo $item->value;\n // // echo $item->qtty;\n // // echo \"<br>\";\n // }\n // // echo \"<hr>\";\n // }\n\n \n\n $modelAttributes = new ModelAttributes();\n $listAllItems = $modelAttributes->listAllItems();\n\n return view('attributes.index', [\n 'listAttributes' => ModelAttributes::all()]\n );\n }", "public function getAttributes()\n {\n $userId = $this->getDataRow()->getCellValue('id');\n // Prepare your attributes\n $newAttributes = [\n 'data-href' => route('admin.userdetail', [$userId]),\n 'class' => 'my-class table-row',\n ];\n return array_merge(parent::getAttributes(), $newAttributes);\n }", "public static function showData() {\n\n\t\tforeach(self::$employee_array as $id => $employee) { // Pour chaque ligne on affiche chaque attribut correspondant au colonne du tableau\n\n\t\t\tif($employee->_entityShortName == null) // Gestion du cas où une entité a été supprimée mais pas l'employé de l'entité\n\t\t\t\techo \"<tr><td>null</td><td>\" . $employee->_lastName . \"</td><td>\" . $employee->_firstName . \"</td><td>\" . $employee->_login . \"</td><td><a href=\\\"user.php?action=modifier&id=\" . $employee->_id . \"\\\">modifier</a></td><td><a href=\\\"user.php?action=supprimer&id=\" . $id . \"\\\">supprimer</a></td></tr>\";\n\t\t\telse\n\t\t\t\techo \"<tr><td>\" . $employee->_entityShortName . \"</td><td>\" . $employee->_lastName . \"</td><td>\" . $employee->_firstName . \"</td><td>\" . $employee->_login . \"</td><td><a href=\\\"user.php?action=modifier&id=\" . $employee->_id . \"\\\">modifier</a></td><td><a href=\\\"user.php?action=supprimer&id=\" . $id . \"\\\">supprimer</a></td></tr>\";\n\t\t}\n\t}", "public function columns()\n {\n return array(\n array(\n 'name' => 'name', \n 'title' => 'Attribute name',\n 'attributes' => array(\n \n ),\n ),\n array(\n 'name' => 'active',\n 'type' => 'toggle',\n 'title' => 'Active', \n 'attributes' => array(\n 'id' => \"active\",\n 'value' => \"{field_id}\"\n ), \n ) \n );\n }", "public function attributes()\n {\n return [\n 'external_id' => 'Third Party Identifier',\n 'name_first' => 'First Name',\n 'name_last' => 'Last Name',\n 'root_admin' => 'Root Administrator Status',\n ];\n }", "public function index()\n {\n $attributes = $this->attributeRepository->listAttributes();\n \n $this->setPageTitle('Attributs', 'List des attributs');\n return view('admin.attributes.index', compact('attributes'));\n }", "public function attributes(): array\n {\n return [\n 'value' => 'Valor',\n 'payer' => 'Pagador',\n 'payee' => 'Beneficiário',\n ];\n }", "function printTable($arg_array)\r\n\t\t{\r\n\t\techo \"<table border=1>\";\r\n\t\tforeach($arg_array[0] as $key=>$value)\r\n\t\t\t{\r\n\t\t\techo \"<th>\".$key.\"</th>\";\r\n\t\t\t}\r\n\t\techo \"<tr>\";\r\n\t\tforeach($arg_array as $row =>$record)\r\n\t\t\t{\r\n\t\t\tforeach($record as $column_head => $value)\r\n\t\t\t\t{\r\n\t\t\t\techo \"<td>\".$value.\"</td>\";\r\n\t\t\t\t}\r\n\t\t\techo \"</tr>\";\t\r\n\t\t\t}\r\n\t\techo \"</table>\";\r\n\t\t}", "public function attributeLabels()\n\t{\n\t}", "public function attributes()\r\n\t{\r\n\t\treturn $this->attribs;\r\n\t}", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Product Attributes\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the attributes.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/productsattributes/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( ProductsAttributes::grid() )->datagrid ();\n\t}", "public function values();", "public function values();", "public function values();", "public function values();", "public function values();", "public function dataTable();", "public function renderTagAttributes(){\n $row = '';\n foreach($this->tag_attributes as $key => $attribute)\n $row .= \"$key=\\\"$attribute\\\" \";\n return $row;\n }", "public function dump() {\n var_dump ($this->tblAttr, $this->theadAttr, $this->tbodyAttr, $this->thData, $this->tdData);\n }", "public function attributes() { return $this->attributes; }" ]
[ "0.7774759", "0.71195364", "0.6996503", "0.67946", "0.67472506", "0.6618005", "0.65365744", "0.64981675", "0.64981675", "0.64981675", "0.64981675", "0.64981675", "0.64981675", "0.64981675", "0.64981675", "0.64981675", "0.64695233", "0.6458808", "0.6458505", "0.6373789", "0.6346279", "0.6345736", "0.63222355", "0.6292656", "0.62752223", "0.62752223", "0.6255322", "0.6224087", "0.6222388", "0.6197088", "0.6153541", "0.61460096", "0.61275685", "0.6096574", "0.6086796", "0.6085763", "0.60853994", "0.60839236", "0.60795856", "0.60216904", "0.60205436", "0.6014737", "0.5996373", "0.59795", "0.59668666", "0.5956639", "0.5948411", "0.5945866", "0.5941472", "0.5935307", "0.5932077", "0.59296477", "0.58968276", "0.5894264", "0.58932465", "0.5885073", "0.58810836", "0.58806074", "0.58782303", "0.5868769", "0.5868724", "0.5866256", "0.5857979", "0.5855903", "0.5854355", "0.5853933", "0.58381385", "0.58325803", "0.5828555", "0.58137316", "0.5794994", "0.57921934", "0.5785692", "0.5784124", "0.5766799", "0.57654953", "0.57563955", "0.5754031", "0.5754031", "0.5754031", "0.5754031", "0.5753501", "0.57466596", "0.5734958", "0.5728551", "0.5719363", "0.5706935", "0.5705138", "0.5693127", "0.5692917", "0.5685005", "0.56807005", "0.5680686", "0.5680686", "0.5680686", "0.5680686", "0.5680686", "0.5679018", "0.567225", "0.5668102", "0.5665372" ]
0.0
-1
Run the database seeds.
public function run() { Model::unguard(); $this->call('RoleTableSeeder'); $this->call('UserTableSeeder'); $this->call('CourseTableSeeder'); $this->call('ApplicantTableSeeder'); $this->call('ApplicantCourseTableSeeder'); $this->call('InstructorTableSeeder'); }
{ "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' => 'simpleadressemail@mail.com', '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'=> \"admin@admin.com\"\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' => 'admin@petstore.com',\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' => 'prosales@researchmobile.co',\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' => 'movil@researchmobile.co',\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'=>'test@yandex.ru'\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' => 'admin@yahoo.com',\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' => 'programmerlemar@gmail.com',\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' => 'qwerty@gmail.com',\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=> 'admin@example.com',\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' => 'briedis@aa.bb',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => 'briedis2@aa.bb',\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' => 'admin@admin.com',\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' => 'ignacio@dh.com',\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' => 'admin@gmail.com',\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\"=>'alice@gmail.com',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'bob@gmail.com',\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 = your.email@domain.com\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' => 'admin@gmail.com',\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'=>'papesambandour@hotmail.com',\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' => 'rognales@gmail.com',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => 'sonic21danger@gmail.com',\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' => 'sovon.kucse@gmail.com']);\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'=>'abada@gmail.com',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','abada@gmail.com')->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' => 'eddyjaair@gmail.com']);\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' => 'barbozagonzalesjose@gmail.com',\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' => 'russell@gmail.com',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => 'bitfumes@gmail.com',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => 'paul@gmail.com',\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' => 'pkw@pkw.com',\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' => 'empresa02@gmail.com',\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' => 'carlos@email.com',\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'=>'izzanniroshlei@gmail.com',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'aina@gmail.com',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'sab@gmail.com',\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' => 'pedrito@juase.com',\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'=>'hienphan18112015@gmail.com', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'haphan@gmail.com', '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
/ / Check an Attribute exists in WooCommerce /
function check_for_product_attribute( $attribute ) { global $wpdb; $taxonomy_table_name = $wpdb->prefix . "term_taxonomy"; $taxonomy_sql = "SELECT * FROM " . $taxonomy_table_name . " WHERE taxonomy = 'pa_$attribute'"; $taxonomy_table_rows = $wpdb->get_results($taxonomy_sql, ARRAY_A); if ( $taxonomy_table_rows ) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function has_the_attribute($the_attribute){\n \n $object_properties = get_object_vars($this); //Function get_object_vars\n \n return array_key_exists($the_attribute, $object_properties);\n }", "private function has_attribute($attritube)\n {\n $allattribute=$this->attribute();\n if(array_key_exists($attritube,$allattribute))\n return true;\n return false;\n }", "private function has_attribute($attribute){\r\n //(incl.private ones!) as the keys and their current values as the value\r\n $object_vars = $this->attributes();\r\n //we dont care about the value, we just want to know if the key exists\r\n //will return true or false\r\n return array_key_exists($attribute, $object_vars);\r\n }", "private function has_attribute($attribute){\n\t\t//(inlcuding private ones) as keys and current values as value.\n\t\t\n\t\t$object_vars = $this->attributes();\n\t\t//want to check key exists, dont care about value here\n\t\t//returns true or false\t\n\t\t\n\t\treturn array_key_exists($attribute, $object_vars);\n\t}", "private function has_attribute($attribute){\r\n\t // (incl. private ones!) as the keys and their current values as the value\r\n\t $object_vars = get_object_vars($this);\r\n\t // We don't care about the value, we just want to know if the key exists\r\n\t // Will return true or false\r\n\t return array_key_exists($attribute, $object_vars);\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}", "private function has_attribute($attribute) {\r\n // (incl. private ones!) as the keys and their current values as the value\r\n $object_vars = get_object_vars($this);\r\n // We don't care about the value, we just want to know if the key exists\r\n // Will return true or false\r\n return array_key_exists($attribute, $object_vars);\r\n }", "private function has_attribute($attribute) {\n // Will return true or false\n return array_key_exists($attribute, $this->attributes());\n }", "private function has_attribute($attribute) {\n\t // (incl. private ones!) as the keys and their current values as the value\n\t $object_vars = get_object_vars($this);\n\t // We don't care about the value, we just want to know if the key exists\n\t // Will return true or false\n\t return array_key_exists($attribute, $object_vars);\n\t}", "private function has_attribute($attribute) {\n\t // (incl. private ones!) as the keys and their current values as the value\n\t $object_vars = get_object_vars($this);\n\t // We don't care about the value, we just want to know if the key exists\n\t // Will return true or false\n\t return array_key_exists($attribute, $object_vars);\n\t}", "private function has_attribute($attribute) {\n\t\t// Wil return true or false\n\t\t$object_vars = get_object_vars($this);\n\n\t\treturn array_key_exists($attribute, $object_vars);\n\t}", "private function has_attribute($attribute){\n // (including private ones) as the keys and their current values as the value\n $object_vars = get_object_vars($this);\n\n // We don't care about the value, we just want to know if the key exists\n // does $attribute(key) exist in $object_vars\n // Will return true or false\n return array_key_exists($attribute, $object_vars);\n }", "private function has_attribute($attribute)\n\t\t{\n\t\t//(incl. private ones!) as the keys and their current values as the value\n\t\t$object_vars = get_object_vars($this);\n\t\t//we don't care about the value, we just want to know if the key exists \n\t\t//will return true or false\n\t\treturn array_key_exists($attribute, $object_vars);\n\t\t}", "private function has_attribute($attribute) {\n\t // Will return true or false\n\t return array_key_exists($attribute, $this->attributes());\n\t}", "private function has_attribute($attribute)\n {\n //including priate ones as the keys and their current values are the value\n $object_vars = $this->attributes();\n\n //here i do not care what the specific values are but just interested if they exist\n return array_key_exists($attribute, $object_vars);\n }", "public function has_the_attribute($the_attribute){\n\t\t$object_properties = get_object_vars($this); \n\t\treturn array_key_exists($the_attribute,$object_properties);\n\t }", "public static function product_has_attribute( \\WC_Product $product, $attribute_name ) {\n\n\t\t$found = false;\n\n\t\tforeach ( self::get_available_product_attributes( $product ) as $slug => $attribute ) {\n\n\t\t\t// taxonomy attributes have a slugged name, but custom attributes do not so we check the attribute key\n\t\t\tif ( $attribute_name === $slug ) {\n\t\t\t\t$found = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $found;\n\t}", "function tep_has_product_attributes($products_id) {\n $attributes_query = tep_db_query(\"select count(*) as count from \" . TABLE_PRODUCTS_ATTRIBUTES . \" where products_id = '\" . $products_id . \"'\");\n $attributes = tep_db_fetch_array($attributes_query);\n\n if ($attributes['count'] > 0) {\n return true;\n } else {\n return false;\n }\n}", "private function has_attribute($attribute) {\r\n\t\t//get_object_vars returns an associative array with all attributes as the keys and their current values as value\r\n\t\t\t\t\t\t//this refers to get_object_vars\r\n\t\t$object_vars = get_object_vars($this);\r\n\t\t//checks to see if the key exists\r\n\r\n\t\t//returns true of false\r\n\t\t//does the key attribute exists in the array object vars?\r\n\t\treturn array_key_exists($attribute, $object_vars);\r\n\t}", "public function customAttributesExists() {\n $results = $this->get('custom-attributes');\n\n // # Make sure empty or null is set to an empty array\n if (empty($results) || is_null($results)) {\n $results = [];\n }\n\n // # Retrieve only keys from attributes and assign to new array\n $keys = array_map(function($i) {\n if ($i['attributeType'] == 'client') {\n return $i['key'];\n }\n }, $results);\n // # Check against required attributes and return any that do not match/exist in UCRM\n $remainder = array_diff($this->UscpCustomAttributes, $keys);\n\n // # If any remain return them...\n if (count($remainder) > 0) {\n return $remainder;\n } else {\n // # ...else custom attributes exist return true\n return true;\n }\n\n }", "private function has_attribute($attribute)\n {\n // Will return true or false\n return array_key_exists($attribute, $this->attributes());\n }", "public function hasAttr($attr);", "public function hasAttributes(){\n if (!JeproshopCombinationModelCombination::isFeaturePublished()){ return 0; }\n\n $db = JFactory::getDBO();\n\t\t$query = \"SELECT COUNT(*) FROM \" . $db->quoteName('#__jeproshop_product_attribute') . \" AS product_attribute \" ;\n\t\t$query .= JeproshopShopModelShop::addSqlAssociation('product_attribute') . \" WHERE product_attribute.\" . $db->quoteName('product_id') . \" = \" . (int)$this->product_id;\n\n $db->setQuery($query);\n return $db->loadResult();\n }", "function tep_has_product_attributes($products_id) {\n\t$attributes_query = tep_db_query(\"select count(*) as count from \" . TABLE_PRODUCTS_ATTRIBUTES . \" where products_id = '\" . (int)$products_id . \"'\");\n\t$attributes = tep_db_fetch_array($attributes_query);\n\tif ($attributes['count'] > 0) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "public function hasAttr ($attr) { return $this->hasAttribute($attr); }", "public function hasAttribute(string $attribute): bool\n {\n return array_key_exists($attribute, $this->data);\n }", "private function has_the_attribute($the_attribute){\n\t\t$object_properties=get_object_vars($this);\n\t\t/*\n\t\tThe array_key_exists() function checks an array for a specified key, and returns \n\t\ttrue if the key exists and false if the key does not exist.\n\t\t*/\n\t\t\t/* ##########################################################\n\t\t\tExample:\n\t\t\t$a=array(\"id\"=>\"1\",\"username\"=>\"pablo\",\"password\"=>\"123\");\n\t\t\tif (array_key_exists(\"username\",$a))\n\t\t\t {\n\t\t\t echo \"Key exists!\";\n\t\t\t }\n\t\t\telse\n\t\t\t {\n\t\t\t echo \"Key does not exist!\";\n\t\t\t } \n\t\t\t ########################################################## */\n\t\treturn array_key_exists($the_attribute, $object_properties);\n\t}", "function is_exists_item_attribute_type($s_item_type, $s_attribute_type, $order_no = NULL) {\n\t$query = \"SELECT 'x' FROM s_item_attribute_type \";\n\n\tif (strlen($s_attribute_type) > 0) {\n\t\t$where .= \" s_attribute_type = '\" . $s_attribute_type . \"'\";\n\t\tif (is_numeric($order_no))\n\t\t\t$where .= \" AND order_no = '$order_no'\";\n\t}\n\n\t// Support check for any instances of the s_attribute_type in the s_item_attribute_type table,\n\t// or a specific s_item_type instance if $s_item_type specified.\t\n\tif (strlen($s_item_type) > 0) {\n\t\tif (strlen($s_attribute_type) > 0)\n\t\t\t$where .= \" AND \";\n\t\t$where .= \"s_item_type = '$s_item_type'\";\n\t}\n\n\tif (strlen($where) > 0)\n\t\t$query .= \" WHERE $where \";\n\n\t$result = db_query($query);\n\tif ($result && db_num_rows($result) > 0) {\n\t\tdb_free_result($result);\n\t\treturn TRUE;\n\t}\n\n\t//else\n\treturn FALSE;\n}", "public function has_attribute( $name ) {\n\t\treturn array_key_exists( $name, $this->attributes );\n\t}", "public function has($attribute);", "public function hasAttribute(AttributeValueInterface $attribute);", "public function hasAttribute(): bool\n {\n return isset($this->attribute);\n }", "function attrExists($attrKey) {\n return isset($this->attributes[$attrKey]);\n }", "public function hasAttribute($attr_name)\n {\n return isset($this->attributes[$attr_name]);\n }", "public function hasAttributes() {\n return $this->_has(3);\n }", "public function hasAttributeByName($attributeName);", "public function passes($attribute, $value)\n {\n return Storage::disk(env('HGA_STORAGE_DISK', 's3')->exists($value);\n }", "public static function isInyectedAttribute( $attr )\n {\n return ( strcmp($attr, \"id\") == 0 || strcmp($attr, \"deleted\") == 0 || strcmp($attr, \"class\") == 0 );\n }", "public function hasProductAttributes(): bool\n {\n return ($this->productAttributes()->count() !== 0) ? true : false;\n }", "public function __isset($attribute) {\n return $this->hasAttribute($attribute);\n }", "public function hasAttributes() {\n return $this->_has(9);\n }", "public function hasAttribute($key);", "public function hasAttributes() {\n return $this->_has(2);\n }", "public function hasAttribute($attribute)\n {\n return isset($this->lcAttributeNameMap[strtolower($attribute)]);\n }", "public function hasAttributes() {\n return $this->_has(24);\n }", "public function passes($attribute, $value)\n { \n \n if(Auth::user()->user_type != 'admin'){\n $sku = Product::where('product_sku',$value)->where('seller_id',Auth::user()->id)->first();\n if(!empty($sku)){\n return true;\n }else{\n return false;\n }\n }else{\n return true;\n }\n \n }", "public function hasAttributes() {\n return $this->_has(7);\n }", "public function hasAttributes() {\n return $this->_has(15);\n }", "public function hasAttributes() {\n return $this->_has(15);\n }", "public function hasAttribute ($attr) {\r\n\t\t\r\n\t\tforeach ($this as $node) \r\n\t\t\tif (!$node->attributes->getNamedItem($attr)) return false;\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function hasAttribute($attribute)\n {\n return (isset($this->attributes[$attribute]));\n }", "function attribute($pid, $attribute, $query = array()) {\n \t\tif ($json = $this->_get('/merchants/'.$pid.'/'.$attribute.'.json', $query)) {\n \t\t\t$obj = $this->_parseApi($json);\n \t\t\treturn ( is_object($obj) && isset($obj->merchant->$attribute) )\n \t ? $obj->merchant->$attribute\n \t : false;\n \t\t} else {\n \t\t\treturn false;\n \t\t}\n \t}", "public function hasAttr($key) {\n\t\treturn isset($this->attributes[$key]);\n\t}", "public function attribute($name, $object)\n {\n return \\property_exists($object, $name);\n }", "public function hasAttribute(string $key)\n {\n return isset($this->getAttributes()[$key]);\n }", "public function hasAttribute($name)\n {\n return array_key_exists($name, $this->_attributes);\n }", "public function hasAttribute($name)\n {\n return array_key_exists($name, $this->attributes);\n }", "public function hasAttr(){\n return (is_array($this->attr) && !empty($this->attr));\n }", "public function hasAttribute($name) {\n\t\treturn isset($this->_attributes[$name]);\n\t}", "protected function hasAttribute(string $key): bool\n {\n return in_array($key, $this->getAttributes());\n }", "public function hasAttribute($name)\n {\n $name = htmlspecialchars($name, ENT_QUOTES);\n return array_key_exists($name, $this->attributes);\n }", "public function hasAttribute(string $name): bool;", "function has_attributes() {\n\t\tif (isset($this->attributes) && sizeof($this->attributes)>0) :\n\t\t\tforeach ($this->attributes as $attribute) :\n\t\t\t\tif ($attribute['visible'] == 'yes') return true;\n\t\t\tendforeach;\n\t\tendif;\n\t\treturn false;\n\t}", "public function hasAttribute($key)\n {\n return $this->getAttribute($key) !== null;\n }", "private function is_attribute_exist(Array $attribute = [],$not_strict = true)\n {\n $has_empty = constraint::isThereEmpty($attribute);\n\n if($has_empty) return false;\n\n return $this->database->has('user',\"*\",$attribute);\n\n }", "public function testAssertElementAttributeExists(): void\n {\n $webAssert = $this->createMock(WebAssert::class);\n $webAssert->expects($this->once())->method('elementAttributeExists')->with($this->equalTo('css'), $this->equalTo('a.action_bar__next'));\n\n $trait = $this->getExtraWebAssertMock();\n $trait->expects($this->once())->method('assertSession')->willReturn($webAssert);\n $trait->expects($this->once())->method('fixStepArgument')->with($this->equalTo('disabled'));\n\n $trait->assertElementAttributeExists('a.action_bar__next', 'disabled'); // @phpstan-ignore-line\n }", "public function isAttributeCodeAlreadyExist($wholedata)\r\n {\r\n $attributes = $this->_objectManager->get('Magento\\Catalog\\Model\\Product')->getAttributes();\r\n $allattrcodes = [];\r\n foreach ($attributes as $a) {\r\n $allattrcodes[] = $a->getEntityType()->getAttributeCodes();\r\n }\r\n\r\n $this->_logger->info('####### Seller Attribute Log : allattrcodes: '.json_encode($allattrcodes));\r\n\r\n if (!empty($allattrcodes)) {\r\n if (!empty($allattrcodes) && in_array($wholedata['attribute_code'], $allattrcodes)) {\r\n $this->messageManager->addError( __('Attribute Code already exists'));\r\n return $this->resultRedirectFactory->create()->setPath('*/*/new',\r\n ['_secure' => $this->getRequest()->isSecure()]\r\n );\r\n }\r\n }\r\n }", "public function supportsAttribute($attribute);", "function wp_kses_attr_check(&$name, &$value, &$whole, $vless, $element, $allowed_html)\n {\n }", "protected function getIsCustomAttribute()\n {\n return !$this->is_organizational;\n }", "function create_product_attribute( $label_name ) {\n global $wpdb;\n\n $slug = sanitize_title( $label_name );\n\n if ( strlen( $slug ) >= 28 ) {\n return new WP_Error( 'invalid_product_attribute_slug_too_long', sprintf( __( 'Name \"%s\" is too long (28 characters max). Shorten it, please.', 'woocommerce' ), $slug ), array( 'status' => 400 ) );\n } elseif ( wc_check_if_attribute_name_is_reserved( $slug ) ) {\n return new WP_Error( 'invalid_product_attribute_slug_reserved_name', sprintf( __( 'Name \"%s\" is not allowed because it is a reserved term. Change it, please.', 'woocommerce' ), $slug ), array( 'status' => 400 ) );\n } elseif ( taxonomy_exists( wc_attribute_taxonomy_name( $label_name ) ) ) {\n return new WP_Error( 'invalid_product_attribute_slug_already_exists', sprintf( __( 'Name \"%s\" is already in use. Change it, please.', 'woocommerce' ), $label_name ), array( 'status' => 400 ) );\n }\n\n $data = array(\n 'attribute_label' => $label_name,\n 'attribute_name' => $slug,\n 'attribute_type' => 'select',\n 'attribute_orderby' => 'menu_order',\n 'attribute_public' => 0, // Enable archives ==> true (or 1)\n );\n\n $results = $wpdb->insert( \"{$wpdb->prefix}woocommerce_attribute_taxonomies\", $data );\n\n if ( is_wp_error( $results ) ) {\n return new WP_Error( 'cannot_create_attribute', $results->get_error_message(), array( 'status' => 400 ) );\n } else {\n\t\twisync_admin_notice__success( 'Created ' . $label_name . ' as Product Attribute.' );\n\t}\n\n $id = $wpdb->insert_id;\n\n do_action('woocommerce_attribute_added', $id, $data);\n\n wp_schedule_single_event( time(), 'woocommerce_flush_rewrite_rules' );\n\n delete_transient('wc_attribute_taxonomies');\n}", "function is_installed()\n{\n return has_account() && has_meta();\n}", "public function hasAttribute($name)\n {\n return isset($this->attributes[$name]);\n }", "protected abstract function supportsAttribute($attribute);", "public function hasAttribute ($name)\n {\n\n return isset($this->attributes[$name]);\n\n }", "public function has(string $name): bool {\n $name = str_replace([\"-\", \" \"], \"_\", strtolower($name));\n return isset($this->attributes[$name]);\n }", "public function hasAttribute($name)\n {\n $attribute = $this->getAttribute($name);\n if (!is_null($attribute)) {\n return true;\n } else {\n return false;\n }\n }", "public function attributeExists($attributeName) {\n\t\treturn in_array($attributeName, $this->getAttributeNames(), true);\n\t}", "function mkdf_re_is_woocommerce_installed() {\n\t\treturn function_exists('is_woocommerce');\n\t}", "public function passes($attribute, $value)\n {\n // get collection of supplier products\n $products = Product::where('supplier_id', $this->supplier_id)->get();\n\n // if the product already exists and is the current product the all is well\n\n // dd($this->product_id == $id);\n\n\n // if the products collection contains the value (product name)\n if ($products->contains('name', $value)) {\n return false; // is unique\n } else {\n return true;\n }\n }", "public function hasAttribute($name)\n {\n return $this->node->hasAttribute($name);\n }", "private function prepareExistCondition($attribute)\n {\n $this->filter->addMust(new Exists($attribute));\n }", "public function has($attribute = null) {\n return $this->hasAttribute($attribute);\n }", "public function __isset($attribute)\n {\n if (empty($this->attributes[$attribute]) === false) {\n return true;\n } else {\n return false;\n }\n }", "static function objectHasAttribute($attributeName)\n {\n try {\n return call_user_func_array('PHPUnit_Framework_Assert::objectHasAttribute', func_get_args());\n } catch (\\Exception $e) {\n self::callSlack($e, debug_backtrace()[1]);\n }\n }", "public function hasAttribute(string $name): bool {\n return isset($this->attributes[$name]);\n }", "private function isAttributeAvailable($sKey)\n {\n $bReturn = empty($sKey);\n if ($bReturn) {\n $aResponse = $this->getResponseObject();\n $bReturn = isset($aResponse[$sKey]);\n }\n\n return $bReturn;\n }", "public function attributeExists ( $name ) {\n\n return $this->getStream()->attributeExists($name);\n }", "public function offsetExists($attribute)\n {\n return isset($this->attributeList[$attribute]);\n }", "public function checkAttrName(Request $request){\n $attrId = $request->attr_id;\n if(isset($attrId) && !empty($attrId)){\n $data = ProductAttributeList::where('attribute_name',$request->attrName)->where('id','!=',$attrId)->get();\n if(count($data) > 0){\n $responce = 1;\n }else{\n $responce = 0;\n }\n }else{\n $data = ProductAttributeList::where('attribute_name',$request->attrName)->get();\n if(count($data) > 0){\n $responce = 1;\n }else{\n $responce = 0;\n }\n }\n echo $responce;\n }", "public function passes($attribute, $value)\n {\n return $this->templateRepository->where(['id' => $value])->has('products')->exists();\n }", "function is_exists_s_atribute_type_lookup($s_attribute_type, $value) {\n\t$query = \"SELECT 'x' FROM s_attribute_type_lookup WHERE s_attribute_type = '\" . $s_attribute_type . \"' AND value = '$value'\";\n\n\t$result = db_query($query);\n\tif ($result && db_num_rows($result) > 0) {\n\t\tdb_free_result($result);\n\t\treturn TRUE;\n\t}\n\n\t//else\n\treturn FALSE;\n}", "public function createCustomAttributes() {\n if ($this->customAttributesExists() === true) {\n return false;\n } else {\n // # Otherwise, get missing attributes...\n $missingAttributes = $this->customAttributesExists();\n\n // # ...and generate them\n foreach ($missingAttributes as $key => $value) {\n $this->post('custom-attributes', ['name' => $key, 'attributeType' => 'client', 'clientZoneVisible' => false]);\n }\n $attributes = $this->get('custom-attributes');\n\n // # They should exist now which returns true and should not be an array\n if ($this->customAttributesExists() === true) {\n return true;\n } else {\n return false;\n // # ...Log error if they don't\n $this->log->appendLog('failed to create custom attributes');\n }\n\n }\n }", "public static function attributeExists(Attribute $data) {\n $model = self::_getDataType();\n $pId = $data->getId();\n if($pId > 0) {\n return parent::dbRecordExists($data);\n } elseif((string) $data->getName() !== '') {\n $att = self::getAttributeByName($data->getName());\n return (boolean) ($att instanceof Attribute);\n } else {\n throw new \\Exception(__METHOD__.\" requires valid/populated model as input\");\n }\n }", "function has_term_meta($term_id)\n {\n }", "public function isAttributeExists($path)\n {\n $attributes = $this->toArray();\n $path = explode('.',$path);\n if (isset($attributes[$path[0]])) {\n $current = $attributes[array_shift($path)];\n foreach ($path as $key) {\n if (isset($current[$key])) {\n $current = $current[$key];\n }\n else {\n return false;\n }\n }\n return true;\n }\n else {\n return false;\n }\n }", "function taxonomy_is_movie_attribute( $name ) {\n global $masvideos_attributes;\n\n return taxonomy_exists( $name ) && array_key_exists( $name, (array) $masvideos_attributes['movie'] );\n }", "function fiorello_mikado_is_woocommerce_installed() {\n\t\treturn function_exists( 'is_woocommerce' );\n\t}", "public function hasAttribute($name)\n {\n return isset($this->_attributes[$name]) || in_array($name, $this->attributes(), true);\n }", "private function is_funciri_attribute($tag, $attr)\n {\n return in_array($attr, array('fill', 'filter', 'stroke', 'marker-start',\n 'marker-end', 'marker-mid', 'clip-path', 'mask', 'cursor'));\n }" ]
[ "0.7200829", "0.7175731", "0.70277655", "0.7022301", "0.692628", "0.6925516", "0.69093", "0.68910885", "0.6890273", "0.6890273", "0.68658876", "0.683178", "0.6830776", "0.68295896", "0.6822011", "0.68069726", "0.67374915", "0.6716291", "0.6646707", "0.6591785", "0.64914155", "0.6490357", "0.64892054", "0.6425508", "0.634637", "0.6320293", "0.6292556", "0.62484777", "0.62437314", "0.62260115", "0.6154674", "0.6136992", "0.6100072", "0.609409", "0.6074364", "0.6065832", "0.60642254", "0.6044298", "0.60417736", "0.6007733", "0.60023683", "0.5994231", "0.5964928", "0.59319013", "0.5910464", "0.59065586", "0.5905299", "0.5901484", "0.5901484", "0.5895794", "0.58783334", "0.58735466", "0.5855936", "0.58458954", "0.5814302", "0.58037406", "0.5794162", "0.57926494", "0.5773795", "0.5771668", "0.57694745", "0.57641786", "0.57556045", "0.5754386", "0.57422", "0.5739708", "0.5739421", "0.5736637", "0.572687", "0.57184905", "0.57163817", "0.5690704", "0.5681334", "0.56746936", "0.56640434", "0.5663388", "0.5653839", "0.56532675", "0.5646905", "0.56338114", "0.5633136", "0.5628625", "0.562795", "0.5627649", "0.56258833", "0.5624148", "0.5621925", "0.56155014", "0.5601127", "0.5579422", "0.55714303", "0.5566192", "0.55431426", "0.5542713", "0.55399394", "0.5537182", "0.552957", "0.5525813", "0.5521403", "0.54959506" ]
0.7753385
0
/ / Create a WooCommerce Product Attribute /
function create_product_attribute( $label_name ) { global $wpdb; $slug = sanitize_title( $label_name ); if ( strlen( $slug ) >= 28 ) { return new WP_Error( 'invalid_product_attribute_slug_too_long', sprintf( __( 'Name "%s" is too long (28 characters max). Shorten it, please.', 'woocommerce' ), $slug ), array( 'status' => 400 ) ); } elseif ( wc_check_if_attribute_name_is_reserved( $slug ) ) { return new WP_Error( 'invalid_product_attribute_slug_reserved_name', sprintf( __( 'Name "%s" is not allowed because it is a reserved term. Change it, please.', 'woocommerce' ), $slug ), array( 'status' => 400 ) ); } elseif ( taxonomy_exists( wc_attribute_taxonomy_name( $label_name ) ) ) { return new WP_Error( 'invalid_product_attribute_slug_already_exists', sprintf( __( 'Name "%s" is already in use. Change it, please.', 'woocommerce' ), $label_name ), array( 'status' => 400 ) ); } $data = array( 'attribute_label' => $label_name, 'attribute_name' => $slug, 'attribute_type' => 'select', 'attribute_orderby' => 'menu_order', 'attribute_public' => 0, // Enable archives ==> true (or 1) ); $results = $wpdb->insert( "{$wpdb->prefix}woocommerce_attribute_taxonomies", $data ); if ( is_wp_error( $results ) ) { return new WP_Error( 'cannot_create_attribute', $results->get_error_message(), array( 'status' => 400 ) ); } else { wisync_admin_notice__success( 'Created ' . $label_name . ' as Product Attribute.' ); } $id = $wpdb->insert_id; do_action('woocommerce_attribute_added', $id, $data); wp_schedule_single_event( time(), 'woocommerce_flush_rewrite_rules' ); delete_transient('wc_attribute_taxonomies'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_product_attribute_term( $term_name, $attribute_name ) {\n\tif ( wp_insert_term( $term_name, $attribute_name ) ) {\n\t\twisync_admin_notice__success( $term_name . ' added to Product Attributes.' );\n\t} else {\n\t\twisync_admin_notice__error( 'Failed to add ' . $term_name . ' to Product Attributes.' );\n\t}\n}", "public function addAttributes($post_id)\n\t{\n\t\t$attr = 'custom';\n\t\t\n\t\twp_set_object_terms($post_id, '0', $attr);\n\n $thedata[sanitize_title($attr)] = array(\n \t'name' => wc_clean($attr),\n 'value' => '0',\n 'postion' => '0',\n 'is_visible' => '0',\n 'is_variation' => '1',\n 'is_taxonomy' => '1'\n );\n \n\t\tupdate_post_meta($post_id, '_product_attributes', $thedata);\n\t\t\t\t\t\t\n\t}", "public function add_attribute($post_id, $key, $value) \n\t { \n\t global $wpdb;\n\t global $woocommerce;\n\t\t\t \n\t // get attribute name, label\n\t if ( isset($this->amz_settings['attr_title_normalize']) && $this->amz_settings['attr_title_normalize'] == 'yes' )\n\t \t$attribute_label = $this->attrclean_splitTitle( $key );\n\t\t\telse\n\t\t\t\t$attribute_label = $key;\n\t $attribute_name = $this->the_plugin->cleanTaxonomyName($key, false);\n\n\t // set attribute type\n\t $attribute_type = 'select';\n\t \n\t // check for duplicates\n\t $attribute_taxonomies = $wpdb->get_var(\"SELECT * FROM {$wpdb->prefix}woocommerce_attribute_taxonomies WHERE attribute_name = '\".esc_sql($attribute_name).\"'\");\n\t \n\t if ($attribute_taxonomies) {\n\t // update existing attribute\n\t $wpdb->update(\n $wpdb->prefix . 'woocommerce_attribute_taxonomies', array(\n\t\t 'attribute_label' => $attribute_label,\n\t\t 'attribute_name' => $attribute_name,\n\t\t 'attribute_type' => $attribute_type,\n\t\t 'attribute_orderby' => 'name'\n ), array('attribute_name' => $attribute_name)\n\t );\n\t } else {\n\t // add new attribute\n\t $wpdb->insert(\n\t $wpdb->prefix . 'woocommerce_attribute_taxonomies', array(\n\t \t'attribute_label' => $attribute_label,\n\t \t'attribute_name' => $attribute_name,\n\t \t'attribute_type' => $attribute_type,\n\t \t'attribute_orderby' => 'name'\n\t )\n\t );\n\t }\n\n\t // avoid object to be inserted in terms\n\t if (is_object($value))\n\t return;\n\t\n\t // add attribute values if not exist\n\t $taxonomy = $this->the_plugin->cleanTaxonomyName($attribute_name);\n\t\t\t\n\t if( is_array( $value ) )\n\t {\n\t $values = $value;\n\t }\n\t else\n\t {\n\t $values = array($value);\n\t }\n \n\t // check taxonomy\n\t if( !taxonomy_exists( $taxonomy ) ) \n\t {\n\t // add attribute value\n\t foreach ($values as $attribute_value) {\n\t \t$attribute_value = (string) $attribute_value;\n\n\t if (is_string($attribute_value)) {\n\t // add term\n\t //$name = stripslashes($attribute_value);\n\t\t\t\t\t\t$name = $this->the_plugin->cleanValue( $attribute_value ); // 2015, october 28 - attributes bug update!\n\t $slug = sanitize_title($name);\n\t\t\t\t\t\t\n\t if( !term_exists($name) ) {\n\t if( trim($slug) != '' && trim($name) != '' ) {\n\t \t$this->the_plugin->db_custom_insert(\n\t \t\t$wpdb->terms,\n\t \t\tarray(\n\t \t\t\t'values' => array(\n\t\t \t'name' => $name,\n\t\t \t'slug' => $slug\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t'format' => array(\n\t\t\t\t\t\t\t\t\t\t\t'%s', '%s'\n\t\t\t\t\t\t\t\t\t\t)\n\t \t\t),\n\t \t\ttrue\n\t \t);\n\t /*$wpdb->insert(\n $wpdb->terms, array(\n\t\t 'name' => $name,\n\t\t 'slug' => $slug\n )\n\t );*/\n\t\n\t // add term taxonomy\n\t $term_id = $wpdb->insert_id;\n\t \t$this->the_plugin->db_custom_insert(\n\t \t\t$wpdb->term_taxonomy,\n\t \t\tarray(\n\t \t\t\t'values' => array(\n\t\t \t'term_id' => $term_id,\n\t\t \t'taxonomy' => $taxonomy\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t'format' => array(\n\t\t\t\t\t\t\t\t\t\t\t'%d', '%s'\n\t\t\t\t\t\t\t\t\t\t)\n\t \t\t),\n\t \t\ttrue\n\t \t);\n\t /*$wpdb->insert(\n $wpdb->term_taxonomy, array(\n\t\t 'term_id' => $term_id,\n\t\t 'taxonomy' => $taxonomy\n )\n\t );*/\n\t\t\t\t\t\t\t\t$term_taxonomy_id = $wpdb->insert_id;\n\t\t\t\t\t\t\t\t$__dbg = compact('taxonomy', 'attribute_value', 'term_id', 'term_taxonomy_id');\n\t\t\t\t\t\t\t\t//var_dump('<pre>1: ',$__dbg,'</pre>');\n\t }\n\t } else {\n\t // add term taxonomy\n\t $term_id = $wpdb->get_var(\"SELECT term_id FROM {$wpdb->terms} WHERE name = '\".esc_sql($name).\"'\");\n\t $this->the_plugin->db_custom_insert(\n\t \t$wpdb->term_taxonomy,\n\t \tarray(\n\t \t\t'values' => array(\n\t\t \t\t'term_id' => $term_id,\n\t\t \t\t'taxonomy' => $taxonomy\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'format' => array(\n\t\t\t\t\t\t\t\t\t\t'%d', '%s'\n\t\t\t\t\t\t\t\t\t)\n\t \t),\n\t \ttrue\n\t );\n\t /*$wpdb->insert(\n \t\t$wpdb->term_taxonomy, array(\n\t\t 'term_id' => $term_id,\n\t\t 'taxonomy' => $taxonomy\n )\n\t );*/\n\t\t\t\t\t\t\t$term_taxonomy_id = $wpdb->insert_id;\n\t\t\t\t\t\t\t$__dbg = compact('taxonomy', 'attribute_value', 'term_id', 'term_taxonomy_id');\n\t\t\t\t\t\t\t//var_dump('<pre>1c: ',$__dbg,'</pre>');\n\t }\n\t }\n\t }\n\t }\n\t else \n\t {\n\t // get already existing attribute values\n\t $attribute_values = array();\n\t /*$terms = get_terms($taxonomy, array('hide_empty' => true));\n\t\t\t\tif( !is_wp_error( $terms ) ) {\n\t \tforeach ($terms as $term) {\n\t \t$attribute_values[] = $term->name;\n\t \t}\n\t\t\t\t} else {\n\t\t\t\t\t$error_string = $terms->get_error_message();\n\t\t\t\t\tvar_dump('<pre>',$error_string,'</pre>'); \n\t\t\t\t}*/\n\t\t\t\t$terms = $this->the_plugin->load_terms($taxonomy);\n\t foreach ($terms as $term) {\n\t \t$attribute_values[] = $term->name;\n\t }\n\t \n\t // Check if $attribute_value is not empty\n\t if( !empty( $attribute_values ) )\n\t {\n\t foreach( $values as $attribute_value ) \n\t {\n\t \t$attribute_value = (string) $attribute_value;\n\t\t\t\t\t\t$attribute_value = $this->the_plugin->cleanValue( $attribute_value ); // 2015, october 28 - attributes bug update!\n\t if( !in_array( $attribute_value, $attribute_values ) ) \n\t {\n\t // add new attribute value\n\t $__term_and_tax = wp_insert_term($attribute_value, $taxonomy);\n\t\t\t\t\t\t\t$__dbg = compact('taxonomy', 'attribute_value', '__term_and_tax');\n\t\t\t\t\t\t\t//var_dump('<pre>1b: ',$__dbg,'</pre>');\n\t }\n\t }\n\t }\n\t }\n\t\n\t // Add terms\n\t if( is_array( $value ) )\n\t {\n\t foreach( $value as $dm_v )\n\t {\n\t \t$dm_v = (string) $dm_v;\n\t if( !is_array($dm_v) && is_string($dm_v)) {\n\t \t$dm_v = $this->the_plugin->cleanValue( $dm_v ); // 2015, october 28 - attributes bug update!\n\t $__term_and_tax = wp_insert_term( $dm_v, $taxonomy );\n\t\t\t\t\t\t$__dbg = compact('taxonomy', 'dm_v', '__term_and_tax');\n\t\t\t\t\t\t//var_dump('<pre>2: ',$__dbg,'</pre>');\n\t }\n\t }\n\t }\n\t else\n\t {\n\t \t$value = (string) $value;\n\t if( !is_array($value) && is_string($value) ) {\n\t \t$value = $this->the_plugin->cleanValue( $value ); // 2015, october 28 - attributes bug update!\n\t $__term_and_tax = wp_insert_term( $value, $taxonomy );\n\t\t\t\t\t$__dbg = compact('taxonomy', 'value', '__term_and_tax');\n\t\t\t\t\t//var_dump('<pre>2b: ',$__dbg,'</pre>');\n\t }\n\t }\n\t\t\t\n\t // link to woocommerce attribute values\n\t if( !empty( $values ) )\n\t {\n\t foreach( $values as $term )\n\t {\n\t \t\n\t if( !is_array($term) && !is_object( $term ) )\n\t { \n\t $term = sanitize_title($term);\n\t \n\t $term_taxonomy_id = $wpdb->get_var( \"SELECT tt.term_taxonomy_id FROM {$wpdb->terms} AS t INNER JOIN {$wpdb->term_taxonomy} as tt ON tt.term_id = t.term_id WHERE t.slug = '\".esc_sql($term).\"' AND tt.taxonomy = '\".esc_sql($taxonomy).\"'\" );\n \n\t if( $term_taxonomy_id ) \n\t {\n\t $checkSql = \"SELECT * FROM {$wpdb->term_relationships} WHERE object_id = {$post_id} AND term_taxonomy_id = {$term_taxonomy_id}\";\n\t if( !$wpdb->get_var($checkSql) ) {\n\t $wpdb->insert(\n\t $wpdb->term_relationships, array(\n\t\t\t 'object_id' => $post_id,\n\t\t\t 'term_taxonomy_id' => $term_taxonomy_id\n\t )\n\t );\n\t }\n\t }\n\t }\n\t }\n\t }\n\t }", "public function createAttribute()\n\t{\n\n\t\t$this->createCustomAttribute($this->attributeName, $this->arguments);\n\n\t}", "function create_product_variation( $product_id, $variation_data ){\n // Get the Variable product object (parent)\n $product = wc_get_product($product_id);\n\n $variation_post = array(\n 'post_title' => $product->get_title(),\n 'post_name' => 'product-'.$product_id.'-variation',\n 'post_status' => 'publish',\n 'post_parent' => $product_id,\n 'post_type' => 'product_variation',\n 'guid' => $product->get_permalink()\n );\n\n // Creating the product variation\n $variation_id = wp_insert_post( $variation_post );\n\n // Get an instance of the WC_Product_Variation object\n $variation = new WC_Product_Variation( $variation_id );\n\n // Iterating through the variations attributes\n foreach ($variation_data['attributes'] as $attribute => $term_name )\n {\n $taxonomy = 'pa_'.$attribute; // The attribute taxonomy\n\n // Check if the Term name exist and if not we create it.\n if( ! term_exists( $term_name, $taxonomy ) )\n wp_insert_term( $term_name, $taxonomy ); // Create the term\n\n $term_slug = get_term_by('name', $term_name, $taxonomy )->slug; // Get the term slug\n\n // Get the post Terms names from the parent variable product.\n $post_term_names = wp_get_post_terms( $product_id, $taxonomy, array('fields' => 'names') );\n\n // Check if the post term exist and if not we set it in the parent variable product.\n if( ! in_array( $term_name, $post_term_names ) )\n wp_set_post_terms( $product_id, $term_name, $taxonomy, true );\n\n // Set/save the attribute data in the product variation\n update_post_meta( $variation_id, 'attribute_'.$taxonomy, $term_slug );\n\n }\n\n ## Set/save all other data\n\n // SKU\n if( ! empty( $variation_data['sku'] ) )\n $variation->set_sku( $variation_data['sku'] );\n\n // Prices\n if( empty( $variation_data['sale_price'] ) ){\n $variation->set_price( $variation_data['regular_price'] );\n } else {\n $variation->set_price( $variation_data['sale_price'] );\n $variation->set_sale_price( $variation_data['sale_price'] );\n }\n $variation->set_regular_price( $variation_data['regular_price'] );\n\n // Stock\n if( ! empty($variation_data['stock_qty']) ){\n $variation->set_stock_quantity( $variation_data['stock_qty'] );\n $variation->set_manage_stock(true);\n $variation->set_stock_status('');\n } else {\n $variation->set_manage_stock(false);\n }\n\n $variation->set_weight(''); // weight (resetting)\n\n $variation->save(); // Save the data\n }", "function elex_bep_create_product_variation( $product_id, $variation_data ) {\n //Get varaible product object parent\n $product = wc_get_product( $product_id );\n //\n $variation_post = array(\n 'post_title' => $product->get_name(),\n 'post_name' => 'product-'.$product_id.'-varation',\n 'post_status' => 'publish',\n 'post_parent' => $product_id,\n 'post_type' => 'product_variation',\n 'guid' => $product->get_permalink()\n );\n\n $variation_id = wp_insert_post( $variation_post );\n $variation = new WC_Product_Variation( $variation_id );\n error_log( $variation_id );\n\n foreach ($variation_data['attributes'] as $attribute => $term_names )\n {\n $taxonomy = 'pa_'.$attribute; // The attribute taxonomy\n\n // If taxonomy doesn't exists we create it (Thanks to Carl F. Corneil)\n if( ! taxonomy_exists( $taxonomy ) ){ \n register_taxonomy(\n $taxonomy, 'product_variation',\n array(\n 'hierarchical' => false,\n 'label' => ucfirst( $attribute ),\n 'query_var' => true,\n 'rewrite' => array( 'slug' => sanitize_title($attribute) ), // The base slug\n )\n );\n }\n foreach( $term_names as $key=> $term_name ){\n error_log( $key. ' '. $term_name );\n // Check if the Term name exist and if not we create it.\n if( ! term_exists( $term_name, $taxonomy ) ){\n wp_insert_term( $term_name, $taxonomy ); // Create the term\n }\n $term_slug = get_term_by('name', $term_name, $taxonomy )->slug; // Get the term slug\n error_log( print_r($term_slug, TRUE ));\n\n // // Get the post Terms names from the parent variable product.\n $post_term_names = wp_get_post_terms( $product_id, $taxonomy, array('fields' => 'names') );\n\n // // Check if the post term exist and if not we set it in the parent variable product.\n if( ! in_array( $term_name, $post_term_names ) )\n wp_set_post_terms( $product_id, $term_name, $taxonomy, true );\n\n // // Set/save the attribute data in the product variation\n update_post_meta( $variation_id, 'attribute_'.$taxonomy, $term_slug );\n }\n }\n if( ! empty( $variation_data['sku'] ) )\n $variation->set_sku( $variation_data['sku'] );\n\n // Prices\n if( empty( $variation_data['sale_price'] ) ){\n $variation->set_price( $variation_data['regular_price'] );\n } else {\n $variation->set_price( $variation_data['sale_price'] );\n $variation->set_sale_price( $variation_data['sale_price'] );\n }\n $variation->set_regular_price( $variation_data['regular_price'] );\n\n // Stock\n if( ! empty($variation_data['stock_qty']) ){\n $variation->set_stock_quantity( $variation_data['stock_qty'] );\n $variation->set_manage_stock(true);\n $variation->set_stock_status('');\n } else {\n $variation->set_manage_stock(false);\n }\n $variation->set_weight(''); // weight (reseting)\n error_log( print_r( $variation, TRUE ));\n $variation->save(); \n}", "public function postCreate()\n {\n \tLog::info(\"postCreate in AttributeController\");\n\n \t$product_id = Input::get('product_id');\n \t\n \t$form = $this->attribute->getForm();\n \n \tLog::info(\"111111111111111111\");\n \tif (! $form->isValid()) {\n \t\tLog::info(\"22222222\");\n \t\treturn $this->redirectRoute('admin.attribute.index')\n \t\t->withErrors($form->getErrors())\n \t\t->withInput();\n \t}\n \tLog::info(\"3333333333333333333\");\n \n \t$attribute = $this->attribute->create($form->getInputData());\n \t\n \t$product = $this->product->findById($product_id);\n \t$product->attributes()->attach($attribute->id);\n \t\n \t$attributes = $this->product->findAttributesById($product_id);\n \t\n \t//var_dump($attributes);\n //\t$attributes = $this->product\n \n \treturn $attributes;\n }", "function filter_woocommerce_rest_prepare_product_object( $response, $object, $request ) {\n if( empty( $response->data ) ) {\n return $response;\n }\n\n $attribute_taxonomies = wc_get_attribute_taxonomies();\n\n // Loop through the attributes on current product\n $attributes = $response->data['attributes'];\n foreach($attributes as $attrkey => $attribute) {\n\n /* ########################################################\n - Adding new swatch key to attribute response for color attributes,\n which holds the hex code for each swatch color option\n ######################################################## */\n // Get an array of attributes whose attribute type is color\n $color_type_attribute_taxonomies = array_filter($attribute_taxonomies, function($attribute_taxonomy) {\n return $attribute_taxonomy->attribute_type == 'color';\n });\n // Loop through the color type attributes\n foreach($color_type_attribute_taxonomies as $tax_object) {\n //Check if current attribute is a color type attribute\n if ($attribute['id'] == $tax_object->attribute_id) {\n // Get current attribute's options\n $options = $response->data['attributes'][$attrkey]['options'];\n // Get current attribute's terms\n $color_terms = get_terms('pa_' . $tax_object->attribute_name);\n foreach( $options as $option ) {\n foreach($color_terms as $term) {\n if ($term->name == $option) {\n // Add a new swatch with hex value for each color option\n $response->data['attributes'][$attrkey]['swatches'][$option] = get_term_meta( $term->term_id, 'product_attribute_color', true);\n }\n }\n }\n }\n }\n\n /* ########################################################\n - Adding attribute taxonomy to the attribute response\n - Adding attribute identifier to the attribute response\n - Adding more detailed option data to the attribute options response\n ######################################################## */\n foreach($attribute_taxonomies as $attribute_taxonomy) {\n if ($attribute['id'] == $attribute_taxonomy->attribute_id) {\n\n /* Add slug to current attribute response */\n $response->data['attributes'][$attrkey]['taxonomy'] = ('pa_' . $attribute_taxonomy->attribute_name);\n\n /* Add attribute identifier to current attribute response */\n $response->data['attributes'][$attrkey]['slug'] = $attribute_taxonomy->attribute_name;\n\n /* Replace default options data with detailed options data for current attribute */\n $options = $response->data['attributes'][$attrkey]['options'];\n $new_options = array();\n $attribute_terms = get_terms('pa_' . $attribute_taxonomy->attribute_name);\n\n foreach( $options as $option ) {\n foreach($attribute_terms as $attribute_term) {\n if ($attribute_term->name == $option) {\n $new_options[] = (object) [\n 'id' => $attribute_term->term_id,\n 'name' => $attribute_term->name,\n 'slug' => $attribute_term->slug,\n 'taxonomy' => $attribute_term->taxonomy,\n 'description' => $attribute_term->description,\n 'count' => $attribute_term->count\n ];\n }\n }\n }\n $response->data['attributes'][$attrkey]['options'] = $new_options;\n }\n }\n }\n\n /* ########################################################\n - Replacing Variation IDs with Variation details\n ######################################################## */\n\n // Get the current product object\n $variation_ids = $response->data['variations'];\n\n $detailed_variations = array_map(function($variation_id) {\n $variation = wc_get_product($variation_id);\n return (object) [\n 'variation_id' => $variation->get_id(),\n 'image_url' => wp_get_attachment_url($variation->get_image_id()),\n 'variation_regular_price' => $variation->get_regular_price(),\n 'variation_sale_price' => $variation->get_sale_price(),\n 'attributes' => $variation->get_attributes(),\n 'is_on_sale' => $variation->is_on_sale()\n ];\n }, $variation_ids);\n\n $response->data['variations'] = $detailed_variations;\n\n\n /* ########################################################\n - Get ALL Variation attributes for a product\n ######################################################## */\n if ($response->data['type'] == 'variable') {\n $variation_attributes = wc_get_product($response->data['id'])->get_variation_attributes();\n $variation_attributes = array_map(function($attribute) {\n return (array_values($attribute));\n }, $variation_attributes);\n $response->data['variation_attributes'] = $variation_attributes;\n }\n\n\n\n /* Return new response */\n return $response;\n}", "public function CreateAttribute($attribute_data,$attribute_set_id){\n\n $attribute_code = $attribute_data['attribute_code'];\n $attribute_name = $attribute_data['attribute_name'];\n $field_type_id = $attribute_data['field_type_id'];\n $input_type = 'text';\n if($field_type_id == 1){\n $input_type = 'select';\n }else if($field_type_id ==4){\n $input_type = 'multiselect';\n }\n\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\".$attribute_code,0);\n\n if(isset($result['message'])){\n\n $data['attribute'] = array(\n \"attribute_code\" => $attribute_code,\n \"frontend_input\" => $input_type,\n \"scope\" => \"global\",\n \"is_unique\" => 0,\n \"is_required\" => 0,\n \"is_searchable\" => 0,\n \"is_visible_in_advanced_search\" => 0,\n \"is_comparable\" => 0,\n \"is_used_for_promo_rules\" => 0,\n \"is_visible_on_front\" => 0,\n \"used_in_product_listing\" => 0,\n \"default_frontend_label\" => $attribute_name,\n \"frontend_labels\" => array(array(\"store_id\" => \"0\", \"label\" => $attribute_name))\n );\n\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\",1,json_encode($data));\n\n $attribute_id = $result['attribute_id'];\n\n }else{\n $attribute_id = $result['attribute_id'];\n }\n\n $result2 = $this->curlRequest(\"/rest/V1/products/attribute-sets/attributes\",1,json_encode([\n \"attributeSetId\" => $attribute_set_id,\n \"attributeCode\" => $attribute_code,\n \"attributeGroupId\" => 130,\n \"sortOrder\" => 0\n ]) );\n\n return $attribute_id;\n\n }", "public function create() {\n\t\tupdate_option( 'woocommerce_calc_taxes', 'yes' );\n\t\tupdate_option( 'woocommerce_prices_include_tax', 'yes' );\n\n\t\t// Create tax rates.\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '25' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '12' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '6' );\n\t\t$this->product = ( new Krokedil_Simple_Product() )->create();\n\t}", "public function create(array $data) : OrderProductAttribute;", "public function createAttributes()\n {\n /** @var \\Shopware\\Components\\Model\\ModelManager $em */\n $em = $this->get('models');\n\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'link',\n 'int(11)',\n true,\n null\n );\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'show_by_default',\n 'int(1)',\n true,\n 0\n );\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'deleted_position',\n 'int(11)',\n true,\n null\n );\n\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'base_sort',\n 'int(11)',\n true,\n null\n );\n\n $em->generateAttributeModels(['s_categories_attributes']);\n }", "public function testInsertProductAttribute()\n\t{\n\t\t$repository = new ProductRepository();\n\t\t$product = $repository->getProduct(1);\n\n\t\t// Update a global attribute, just to check that update works\n\t\t// Global = applies to all categories\n\t\t$product->attributes[self::ATTRIBUTE_URL] = \"some-slug\";\n\t\t$repository->updateProduct($product);\n\n\t\t$new_product = $repository->getProduct(1);\n\n\t\t$this->assertEquals(1, count($new_product->attributes));\n\t\t$this->assertEquals(\"some-slug\", $new_product->attributes[self::ATTRIBUTE_URL]);\n\t}", "public function addProductAttr($post)\r\n\t{\r\n\t\t$this->db->insert('tbl_product_attr', $post);\r\n\t\t$this->result = $this->db->insert_id() ; \r\n\t\treturn $this->result ;\r\n\t}", "public function createnewproduct()\n {\n Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);\n $product = Mage::getModel('catalog/product');\n $websiteId = Mage::app()->getWebsite('base')->getId();\n $storeId = Mage::app()->getStore('default')->getId();\n\n //Set SKU dynamically over here\n $collection = Mage::getModel('catalog/product')\n ->getCollection()\n ->addAttributeToSort('created_at', 'desc');\n $collection->getSelect()->limit(1);\n $latestItemId = $collection->getLastItem()->getId();\n if($latestItemId) {\n $nextProid = $latestItemId + 1;\n } else {\n $nextProid = 1;\n }\n $SampleSKU = 'titechPro'.$nextProid;\n\n try {\n $product\n ->setStoreId($storeId) //you can set data in store scope\n ->setWebsiteIds(array($websiteId)) //website ID the product is assigned to, as an array\n ->setAttributeSetId(4) //ID of a attribute set named 'default'\n ->setTypeId('simple') //product type\n ->setCreatedAt(strtotime('now')) //product creation time\n ->setUpdatedAt(strtotime('now')) //product update time\n ->setSku($SampleSKU) //SKU\n ->setName('Titech sample product') //product name\n ->setWeight(4.0000)\n ->setStatus(1) //product status (1 - enabled, 2 - disabled)\n ->setTaxClassId(4) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)\n ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH) //catalog and search visibility\n //->setManufacturer(28) //manufacturer id\n //->setColor(24)\n //->setNewsFromDate('06/26/2014') //product set as new from\n //->setNewsToDate('06/30/2014') //product set as new to\n ->setCountryOfManufacture('IN') //country of manufacture (2-letter country code)\n ->setPrice(11.22) //price in form 11.22\n ->setCost(22.33) //price in form 11.22\n //->setSpecialPrice(00.44) //special price in form 11.22\n //->setSpecialFromDate('06/1/2014') //special price from (MM-DD-YYYY)\n //->setSpecialToDate('06/30/2014') //special price to (MM-DD-YYYY)\n ->setMsrpEnabled(1) //enable MAP\n ->setMsrpDisplayActualPriceType(1) //display actual price (1 - on gesture, 2 - in cart, 3 - before order confirmation, 4 - use config)\n ->setMsrp(99.99) //Manufacturer's Suggested Retail Price\n ->setMetaTitle('Sample meta title 2')\n ->setMetaKeyword('Sample meta keyword 2')\n ->setMetaDescription('Sample meta description 2')\n ->setDescription('This is a long description for sample product')\n ->setShortDescription('This is a short description for sample product')\n ->setMediaGallery (array('images'=>array (), 'values'=>array ())) //media gallery initialization\n ->addImageToMediaGallery('media/catalog/product/ti/ti_logo.png', array('image','thumbnail','small_image'), false, false) //assigning image, thumb and small image to media gallery\n ->setStockData(array(\n 'use_config_manage_stock' => 0, //'Use config settings' checkbox\n 'manage_stock'=>1, //manage stock\n 'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart\n 'max_sale_qty'=>2, //Maximum Qty Allowed in Shopping Cart\n 'is_in_stock' => 1, //Stock Availability\n 'qty' => 999 //qty\n )\n )\n ->setCategoryIds(array(2)); //assign product to categories - Set to Default\n\n $product->save();\n return $product->getIdBySku($SampleSKU);\n } catch(Exception $e) {\n Mage::log($e->getMessage());\n }\n }", "function AddAttribute() {\n $db = Core::GetDB();\n\n $id = Core::GetFromPOST('id');\n $attrs = Core::GetFromPOST('attrs');\n\n $attrs = fix_attrs($attrs);\n\n foreach ($attrs AS $attr) {\n $attr = explode(':', $attr);\n\n if (count($attr) == 3) {\n if (empty($attr) === false) {\n $db->Query(\"DELETE FROM data_xml_attributes WHERE data_xml_item_id = $id AND attr_name='{$attr[0]}' LIMIT 1\");\n $db->Query(\"INSERT INTO data_xml_attributes (data_xml_item_id, attr_name, attr_value, attr_type) VALUES ($id, '{$attr[0]}', '{$attr[1]}', '{$attr[2]}')\");\n }\n }\n }\n}", "private function saveProductAttributeValues($product, $variant) // ..\n {\n foreach (array_values($variant) as $attributeOptionID) {\n $attributeOption = AttributeOption::find($attributeOptionID);\n\n $attributeValueParams = [\n 'product_id' => $product->id,\n 'attribute_id' => $attributeOption->attribute_id,\n 'text_value' => $attributeOption->name,\n ];\n\n ProductAttributeValue::create($attributeValueParams);\n }\n }", "public function testAdministerProductAttributes() {\n $this->drupalGet('admin/commerce/product-attributes/add');\n $this->assertSession()->statusCodeEquals(200);\n\n $this->submitForm([\n 'id' => 'colors_id',\n 'label' => 'Color Names',\n 'elementLabel' => 'Choose Color',\n ], 'Save');\n\n $this->assertSession()->pageTextContains('Created the Color Names product attribute.');\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/product-attributes\\/manage\\/colors_id$/');\n $attribute = ProductAttribute::load('colors_id');\n // Check if elementLabel is saved and then diplayed as the default value.\n $this->assertEquals('Choose Color', $attribute->getElementLabel());\n $elementLabel = $this->getSession()->getPage()->findField('elementLabel')->getValue();\n $this->assertEquals('Choose Color', $elementLabel);\n\n $colors = [\n [\n 'attribute' => 'colors_id',\n 'name' => 'Red',\n 'weight' => 1,\n ],\n [\n 'attribute' => 'colors_id',\n 'name' => 'ForestGreen',\n 'weight' => 2,\n ],\n [\n 'attribute' => 'colors_id',\n 'name' => 'Blue',\n 'weight' => 3,\n ],\n ];\n\n foreach ($colors as $values) {\n $this->createEntity('commerce_product_attribute_value', $values);\n }\n\n $this->drupalGet('admin/commerce/product-attributes/add');\n $this->assertSession()->statusCodeEquals(200);\n\n $this->submitForm([\n 'id' => 'sizes_id',\n 'label' => 'Size Names',\n 'elementLabel' => 'Choose Size',\n ], 'Save');\n\n $this->assertSession()->pageTextContains('Created the Size Names product attribute.');\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/product-attributes\\/manage\\/sizes_id$/');\n $attribute = ProductAttribute::load('sizes_id');\n $this->assertEquals('Choose Size', $attribute->getElementLabel());\n $elementLabel = $this->getSession()->getPage()->findField('elementLabel')->getValue();\n $this->assertEquals('Choose Size', $elementLabel);\n\n foreach (range(1, 102) as $i) {\n $values = [\n 'attribute' => 'sizes_id',\n 'name' => $i,\n 'weight' => $i,\n ];\n $this->createEntity('commerce_product_attribute_value', $values);\n }\n\n $this->drupalGet('admin/commerce/product-attributes');\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->pageTextContains('colors_id');\n $this->assertSession()->pageTextContains('Color Names');\n $this->assertSession()->pageTextContains('Choose Color');\n $this->assertSession()->pageTextContains('sizes_id');\n $this->assertSession()->pageTextContains('Size Names');\n $this->assertSession()->pageTextContains('Choose Size');\n // Attribute names are truncated if they exceed 10 characters.\n $this->assertSession()->pageTextContains('Red, ForestGre…, Blue');\n // Only one hundred attribute names can be displayed. A counter (N more\n // values…) displayed for all the rest of the names.\n $this->assertSession()->pageTextContains('1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 (2 more values…)');\n\n $this->drupalGet('admin/commerce/config/product-variation-types/default/edit');\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->pageTextContains('Color Names');\n $this->assertSession()->linkNotExistsExact('Color Names');\n $this->assertSession()->pageTextContains('Size Names');\n $this->assertSession()->linkNotExistsExact('Size Names');\n $this->assertSession()->linkExistsExact('colors_id');\n $this->assertSession()->linkExistsExact('sizes_id');\n\n $this->getSession()->getPage()->clickLink('colors_id');\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/product-attributes\\/manage\\/colors_id$/');\n\n $this->drupalGet('admin/commerce/config/product-variation-types/default/edit');\n $this->assertSession()->statusCodeEquals(200);\n $this->submitForm([\n 'attributes[colors_id]' => 'colors_id',\n 'attributes[sizes_id]' => 'sizes_id',\n ], t('Save'));\n\n $this->drupalGet('admin/commerce/config/product-variation-types/default/edit');\n $this->assertSession()->statusCodeEquals(200);\n // Now 'Color Names' and 'Size Names' should turn into links with\n // 'Choose Color' and 'Choose Size' elementLabel text.\n $this->assertSession()->linkExistsExact('Choose Color');\n $this->assertSession()->linkExistsExact('Choose Size');\n $this->assertSession()->linkExistsExact('colors_id');\n $this->assertSession()->linkExistsExact('sizes_id');\n\n $this->getSession()->getPage()->clickLink('Choose Color');\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/config\\/product-variation-types\\/default\\/edit\\/fields\\/commerce_product_variation\\.default\\.attribute_colors_id$/');\n $this->submitForm([\n 'label' => 'My Color',\n ], t('Save settings'));\n\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/config\\/product-variation-types\\/default\\/edit\\/fields$/');\n $this->assertSession()->pageTextContains('My Color', 'The customer facing label is changed on the default variation type attribute field');\n\n $this->drupalGet('admin/commerce/config/product-variation-types/default/edit');\n $this->assertSession()->statusCodeEquals(200);\n // After the 'Choose Color' is changed the link text should also be changed\n // to 'My Color' elementLabel text.\n $this->assertSession()->linkExistsExact('My Color');\n $this->assertSession()->linkExistsExact('Choose Size');\n $this->assertSession()->linkExistsExact('colors_id');\n $this->assertSession()->linkExistsExact('sizes_id');\n }", "public function createAttributes($pid,&$item,$attmap,$isnew)\n\t{\n\t\t/**\n\t\t * get all store ids\n\t\t */\n\t\t$this->_extra_attrs=array();\n\t\t/* now is the interesring part */\n\t\t/* iterate on attribute backend type index */\n\t\tforeach($attmap as $tp=>$a)\n\t\t{\n\t\t\t/* for static types, do not insert into attribute tables */\n\t\t\tif($tp==\"static\")\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//table name for backend type data\n\t\t\t$cpet=$this->tablename(\"catalog_product_entity_$tp\");\n\t\t\t//data table for inserts\n\t\t\t$data=array();\n\t\t\t//inserts to perform on backend type eav\n\t\t\t$inserts=array();\n\t\t\t//deletes to perform on backend type eav\n\t\t\t$deletes=array();\n\n\t\t\t//use reflection to find special handlers\n\t\t\t$typehandler=\"handle\".ucfirst($tp).\"Attribute\";\n\t\t\t//iterate on all attribute descriptions for the given backend type\n\t\t\tforeach($a[\"data\"] as $attrdesc)\n\t\t\t{\n\t\t\t\t//get attribute id\n\t\t\t\t$attid=$attrdesc[\"attribute_id\"];\n\t\t\t\t//get attribute value in the item to insert based on code\n\t\t\t\t$atthandler=\"handle\".ucfirst($attrdesc[\"attribute_code\"]).\"Attribute\";\n\t\t\t\t$attrcode=$attrdesc[\"attribute_code\"];\n\t\t\t\t//if the attribute code is no more in item (plugins may have come into the way), continue\n\t\t\t\tif(!in_array($attrcode,array_keys($item)))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t//get the item value\n\t\t\t\t$ivalue=$item[$attrcode];\n\t\t\t\t//get item store id for the current attribute\n\t\t\t\t$store_ids=$this->getItemStoreIds($item,$attrdesc[\"is_global\"]);\n\n\n\t\t\t\t//do not handle empty generic int values in create mode\n\t\t\t\tif($ivalue==\"\" && $this->mode!=\"update\" && $tp==\"int\")\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t//for all store ids\n\t\t\t\tforeach($store_ids as $store_id)\n\t\t\t\t{\n\n\t\t\t\t\t//base output value to be inserted = base source value\n\t\t\t\t\t$ovalue=$ivalue;\n\t\t\t\t\t//check for attribute handlers for current attribute\n\t\t\t\t\tforeach($this->_attributehandlers as $match=>$ah)\n\t\t\t\t\t{\n\t\t\t\t\t\t$matchinfo=explode(\":\",$match);\n\t\t\t\t\t\t$mtype=$matchinfo[0];\n\t\t\t\t\t\t$mtest=$matchinfo[1];\n\t\t\t\t\t\tunset($matchinfo);\n\t\t\t\t\t\tunset($hvalue);\n\t\t\t\t\t\tif(preg_match(\"/$mtest/\",$attrdesc[$mtype]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if there is a specific handler for attribute, use it\n\t\t\t\t\t\t\tif(method_exists($ah,$atthandler))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hvalue=$ah->$atthandler($pid,$item,$store_id,$attrcode,$attrdesc,$ivalue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t//use generic type attribute\n\t\t\t\t\t\t\tif(method_exists($ah,$typehandler))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hvalue=$ah->$typehandler($pid,$item,$store_id,$attrcode,$attrdesc,$ivalue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//if handlers returned a value that is not \"__MAGMI_UNHANDLED__\" , we have our output value\n\t\t\t\t\t\t\tif(isset($hvalue) && $hvalue!=\"__MAGMI_UNHANDLED__\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ovalue=$hvalue;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if __MAGMI_UNHANDLED__ ,don't insert anything\n\t\t\t\t\tif($ovalue==\"__MAGMI_UNHANDLED__\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$ovalue=false;\n\t\t\t\t\t}\n\t\t\t\t\t//if handled value is a \"DELETE\"\n\t\t\t\t\tif($ovalue==\"__MAGMI_DELETE__\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$deletes[]=$attid;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t//if we have something to do with this value\n\t\t\t\t\tif($ovalue!==false)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$data[]=$this->prod_etype;\n\t\t\t\t\t\t$data[]=$attid;\n\t\t\t\t\t\t$data[]=$store_id;\n\t\t\t\t\t\t$data[]=$pid;\n\t\t\t\t\t\t$data[]=$ovalue;\n\t\t\t\t\t\t$insstr=\"(?,?,?,?,?)\";\n\t\t\t\t\t\t$inserts[]=$insstr;\n\t\t\t\t\t}\n\n\t\t\t\t\t//if one of the store in the list is admin\n\t\t\t\t\tif($store_id==0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sids=$store_ids;\n\t\t\t\t\t\t//remove all values bound to the other stores for this attribute,so that they default to \"use admin value\"\n\t\t\t\t\t\tarray_shift($sids);\n\t\t\t\t\t\tif(count($sids)>0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sidlist=implode(\",\",$sids);\n\t\t\t\t\t\t\t$ddata=array($this->prod_etype,$attid,$pid);\n\t\t\t\t\t\t\t$sql=\"DELETE FROM $cpet WHERE entity_type_id=? AND attribute_id=? AND store_id IN ($sidlist) AND entity_id=?\";\n\t\t\t\t\t\t\t$this->delete($sql,$ddata);\n\t\t\t\t\t\t\tunset($ddata);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($sids);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\n\t\t\tif(!empty($inserts))\n\t\t\t{\n\t\t\t\t//now perform insert for all values of the the current backend type in one\n\t\t\t\t//single insert\n\t\t\t\t$sql=\"INSERT INTO $cpet\n\t\t\t(`entity_type_id`, `attribute_id`, `store_id`, `entity_id`, `value`)\n\t\t\tVALUES \";\n\t\t\t\t$sql.=implode(\",\",$inserts);\n\t\t\t\t//this one taken from mysql log analysis of magento import\n\t\t\t\t//smart one :)\n\t\t\t\t$sql.=\" ON DUPLICATE KEY UPDATE `value`=VALUES(`value`)\";\n\t\t\t\t$this->insert($sql,$data);\n\t\t\t}\n\n\t\t\tif(!empty($deletes))\n\t\t\t{\n\t\t\t\t$sidlist=implode(\",\",$store_ids);\n\t\t\t\t$attidlist=implode(\",\",$deletes);\n\t\t\t\t$sql=\"DELETE FROM $cpet WHERE entity_type_id=? AND attribute_id IN ($attidlist) AND store_id IN ($sidlist) AND entity_id=?\";\n\t\t\t\t$this->delete($sql,array($this->prod_etype,$pid));\n\t\t\t}\n\n\t\t\tif(empty($deletes) && empty($inserts) && $isnew)\n\t\t\t{\n\t\t\t\tif(!$this->_same)\n\t\t\t\t{\n\t\t\t\t\t$this->log(\"No $tp Attributes created for sku \".$item[\"sku\"],\"warning\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($store_ids);\n\t\t\tunset($data);\n\t\t\tunset($inserts);\n\t\t\tunset($deletes);\n\t\t}\n\t\treturn $this->_extra_attrs;\n\t}", "function product_attribute_description() {\n echo wpautop( __( 'Attribute terms can be assigned to products and variations.<br/><br/><b>Note</b>: Deleting a term will remove it from all products and variations to which it has been assigned. Recreating a term will not automatically assign it back to products.', 'woocommerce' ) );\n}", "public function create()\n {\n $attributes = AttributeModel::all();\n $products = ProductModel::all();\n\n\n return view('admin/catalog/product_attribute/create', compact('attributes','products'));\n\n }", "public function productAttribute($product, $attributeHtml, $attributeName)\n {\n $productId = $product->getId();\n\n if (!mage::registry('product')) {\n Mage::register('product', $product);\n Mage::register('current_product', $product);\n\n }\n\n if ($attributeName == 'image') {\n return parent::productAttribute($product, $attributeHtml, $attributeName);\n }\n\n $productDescriptionPriority = Mage::getStoreConfig('icecat_root/icecat/descript_priority');\n $productShortDescrPriority = Mage::getStoreConfig('icecat_root/icecat/shortdescr_priority');\n $productNamePriority = Mage::getStoreConfig('icecat_root/icecat/name_priority');\n\n\n $dbDescriptionPriority = false;\n $dbShortDescriptionPriority = false;\n $current_page = Mage::app()->getFrontController()->getRequest()->getControllerName();\n if ($productDescriptionPriority == 'Db' && $attributeName == 'description') {\n $dbDescriptionPriority = true;\n }\n if ($productShortDescrPriority == 'Db' && $attributeName == 'short_description') {\n $dbShortDescriptionPriority = true;\n }\n\n if ($current_page == 'product') {\n\n $bin_prod = new Iceshop_Icecatlive_Model_Catalog_Product();\n if ($attributeName == 'description' || $attributeName == 'short_description') {\n $descr = $bin_prod->checkIcecatProdDescription($productId, $attributeName);\n }\n }\n $prod_source = Iceshop_Icecatlive_Model_Catalog_Product::$_product_source;\n\n if ($prod_source == 'DB' && empty($descr)) {\n $dbDescriptionPriority = true;\n $dbShortDescriptionPriority = true;\n }\n\n if ($dbShortDescriptionPriority || ($current_page != 'product'\n && $prod_source != 'DB') && $attributeName != 'name'\n ) {\n if ($attributeName == 'short_description') {\n $attributeHtml = $product->getData('short_description');\n }\n\n if ($attributeName == 'description' && $attributeHtml == 1) {\n $attributeHtml = $product->getData('description');\n }\n return parent::productAttribute($product, $attributeHtml, $attributeName);\n }\n\n $this->iceCatModel = Mage::getSingleton('icecatlive/import');\n\n if ($this->isFirstTime) {\n $helper = Mage::helper('icecatlive/getdata');\n $helper->getProductDescription($product);\n\n if ($helper->hasError() && $attributeName != 'name') {\n $this->error = true;\n }\n $this->isFirstTime = false;\n }\n\n if ($this->error) {\n\n if ($attributeName != 'description' && $attributeName != 'short_description') {\n return parent::productAttribute($product, $attributeHtml, $attributeName);\n } else {\n return '';\n }\n\n }\n\n $id = $product->getData('entity_id');\n\n if ($attributeName == 'name' && $productNamePriority != 'Db') {\n //if we on product page then mage::registry('product') exist\n if ($product->getId() == $this->iceCatModel->entityId && $name = $this->iceCatModel->getProductName()) {\n return $name;\n } else if (!empty($descr)) {\n return $descr;\n }\n $manufacturerId = Mage::getStoreConfig('icecat_root/icecat/manufacturer');\n $mpn = Mage::getStoreConfig('icecat_root/icecat/sku_field');\n $ean = Mage::getStoreConfig('icecat_root/icecat/ean_code');\n $collection = Mage::getResourceModel('catalog/product_collection');\n $collection->addAttributeToSelect($manufacturerId)->addAttributeToSelect($mpn)->addAttributeToSelect($ean)\n ->addAttributeToSelect('name')\n ->addAttributeToFilter('entity_id', array('eq' => $id));\n $product = $collection->getFirstItem();\n return $product->getName();\n }\n\n if ($attributeName == 'short_description' && !$dbShortDescriptionPriority) {\n\n $icecat_descr = $this->iceCatModel->getShortProductDescription();\n if (!empty($descr)) {\n return $descr;\n } else if (!empty($icecat_descr)) {\n return $icecat_descr;\n } else {\n $attributeHtml = $product->getData('short_description');\n return parent::productAttribute($product, $attributeHtml, $attributeName);\n }\n }\n\n if ($attributeName == 'description' && !$dbDescriptionPriority) {\n\n $icecat_full_descr = $this->iceCatModel->getFullProductDescription();\n\n if (!empty($icecat_full_descr)) {\n return str_replace(\"\\\\n\", \"<br>\", $icecat_full_descr);\n } else {\n $attributeHtml = $product->getData('description');\n }\n }\n return parent::productAttribute($product, $attributeHtml, $attributeName);\n }", "public static function get_product_attributes($arg = array())\n {\n $default = array(\n 'children' => false,\n 'slug' => false,\n 'id' => false,\n 'terms_query' => array(\n 'hide_empty' => false\n )\n );\n $args = wp_parse_args($arg, $default);\n\n $product_attributes = array();\n $attribute_taxonomies = wc_get_attribute_taxonomies();\n\n foreach ($attribute_taxonomies as $attribute) {\n $array = array(\n 'id' => intval($attribute->attribute_id),\n 'name' => $attribute->attribute_label,\n 'slug' => wc_attribute_taxonomy_name($attribute->attribute_name),\n 'type' => $attribute->attribute_type,\n 'order_by' => $attribute->attribute_orderby,\n 'has_archives' => (bool)$attribute->attribute_public,\n );\n\n if ($args['children']) {\n // Get Terms\n $terms_default_query = array(\n 'taxonomy' => wc_attribute_taxonomy_name($attribute->attribute_name)\n );\n $terms = get_terms(wp_parse_args($args['terms_query'], $terms_default_query));\n $array['children'] = WooCommerce_Helper::object_to_array($terms);\n }\n\n // Push To List\n $product_attributes[wc_sanitize_taxonomy_name($attribute->attribute_name)] = $array;\n }\n\n // Get By Slug\n if ($args['slug'] != false) {\n if (isset($product_attributes[$args['slug']])) {\n return $product_attributes[$args['slug']];\n } else {\n return array();\n }\n }\n\n // Get By ID\n if ($args['id'] != false) {\n foreach ($product_attributes as $attribute) {\n if ($attribute['id'] == $args['id']) {\n return $attribute;\n }\n }\n\n return array();\n }\n\n return $product_attributes;\n }", "public function createProductAttribute(ProductInterface $product, $value, $locale = 'en')\n {\n $attribute = $this->createAttribute($locale);\n\n $productAttribute = new ProductAttribute();\n $this->entityManager->persist($productAttribute);\n $productAttribute->setAttribute($attribute);\n $productAttribute->setProduct($product);\n $productAttribute->setAttributeValue($this->createAttributeValue($attribute, $value, $locale));\n\n return $productAttribute;\n }", "public function process(\\Magento\\Catalog\\Api\\Data\\ProductAttributeInterface $attribute);", "public function testInsertProductAttributeSkipsAttributesNotInScope()\n\t{\n\t\t$repository = new ProductRepository();\n\t\t$product = $repository->getProduct(1);\n\n\t\t$product->attributes[self::ATTRIBUTE_AUTHOR] = \"J. K. Rowling\";\n\t\t$product->attributes[self::ATTRIBUTE_PUBLISH_YEAR] = 2003;\n\t\t$product->attributes[self::ATTRIBUTE_COLOR] = \"Blue\";\n\n\t\t$repository->updateProduct($product);\n\n\t\t$new_product = $repository->getProduct(1);\n\n\t\t$this->assertEquals(2, count($new_product->attributes));\n\n\t\t$this->assertFalse(array_key_exists(self::ATTRIBUTE_COLOR, $new_product->attributes));\n\t\t$this->assertEquals(\"J. K. Rowling\", $new_product->attributes[self::ATTRIBUTE_AUTHOR]);\n\t\t$this->assertEquals(2003, $new_product->attributes[self::ATTRIBUTE_PUBLISH_YEAR]);\n\t}", "public function actionCreate()\n {\n $product_id = Yii::$app->request->get('product_id');\n $product = Product::findOne($product_id);\n if (!$product) {\n throw new HttpException(400);\n }\n /** @var \\common\\models\\AttributeValue $model */\n $model = new $this->model(['product_id' => $product_id]);\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['product/update', 'id' => $product_id]);\n } else {\n return $this->render($this->create_view, [\n 'model' => $model,\n ]);\n }\n }", "public function run()\n {\n $attributes = ['color','size',];\n foreach($attributes as $attribute) {\n ProductAttribute::create([\n 'name' => $attribute,\n ]);\n }\n\n }", "public function create(array $attributes)\n {\n $this->product->create($attributes);\n }", "public function CreateAttributeOption($attribute_code,$option_value){\n\n\n $options = $this->curlRequest(\"/rest/V1/products/attributes/\".$attribute_code.\"/options\",0);\n\n $insert = true;\n foreach($options as $option){\n if($option['label'] == $option_value){\n $insert = false;\n break;\n }\n }\n if($insert){\n $label = array (\n array(\n \"store_id\" => 1,\n \"label\" => $option_value\n )\n );\n\n $data['option'] = array(\n \"label\" => $option_value,\n \"value\" => $option_value,\n \"store_labels\" => $label,\n \"sort_order\" => \"\",\n \"is_default\" => \"\"\n\n );\n\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\".$attribute_code.\"/options\", 1, json_encode($data) );\n\n }\n return $insert;\n\n }", "public function createConfigProduct($type,$data=[],$attribute_set_id,$sku){\n\n $data['type_id'] = $type;\n $data['attribute_set_id'] = $attribute_set_id;\n $data['sku'] = $sku;\n\n /*foreach($data['additional_attributes']['single_data'] as $item){\n $data['custom_attributes'][] = [ \"attribute_code\" => $item['key'], \"value\" => $item['value'] ];\n }*/\n $data['custom_attributes'] = [];\n $data['custom_attributes'][] = [ \"attribute_code\" => \"description\", \"value\" => $data['description'] ];\n $data['custom_attributes'][] = [ \"attribute_code\" => \"short_description\", \"value\" => $data['short_description'] ];\n array_push( $data['custom_attributes'] , ['attribute_code' => 'category_ids', 'value' => $data['categories']] );\n array_push( $data['custom_attributes'] , ['attribute_code' => 'url_key', 'value' => Inflector::slug($data['name'].' '.$sku)] );\n unset( $data['categories'], $data['website_ids'], $data['description'], $data['short_description'], $data['tax_class_id'], $data['associated_skus'], $data['price'], $data['price_changes'], $data['configurable_attributes'], $data['stock_data'] );\n\n $result = $this->curlRequest(\"/rest/V1/products/\", 1, json_encode([\"product\" => $data]));\n\n return $result;\n \n \n }", "public function store(Request $request)\n {\n /*\n * Validate\n */\n $request->validate([\n 'attrName' => 'required|string|max:255|unique:mc_prod_attr,name',\n 'attrValueName' => 'nullable|array|unique:mc_prod_attr_values,value',\n ]);\n\n // Store Attribute\n $attribute = new MonkCommerceProductAttribute;\n $attribute->name = $request->attrName;\n $attribute->slug = Str::slug($request->attrName);\n $attribute->save();\n\n // Store Values\n if ($request->attrValueName != NULL)\n {\n $storeArr = [];\n for ($i = 0; $i < count($request->attrValueName); $i++)\n {\n array_push($storeArr, ['value' => $request->attrValueName[$i]]);\n }\n MonkCommerceProductAttributeValue::insert($storeArr);\n\n // Store Pivot\n foreach($storeArr as $store)\n {\n $storVal = $store['value'];\n $valId = MonkCommerceProductAttributeValue::where('value', $storVal)->get();\n $attribute->attributeValues()->attach($valId);\n }\n }\n /*\n * Message and Redirect\n */\n Session::flash('success', 'Product Attribute Has Been Created');\n return Redirect::route('product-attribute.index');\n }", "public function testAddingAnAttributeToAContext()\n {\n $newContext = $this->contextService->createContext('new_context');\n $newContext->addAttribute(new StringAttribute('new_context.test', 'value'));\n\n // Retrieve the context and retrieve the attribute.\n $newContextA = $this->contextService->getContext('new_context');\n $attribute = $newContextA->getAttribute('new_context.test');\n\n $this->assertTrue($attribute->getId() == 'new_context.test');\n $this->assertTrue($attribute->getValue() == 'value');\n }", "function generateVariationsFromAttributes(ProductAttributeType $attributetype, array $values){\r\n\r\n\t\t//TODO: introduce transactions here, in case objects get half made etc\r\n\r\n\t\t//if product has variation attribute types\r\n\t\tif(is_array($values)){\r\n\t\t\t//TODO: get values dataobject set\r\n\t\t\t$avalues = $attributetype->convertArrayToValues($values);\r\n\t\t\t$existingvariations = $this->owner->Variations();\r\n\t\t\tif($existingvariations->exists()){\r\n\t\t\t\t//delete old variation, and create new ones - to prevent modification of exising variations\r\n\t\t\t\tforeach($existingvariations as $oldvariation){\r\n\t\t\t\t\t$oldvalues = $oldvariation->AttributeValues();\r\n\t\t\t\t\tif($oldvalues) {\r\n\t\t\t\t\t\tforeach($avalues as $value){\r\n\t\t\t\t\t\t\t$newvariation = $oldvariation->duplicate();\r\n\t\t\t\t\t\t\t$newvariation->InternalItemID = $this->owner->InternalItemID.'-'.$newvariation->ID;\r\n\t\t\t\t\t\t\t$newvariation->AttributeValues()->addMany($oldvalues);\r\n\t\t\t\t\t\t\t$newvariation->AttributeValues()->add($value);\r\n\t\t\t\t\t\t\t$newvariation->write();\r\n\t\t\t\t\t\t\t$existingvariations->add($newvariation);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$existingvariations->remove($oldvariation);\r\n\t\t\t\t\t$oldvariation->AttributeValues()->removeAll();\r\n\t\t\t\t\t$oldvariation->delete();\r\n\t\t\t\t\t$oldvariation->destroy();\r\n\t\t\t\t\t//TODO: check that old variations actually stick around, as they will be needed for past orders etc\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif($avalues) {\r\n\t\t\t\t\tforeach($avalues as $value){\r\n\t\t\t\t\t\t$variation = new ProductVariation();\r\n\t\t\t\t\t\t$variation->ProductID = $this->owner->ID;\r\n\t\t\t\t\t\t$variation->Price = $this->owner->Price;\r\n\t\t\t\t\t\t$variation->write();\r\n\t\t\t\t\t\t$variation->InternalItemID = $this->owner->InternalItemID.'-'.$variation->ID;\r\n\t\t\t\t\t\t$variation->AttributeValues()->add($value); //TODO: find or create actual value\r\n\t\t\t\t\t\t$variation->write();\r\n\t\t\t\t\t\t$existingvariations->add($variation);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function set_woo_product_meta( $product_id = 0 ) {\n\n\t// Bail without our pieces.\n\tif ( empty( $product_id ) ) {\n\t\treturn false;\n\t}\n\n\t// Get my SKU and price.\n\t$product_sku = get_post_field( 'post_name', $product_id, 'raw' );\n\t$product_price = rand( 4, 199 ) . '.' . rand( 11, 99 );\n\n\t// Set the default args.\n\t$default_args = array(\n\t\t'total_sales' => '0',\n\t\t'_visibility' => 'visible',\n\t\t'_stock_status' => 'instock',\n\t\t'_tax_status' => 'taxable',\n\t\t'_tax_class' => '',\n\t\t'_downloadable' => 'no',\n\t\t'_download_limit' => '-1',\n\t\t'_download_expiry' => '-1',\n\t\t'_virtual' => 'no',\n\t\t'_purchase_note' => '',\n\t\t'_featured' => 'no',\n\t\t'_weight' => '',\n\t\t'_length' => '',\n\t\t'_width' => '',\n\t\t'_height' => '',\n\t\t'_sku' => sanitize_text_field( $product_sku ),\n\t\t'_product_attributes' => array(),\n\t\t'_price' => floatval( $product_price ),\n\t\t'_regular_price' => floatval( $product_price ),\n\t\t'_sale_price' => '',\n\t\t'_sale_price_dates_from' => '',\n\t\t'_sale_price_dates_to' => '',\n\t\t'_sold_individually' => '',\n\t\t'_manage_stock' => 'no',\n\t\t'_backorders' => 'no',\n\t\t'_stock' => '',\n\t);\n\n\t// Filter the available meta args we pass.\n\t$filtered_args = apply_filters( Core\\HOOK_PREFIX . 'generate_product_meta_args', array(), $product_id );\n\n\t// Set my product args.\n\t$product_args = wp_parse_args( $filtered_args, $default_args );\n\n\t// Update our keys.\n\tforeach ( $product_args as $meta_key => $meta_value ) {\n\t\tupdate_post_meta( $product_id, $meta_key, $meta_value );\n\t}\n\n\t// And that's it.\n\tdo_action( Core\\HOOK_PREFIX . 'after_product_meta_generated', $product_id, $product_args );\n}", "public function createVariantAttributeRelation($productId, array $requestData)\n {\n $variant = $this->retrieveProductById($productId);\n $attribute = $this->retrieveAttributeById($this->getProperty($requestData, 'attributeId'));\n\n // Only add if relation does not already exists.\n if (!$variant->getVariantAttributes()->contains($attribute)) {\n $variant->addVariantAttribute($attribute);\n }\n\n return $variant;\n }", "function vendor_defined_taxonomy() {\n // The targeted product attribute taxonomy\n return 'pa_color'; \n}", "public function saveProductAttributes(ProductAttribute $productAttribute, Product $product): ProductAttribute\n {\n $this->model->attributes()->save($productAttribute);\n return $productAttribute;\n }", "public function validateCatalogProductAttributeCreateAction()\n {\n if (!$this->_role->getIsAll() && !$this->_request->getParam('attribute_id')) {\n $this->_forward();\n return false;\n }\n\n return true;\n }", "public function create()\n {\n $product_attributes = Product_attributes::all();\n return view('product_attributes.create');\n }", "public function createSupplier($attributes);", "public function createAttributes($pid,&$item,$attmap,$isnew)\n\t{\n\t\t/**\n\t\t * get all store ids\n\t\t */\n\t\t$this->_extra_attrs=array();\n\t\t/* now is the interesring part */\n\t\t/* iterate on attribute backend type index */\n\t\tforeach($attmap as $tp=>$a)\n\t\t{\n\t\t\t//$this->log(\"createAttributes \".print_r($attmap, true), \"debug\");\n\t\t\n\t\t\t/* for static types, do not insert into attribute tables */\n\t\t\tif($tp==\"static\")\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//table name for backend type data\n\t\t\t$cpet=$this->tablename(\"catalog_category_entity_$tp\");\n\t\t\t//data table for inserts\n\t\t\t$data=array();\n\t\t\t//inserts to perform on backend type eav\n\t\t\t$inserts=array();\n\t\t\t//deletes to perform on backend type eav\n\t\t\t$deletes=array();\n\n\t\t\t//use reflection to find special handlers\n\t\t\t$typehandler=\"handle\".ucfirst($tp).\"Attribute\";\n\t\t\t//iterate on all attribute descriptions for the given backend type\n\t\t\tforeach($a[\"data\"] as $attrdesc)\n\t\t\t{\n\t\t\t\t//get attribute id\n\t\t\t\t$attid=$attrdesc[\"attribute_id\"];\n\t\t\t\t//get attribute value in the item to insert based on code\n\t\t\t\t$atthandler=\"handle\".ucfirst($attrdesc[\"attribute_code\"]).\"Attribute\";\n\t\t\t\t$attrcode=$attrdesc[\"attribute_code\"];\n\t\t\t\t//if the attribute code is no more in item (plugins may have come into the way), continue\n\t\t\t\tif(!in_array($attrcode,array_keys($item)))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t//get the item value\n\t\t\t\t$ivalue=$item[$attrcode];\n\t\t\t\t//get item store id for the current attribute\n\t\t\t\t$store_ids=$this->getItemStoreIds($item,$attrdesc[\"is_global\"]);\n\n\n\t\t\t\t//do not handle empty generic int values in create mode\n\t\t\t\tif($ivalue==\"\" && $this->mode!=\"update\" && $tp==\"int\")\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t//for all store ids\n\t\t\t\tforeach($store_ids as $store_id)\n\t\t\t\t{\n\n\t\t\t\t\t//base output value to be inserted = base source value\n\t\t\t\t\t$ovalue=$ivalue;\n\t\t\t\t\t//check for attribute handlers for current attribute\n\t\t\t\t\tforeach($this->_attributehandlers as $match=>$ah)\n\t\t\t\t\t{\n\t\t\t\t\t\t$matchinfo=explode(\":\",$match);\n\t\t\t\t\t\t$mtype=$matchinfo[0];\n\t\t\t\t\t\t$mtest=$matchinfo[1];\n\t\t\t\t\t\tunset($matchinfo);\n\t\t\t\t\t\tunset($hvalue);\n\t\t\t\t\t\tif(preg_match(\"/$mtest/\",$attrdesc[$mtype]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if there is a specific handler for attribute, use it\n\t\t\t\t\t\t\tif(method_exists($ah,$atthandler))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hvalue=$ah->$atthandler($pid,$item,$store_id,$attrcode,$attrdesc,$ivalue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t//use generic type attribute\n\t\t\t\t\t\t\tif(method_exists($ah,$typehandler))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hvalue=$ah->$typehandler($pid,$item,$store_id,$attrcode,$attrdesc,$ivalue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//if handlers returned a value that is not \"__MAGMI_UNHANDLED__\" , we have our output value\n\t\t\t\t\t\t\tif(isset($hvalue) && $hvalue!=\"__MAGMI_UNHANDLED__\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ovalue=$hvalue;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if __MAGMI_UNHANDLED__ ,don't insert anything\n\t\t\t\t\tif($ovalue==\"__MAGMI_UNHANDLED__\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$ovalue=false;\n\t\t\t\t\t}\n\t\t\t\t\t//if handled value is a \"DELETE\"\n\t\t\t\t\tif($ovalue==\"__MAGMI_DELETE__\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$deletes[]=$attid;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t//if we have something to do with this value\n\t\t\t\t\tif($ovalue!==false)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$data[]=$this->cat_etype;\n\t\t\t\t\t\t$data[]=$attid;\n\t\t\t\t\t\t$data[]=$store_id;\n\t\t\t\t\t\t$data[]=$pid;\n\t\t\t\t\t\t$data[]=$ovalue;\n\t\t\t\t\t\t$insstr=\"(?,?,?,?,?)\";\n\t\t\t\t\t\t$inserts[]=$insstr;\n\t\t\t\t\t}\n\n\t\t\t\t\t//if one of the store in the list is admin\n\t\t\t\t\tif($store_id==0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sids=$store_ids;\n\t\t\t\t\t\t//remove all values bound to the other stores for this attribute,so that they default to \"use admin value\"\n\t\t\t\t\t\tarray_pop($sids);\n\t\t\t\t\t\tif(count($sids)>0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sidlist=implode(\",\",$sids);\n\t\t\t\t\t\t\t$ddata=array($this->cat_etype,$attid,$pid);\n\t\t\t\t\t\t\t$sql=\"DELETE FROM $cpet WHERE entity_type_id=? AND attribute_id=? AND store_id IN ($sidlist) AND entity_id=?\";\n\t\t\t\t\t\t\t$this->delete($sql,$ddata);\n\t\t\t\t\t\t\tunset($ddata);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($sids);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\n\t\t\tif(!empty($inserts))\n\t\t\t{\n\t\t\t\t//now perform insert for all values of the the current backend type in one\n\t\t\t\t//single insert\n if($pid == 484){\n $i =0;\n }\n \n\t\t\t\t$sql=\"INSERT INTO $cpet\n\t\t\t(`entity_type_id`, `attribute_id`, `store_id`, `entity_id`, `value`)\n\t\t\tVALUES \";\n\t\t\t\t$sql.=implode(\",\",$inserts);\n\t\t\t\t//this one taken from mysql log analysis of magento import\n\t\t\t\t//smart one :)\n\t\t\t\t$sql.=\" ON DUPLICATE KEY UPDATE `value`=VALUES(`value`)\";\n\t\t\t\t$this->insert($sql,$data);\n\t\t\t}\n\n\t\t\tif(!empty($deletes))\n\t\t\t{\n\t\t\t\t$sidlist=implode(\",\",$store_ids);\n\t\t\t\t$attidlist=implode(\",\",$deletes);\n\t\t\t\t$sql=\"DELETE FROM $cpet WHERE entity_type_id=? AND attribute_id IN ($attidlist) AND store_id IN ($sidlist) AND entity_id=?\";\n\t\t\t\t$this->delete($sql,array($this->cat_etype,$pid));\n\t\t\t}\n\n\t\t\tif(empty($deletes) && empty($inserts) && $isnew)\n\t\t\t{\n\t\t\t\tif(!$this->_same)\n\t\t\t\t{\n\t\t\t\t\t$this->log(\"No $tp Attributes created for category \".$item[\"category_id\"],\"warning\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($store_ids);\n\t\t\tunset($data);\n\t\t\tunset($inserts);\n\t\t\tunset($deletes);\n\t\t}\n\t\treturn $this->_extra_attrs;\n\t}", "public function create(array $attributes): Model {\n $product = $this->model->create($attributes);\n\t\t\n $this->updateOrCreateTranslations($product, $attributes['product_translations']);\n $product->productTags()->attach($attributes['product_tag_ids']);\n\t\t\n return $this->find($product->id);\n }", "function AddAttr() {\n $db = Core::GetDB();\n\n $title = urldecode(Core::GetFromPOST('title'));\n\n $res = $db->Query(\"SELECT data_xml_item_id FROM data_xml_items WHERE title = ? LIMIT 1\", array(\n array(1, $title, IDBController::PARAM_STR)\n ));\n $id = $res->FetchRow();\n $id = $id[0];\n\n $attrs = array(urldecode(Core::GetFromPOST('attr')));\n\n $attrs = fix_attrs($attrs);\n\n foreach ($attrs AS $attr) {\n $attr = explode(':', $attr);\n\n if (count($attr) == 3) {\n if (empty($attr) === false) {\n $db->Query(\"DELETE FROM data_xml_attributes WHERE data_xml_item_id = $id AND attr_name='{$attr[0]}' LIMIT 1\");\n $db->Query(\"INSERT INTO data_xml_attributes (data_xml_item_id, attr_name, attr_value, attr_type) VALUES ($id, '{$attr[0]}', '{$attr[1]}', '{$attr[2]}')\");\n }\n }\n }\n}", "public function store(CreateProductRequest $request)\n {\n\n\n $request->request->add(['created_by'=> Auth::user()->id]);\n $request->request->add(['stock'=> $request->input('quantity')]);\n $request->request->add(['view_count'=> 0]);\n// dd($request);\n// $att=[];\n\n// dd($att);\n $product=Product::create($request->all());\n if ($product){\n $product->tags()->sync($request->input('tag_id'));\n for($i=0;$i<count($request->input('attribute_name'));$i++){\n $att= [\n 'product_id' => $product->id,\n 'name' => $request->input('attribute_name')[$i],\n 'value' =>$request->input('attribute_value')[$i],\n 'created_by' =>Auth::user()->id,\n ];\n ProductAttribute::create($att);\n }\n\n if ($request->has('file')){\n foreach ($request->file('file') as $file){\n $file_name=uniqid().'_'.$file->getClientOriginalName();\n $file->move('images/products',$file_name);\n $request->request->add(['image'=> $file_name]);\n $image=[\n 'name' => $file_name,\n 'product_id' => $product->id,\n 'created_by' =>Auth::user()->id,\n ];\n ProductImage::create($image);\n\n }\n }\n// $product->attributes()->createMany(['name' =>$request->input('attribute_name'),'value' =>$request->input('attribute_value'),'created_by' =>Auth::user()->id]);\n return redirect()->route('backend.product.index');\n }else{\n return back();\n }\n }", "public function attributes() {\n return $this->hasMany('App\\Models\\ProductAttribute');\n }", "public function CreateAttributeDiff($attribute_data,$attribute_set_id,$diff_attr){\n\n $diff_code = '_d';\n if($diff_attr == 'filter'){\n $diff_code = '_f';\n }\n\n $attribute_code = $attribute_data['attribute_code'] . $diff_code;\n $attribute_name = $attribute_data['attribute_name'] . $diff_code;\n $field_type_id = $attribute_data['field_type_id'];\n $input_type = 'text';\n\n $input_type = 'select';\n\n\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\".$attribute_code,0);\n\n if( isset($result['message']) ){\n\n $data['attribute'] = array(\n \"attribute_code\" => $attribute_code,\n \"frontend_input\" => $input_type,\n \"scope\" => \"global\",\n \"default_value\" => \"\",\n \"is_unique\" => 0,\n \"is_required\" => 0,\n \"is_searchable\" => 0,\n \"is_visible_in_advanced_search\" => 0,\n \"is_comparable\" => 0,\n \"is_used_for_promo_rules\" => 0,\n \"is_visible_on_front\" => 0,\n \"used_in_product_listing\" => 0,\n \"default_frontend_label\" => $attribute_name,\n \"frontend_labels\" => array(array(\"store_id\" => \"0\", \"label\" => $attribute_name))\n );\n\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\",1,json_encode($data));\n $attribute_id = $result['attribute_id'];\n\n\n\n //die();\n\n }else{\n $attribute_id = $result['attribute_id'];\n }\n\n $result2 = $this->curlRequest(\"/rest/V1/products/attribute-sets/attributes\",1,json_encode([\n \"attributeSetId\" => $attribute_set_id,\n \"attributeCode\" => $attribute_code,\n \"attributeGroupId\" => 130,\n \"sortOrder\" => 0\n ]) );\n\n return $attribute_id;\n }", "private function setOffer(&$full_product_list, $product_attributes, $product, $parent = false) {\n if ($parent) {\n $image = wp_get_attachment_image_src($product->get_image_id(), 'full');\n\n if (!$image) {\n $image = wp_get_attachment_image_src($parent->get_image_id(), 'full');\n }\n\n $term_list = $parent->get_category_ids();\n $attributes = get_post_meta($parent->get_id(), '_product_attributes');\n } else {\n $image = wp_get_attachment_image_src($product->get_image_id(), 'full');\n $term_list = $product->get_category_ids();\n $attributes = get_post_meta($product->get_id(), '_product_attributes');\n }\n\n $attributes = (isset($attributes[0])) ? $attributes[0] : $attributes;\n\n $params = array();\n\n if (!empty($attributes)) {\n foreach ($attributes as $attribute_name => $attribute) {\n $attributeValue = $product->get_attribute($attribute_name);\n if ($attribute['is_visible'] == 1 && !empty($attributeValue)) {\n $params[] = array(\n 'code' => $attribute_name,\n 'name' => $product_attributes[$attribute_name],\n 'value' => $attributeValue\n );\n }\n }\n }\n\n $dimensions = '';\n\n if ($product->get_length() != '') {\n $dimensions = wc_get_dimension($product->get_length(), 'cm');\n }\n\n if ($product->get_width() != '') {\n $dimensions .= '/' . wc_get_dimension($product->get_width(), 'cm');\n }\n\n if ($product->get_height() != '') {\n $dimensions .= '/' . wc_get_dimension($product->get_height(), 'cm');\n }\n\n $weight = '';\n\n if ($product->get_weight() != '') {\n $weight = wc_get_weight($product->get_weight(), 'kg');\n }\n\n if ($product->is_taxable()) {\n $tax_rates = WC_Tax::get_rates($product->get_tax_class());\n $tax = reset($tax_rates);\n }\n\n if ($product->get_manage_stock() == true) {\n $stockQuantity = $product->get_stock_quantity();\n $quantity = empty($stockQuantity) === false ? $stockQuantity : 0;\n } else {\n $quantity = $product->get_stock_status() === 'instock' ? 1 : 0;\n }\n\n $product_data = array(\n 'id' => $product->get_id(),\n 'productId' => ($product->get_parent_id() > 0) ? $parent->get_id() : $product->get_id(),\n 'name' => $product->get_name(),\n 'productName' => ($product->get_parent_id() > 0) ? $parent->get_title() : $product->get_title(),\n 'price' => wc_get_price_including_tax($product),\n 'picture' => $image[0],\n 'url' => ($product->get_parent_id() > 0) ? $parent->get_permalink() : $product->get_permalink(),\n 'quantity' => $quantity,\n 'categoryId' => $term_list,\n 'dimensions' => $dimensions,\n 'weight' => $weight,\n 'tax' => isset($tax) ? $tax['rate'] : 'none'\n );\n\n if ($product->get_sku() != '') {\n $params[] = array('code' => 'article', 'name' => 'Артикул', 'value' => $product->get_sku());\n\n if (isset($this->settings['bind_by_sku']) && $this->settings['bind_by_sku'] == WC_Retailcrm_Base::YES) {\n $product_data['xmlId'] = $product->get_sku();\n }\n }\n\n if (!empty($params)) {\n $product_data['params'] = $params;\n }\n\n if (isset($product_data)) {\n $full_product_list[] = $product_data;\n }\n\n unset($product_data);\n }", "public function createContextAttribute($contextName, $attributeName);", "public function productAttributes()\n {\n return $this->belongsToMany(ProductAttribute::class);\n }", "public function createProduct($item,$asid)\n\t{\n\t\t//force item type if not exists\n\t\tif(!isset($item[\"type\"]))\n\t\t{\n\t\t\t$item[\"type\"]=\"simple\";\n\t\t}\n\t\t$tname=$this->tablename('catalog_product_entity');\n\t\t$item['type_id']=$item['type'];\n\t\t$item['attribute_set_id']=$asid;\n\t\t$item['entity_type_id']=$this->prod_etype;\n\t\t$item['created_at']=strftime(\"%Y-%m-%d %H:%M:%S\");\n\t\t$item['updated_at']=strftime(\"%Y-%m-%d %H:%M:%S\");\n\t\t$columns=array_intersect(array_keys($item), $this->getProdCols());\n\t\t$values=$this->filterkvarr($item, $columns);\n\t\t$sql=\"INSERT INTO `$tname` (\".implode(\",\",$columns).\") VALUES (\".$this->arr2values($columns).\")\";\n\t\t$lastid=$this->insert($sql,array_values($values));\n\t\treturn $lastid;\n\t}", "public function createSimpleProduct($type,$data=[],$attribute_set_id,$sku){\n\n $data['type_id'] = $type;\n $data['attribute_set_id'] = $attribute_set_id;\n $data['sku'] = $sku;\n foreach($data['additional_attributes']['single_data'] as $item){\n $data['custom_attributes'][] = [ \"attribute_code\" => $item['key'], \"value\" => $item['value'] ];\n }\n $data['custom_attributes'][] = [ \"attribute_code\" => \"description\", \"value\" => $data['description'] ];\n $data['custom_attributes'][] = [ \"attribute_code\" => \"short_description\", \"value\" => $data['short_description'] ];\n array_push( $data['custom_attributes'] , ['attribute_code' => 'category_ids', 'value' => $data['categories']] );\n array_push( $data['custom_attributes'] , ['attribute_code' => 'url_key', 'value' => Inflector::slug($data['name'].' '.$sku)] );\n unset( $data['additional_attributes'], $data['categories'], $data['websites'], $data['description'], $data['short_description'], $data['tax_class_id'] );\n\n $result = $this->curlRequest(\"/rest/V1/products\",1,json_encode([\"product\" => $data]));\n \n return $result;\n }", "public function create_product( $data ) {\n $id = 0;\n\n try {\n\n if ( ! isset( $data['product'] ) ) {\n throw new WC_API_Exception( 'woocommerce_api_missing_product_data', sprintf( __( 'No %1$s data specified to create %1$s', 'woocommerce' ), 'product' ), 400 );\n }\n\n $data = $data['product'];\n\n// Check permissions\n if ( ! current_user_can( 'publish_products' ) ) {\n throw new WC_API_Exception( 'woocommerce_api_user_cannot_create_product', __( 'You do not have permission to create products', 'woocommerce' ), 401 );\n }\n\n $data = apply_filters( 'woocommerce_api_create_product_data', $data, $this );\n\n// Check if product title is specified\n if ( ! isset( $data['title'] ) ) {\n throw new WC_API_Exception( 'woocommerce_api_missing_product_title', sprintf( __( 'Missing parameter %s', 'woocommerce' ), 'title' ), 400 );\n }\n\n// Check product type\n if ( ! isset( $data['type'] ) ) {\n $data['type'] = 'simple';\n }\n\n// Set visible visibility when not sent\n if ( ! isset( $data['catalog_visibility'] ) ) {\n $data['catalog_visibility'] = 'visible';\n }\n\n// Validate the product type\n if ( ! in_array( wc_clean( $data['type'] ), array_keys( wc_get_product_types() ) ) ) {\n throw new WC_API_Exception( 'woocommerce_api_invalid_product_type', sprintf( __( 'Invalid product type - the product type must be any of these: %s', 'woocommerce' ), implode( ', ', array_keys( wc_get_product_types() ) ) ), 400 );\n }\n\n // Enable description html tags.\n $post_content = isset( $data['description'] ) ? wc_clean( $data['description'] ) : '';\n\n if ( $post_content && isset( $data['enable_html_description'] ) && true === $data['enable_html_description'] ) {\n\n $post_content = $data['description'];\n }\n\n // Enable short description html tags.\n $post_excerpt = isset( $data['short_description'] ) ? wc_clean( $data['short_description'] ) : '';\n\n if ( $post_excerpt && isset( $data['enable_html_short_description'] ) && true === $data['enable_html_short_description'] ) {\n $post_excerpt = $data['short_description'];\n }\n\n $new_product = array(\n 'post_title' => wc_clean( $data['title'] ),\n 'post_status' => ( isset( $data['status'] ) ? wc_clean( $data['status'] ) : 'publish' ),\n 'post_type' => 'product',\n 'post_excerpt' => ( isset( $data['short_description'] ) ? $post_excerpt : '' ),\n 'post_content' => ( isset( $data['description'] ) ? $post_content : '' ),\n 'post_author' => get_current_user_id(),\n );\n\n // Attempts to create the new product\n $id = wp_insert_post( $new_product, true );\n\n// Checks for an error in the product creation\n if ( is_wp_error( $id ) ) {\n throw new WC_API_Exception( 'woocommerce_api_cannot_create_product', $id->get_error_message(), 400 );\n }\n\n// Check for featured/gallery images, upload it and set it\n if ( isset( $data['images'] ) ) {\n $this->save_product_images( $id, $data['images'] );\n }\n\n // Save product meta fields\n $this->save_product_meta( $id, $data );\n\n// Save variations\n if ( isset( $data['type'] ) && 'variable' == $data['type'] && isset( $data['variations'] ) && is_array( $data['variations'] ) ) {\n $this->save_variations( $id, $data );\n }\n\n // Clear cache/transients\n wc_delete_product_transients( $id );\n\n $this->server->send_status( 201 );\n\n return $this->get_product( $id );\n } catch ( WC_API_Exception $e ) {\n // Remove the product when fails\n $this->clear_product( $id );\n\n return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );\n }\n\n }", "public static function getAttributesAsProduct(&$product, $id_lang)\n {\n $sql\n = 'SELECT\n\t\t\t\tpa.`id_product_attribute`,\n\t\t\t\tpa.`reference`,\n\t\t\t\tpa.`supplier_reference`,\n\t\t\t\tpa.`location`,\n\t\t\t\tpa.`ean13`,\n\t\t\t\tpa.`wholesale_price`,\n\t\t\t\tpa.`price`,\n\t\t\t\tpa.`ecotax`,\n\t\t\t\tpa.`quantity`,\n\t\t\t\tpa.`weight`,\n\t\t\t\tpa.`default_on`,\n\t\t\t\t'.(version_compare(_PS_VERSION_, '1.2', '>=') ? 'pai.`id_image`' : 'pa.`id_image`').',\n\t\t\t\til.`legend`,\n\t\t\t\ta.`id_attribute_group`,\n\t\t\t\tal.`name`\n\t\t\tFROM `'._DB_PREFIX_.'product_attribute` pa\n\t\t\tLEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac\n\t\t\t\tON pa.`id_product_attribute` = pac.`id_product_attribute`\n\t\t\t'.(version_compare(_PS_VERSION_, '1.2', '>=') ? 'LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` pai\tON pa.`id_product_attribute` = pai.`id_product_attribute`' : '').'\n\t\t\tLEFT JOIN `'._DB_PREFIX_.'image_lang` il\n\t\t\t\tON '.(version_compare(_PS_VERSION_, '1.2', '>=') ? 'pai' : 'pa').'.`id_image` = il.`id_image`\n\t\t\t\tAND il.`id_lang` = '.(int)$id_lang.'\n\t\t\tLEFT JOIN `'._DB_PREFIX_.'attribute` a\n\t\t\t\tON pac.`id_attribute` = a.`id_attribute`\n\t\t\tLEFT JOIN `'._DB_PREFIX_.'attribute_lang` al\n\t\t\t\tON a.`id_attribute` = al.`id_attribute`\n\t\t\t\tAND al.`id_lang` = '.(int)$id_lang.'\n\t\t\tWHERE pa.`id_product` = '.(int)$product['id_product'];\n\n $attributes = Db::getInstance()->ExecuteS($sql);\n\n if (!$attributes) {\n return false;\n }\n\n foreach ($attributes as &$attr) {\n $id_pa = (int)$attr['id_product_attribute'];\n $id_ag = (int)$attr['id_attribute_group'];\n\n $product['declension'][$id_pa]['id_product_attribute']\n = $attr['id_product_attribute'];\n $product['declension'][$id_pa]['reference'] = $attr['reference'];\n $product['declension'][$id_pa]['supplier_reference']\n = $attr['supplier_reference'];\n $product['declension'][$id_pa]['location'] = $attr['location'];\n $product['declension'][$id_pa]['ean13'] = $attr['ean13'];\n $product['declension'][$id_pa]['wholesale_price']\n = $attr['wholesale_price'];\n $product['declension'][$id_pa]['price'] = $attr['price'];\n $product['declension'][$id_pa]['ecotax'] = $attr['ecotax'];\n $product['declension'][$id_pa]['quantity'] = $attr['quantity'];\n $product['declension'][$id_pa]['weight'] = $attr['weight'];\n $product['declension'][$id_pa]['default_on'] = $attr['default_on'];\n $product['declension'][$id_pa]['id_image'] = $attr['id_image'];\n $product['declension'][$id_pa]['image_legend'] = $attr['legend'];\n\n if (!isset($product['declension'][$id_pa]['attr_'.$id_ag])\n || !in_array(\n $attr['name'],\n $product['declension'][$id_pa]['attr_'.$id_ag]\n )\n ) {\n $product['declension'][$id_pa]['attr_'.$id_ag][]\n = $attr['name'];\n }\n }\n\n return true;\n }", "private function attachProductAttributes(Product $product)\n {\n // attach attribute value to product\n if (!empty($this->attributesData)) {\n $product->attributeValues()->syncWithoutDetaching($this->attributesData);\n }\n }", "public function store(Request $request)\n {\n\n $request->validate([\n 'product_id' => 'required',\n 'attribute_id' => 'required'\n ]);\n\n ProductAttributeModel::create($request->all());\n\n return redirect()->route('product_attribute.index')\n ->with('success','Attribute created successfully.');\n }", "public function create()\n {\n $url = route('dashboard.attributes.store');\n $html = view('partials.form.form-attribute', ['url' => $url, 'idForm' => 'form-create'])->render();\n\n return response()->json(['html' => $html], 200);\n }", "public function create()\n {\n return view('monkcommerce::monkcommerce-dashboard.admin.products.attributes.create');\n }", "public function storeWithAttributes(CreateWithAttributesRequest $request)\n {\n $products = $request->input('products');\n\n if (!is_null($products) && !empty($products)) {\n $reference = new Reference;\n $reference->nombre = $request->name;\n $reference->descripcion = $request->description;\n $reference->descripcion_larga = $request->long_description;\n\n if ($reference->save()) {\n $attributes = $request->input('attributes');\n $buy_prices = $request->input('buy_prices');\n $codes = $request->input('codes');\n $details = $request->input('details');\n $quantities = $request->input('quantities');\n $sale_prices = $request->input('sale_prices');\n $storedDetails = [];\n\n for ($i = 0; $i <= 5; $i++) {\n $image = $i > 0 ? 'imagen' . $i : 'imagen';\n\n if ($request->file($image) != null) {\n $reference_name = sanitize_file_name ($reference->id . ' ' . $reference->nombre . ' ' . $image);\n\n if ($request->file($image)->storeAs(auth_user()->dbConfig->base_dato . '/imagenes_productos', $reference_name . '.' . $request->file($image)->extension(), 'uploads')) {\n $reference->$image = $reference_name . '.' . $request->file($image)->extension();\n }\n }\n }\n\n $reference->save();\n\n foreach ($attributes as $key => $value) {\n if (array_key_exists($key, $details) && !is_null($details[$key])) {\n $attribute = new Attribute;\n $attribute->nombre_atributo = mb_strtoupper($value, 'UTF-8');\n $attribute->producto_referencia_id = $reference->id;\n\n if ($attribute->save()) {\n foreach (explode(',', $details[$key]) as $value) {\n $detail = new Detail;\n $detail->nombre_detalle = mb_strtoupper($value, 'UTF-8');\n $detail->producto_referencia_atributo_id = $attribute->id;\n if ($detail->save()) {\n $storedDetails[$detail->nombre_detalle] = $detail->id;\n }\n }\n }\n }\n }\n\n $first = true;\n $tax = Tax::find($request->tax);\n\n if (is_null($tax)) {\n $tax = Tax::where([\n 'porciento' => 0,\n ])->first();\n\n if (is_null($tax)) {\n $tax = new Tax;\n $tax->nombre_impuesto = 'IVA (0%)';\n $tax->porciento = 0;\n $tax->save();\n }\n }\n\n foreach ($products as $key => $value) {\n $productDetails = explode('/', mb_strtoupper($value, 'UTF-8'));\n $findDetails = true;\n $idDetails = [];\n\n foreach ($productDetails as $detail) {\n if (array_key_exists($detail, $storedDetails)) {\n array_push($idDetails, $storedDetails[$detail]);\n } else {\n $findDetails = false;\n }\n }\n\n if ($findDetails && count($idDetails) > 0) {\n $featured = ($first && !is_null($request->featured)) ? true : false;\n $code = array_key_exists($key, $codes) ? $codes[$key] : null;\n $quantity = array_key_exists($key, $quantities) && !is_null($quantities[$key]) ? $quantities[$key] : 0;\n $buy_price = array_key_exists($key, $buy_prices) && !is_null($buy_prices[$key]) ? $buy_prices[$key] : 0;\n $sale_price = array_key_exists($key, $sale_prices) && !is_null($sale_prices[$key]) ? $sale_prices[$key] : 0;\n $product = new Product;\n $product->code = $code;\n $product->name = $reference->nombre . '/' . mb_strtoupper($value, 'UTF-8');\n $product->category = $request->category;\n $product->description = $request->description;\n $product->long_description = $request->long_description;\n $product->impuesto = $tax->id_impuesto;\n $product->featured = $featured;\n $product->sell_in_negative = (!is_null($request->sell_without_stock)) ? true : false;\n $product->show_stock = (!is_null($request->show_stock)) ? true : false;\n $product->buy_price = $buy_price; $product->sale_price = $sale_price;\n $product->referencia_id = $reference->id;\n\n if ($product->save()) {\n $warehouses = Warehouse::all();\n $current_warehouse = auth_user()->shop->id_almacen;\n\n foreach ($warehouses as $warehouse) {\n $warehouse_quantity = $warehouse->id === $current_warehouse ? $quantity : 0;\n $curret_stock = new Current;\n $curret_stock->set_warehouse = $warehouse->id;\n $curret_stock->set_product = $product->id;\n $curret_stock->set_quantity = $warehouse_quantity;\n $curret_stock->save();\n }\n\n if ($quantity > 0) {\n $productCollection = collect();\n $productCollection->push([\n 'id' => $product->id,\n 'name' => $product->name,\n 'buy_price' => $product->buy_price,\n 'sale_price' => $product->sale_price,\n 'quantity' => $quantity,\n 'subtotal' => $product->buy_price * $quantity,\n ]);\n $movement = new InventoryMovement($productCollection);\n $inventory = $movement->new($current_warehouse);\n $result = $movement->addItems($inventory);\n }\n\n $first = false;\n $detailProduct = new DetailProduct;\n $detailProduct->producto_id = $product->id;\n\n for ($i = 0; $i < count($idDetails); $i++) {\n if ($i < 10) {\n $detailId = 'producto_referencia_atributo_detalle' . ($i + 1) . '_id';\n $detailProduct->$detailId = $idDetails[$i];\n }\n }\n\n $detailProduct->save();\n }\n }\n }\n\n return redirect()->route('admin.products.index')->with('success', 'El producto se agrego con éxito.');\n }\n }\n\n return back()->with('danger', 'Ha ocurrido un error.');\n }", "public function getProductAttributes()\n\t{\n\t\treturn $this->arrAttributes;\n\t}", "public function createAddonProduct()\n {\n ++$this->productCount;\n\n // Create basic product.\n $product = $this->productFactory->createEntity();\n $this->entityManager->persist($product);\n $product->setNumber('AddonProductNumber-' . $this->productCount);\n $product->setManufacturer('EnglishManufacturer-' . $this->productCount);\n $product->setType($this->addonProductType);\n $product->setStatus($this->productStatus);\n $product->setCreated(new DateTime());\n $product->setChanged(new DateTime());\n $product->setSupplier($this->contactTestData->accountSupplier);\n $product->setOrderUnit($this->orderUnit);\n $product->setContentUnit($this->contentUnit);\n $product->setOrderContentRatio(2.0);\n $product->setTaxClass($this->taxClass);\n\n // Add prices\n $this->addPrice($product, 5.99);\n $this->addPrice($product, 3.85, 4.0);\n\n // Product translation\n $this->addProductTranslation($product);\n\n return $product;\n }", "function custom_add_artwork_attr( $attributes ){\n\t\t\t$attributes['class'] .= ' equalize col-xs-12 col-sm-6 col-md-4';\n\t\t\t$attributes['itemtype'] = 'http://schema.org/ArtworkArticle';\n\t\t\t// return the attributes\n\t\t\treturn $attributes;\n\t\t}", "public function createCustomAttributes() {\n if ($this->customAttributesExists() === true) {\n return false;\n } else {\n // # Otherwise, get missing attributes...\n $missingAttributes = $this->customAttributesExists();\n\n // # ...and generate them\n foreach ($missingAttributes as $key => $value) {\n $this->post('custom-attributes', ['name' => $key, 'attributeType' => 'client', 'clientZoneVisible' => false]);\n }\n $attributes = $this->get('custom-attributes');\n\n // # They should exist now which returns true and should not be an array\n if ($this->customAttributesExists() === true) {\n return true;\n } else {\n return false;\n // # ...Log error if they don't\n $this->log->appendLog('failed to create custom attributes');\n }\n\n }\n }", "public static function addAttribute(string $attributeCode, string $attributeName = null)\n {\n global $db, $user;\n\n //====================================================================//\n // Ensure Attribute Code Doesnt' Already Exists\n $existingAttribute = self::getAttributeByCode($attributeCode);\n if (null !== $existingAttribute) {\n return $existingAttribute;\n }\n\n //====================================================================//\n // Create New Attribute\n $attribute = new ProductAttribute($db);\n $attribute->ref = strtoupper($attributeCode);\n $attribute->label = is_string($attributeName) ? $attributeName : $attributeCode;\n\n if ($attribute->create($user) < 0) {\n return Splash::log()->errTrace(\"Unable to Create Product Attribute (\".$attributeCode.\").\");\n }\n\n //====================================================================//\n // Reload Load Attributes Cache\n self::$attributesCache = $attribute->fetchAll();\n\n return $attribute;\n }", "public function create(Product $product)\n {\n \n }", "public function __construct( $orders_products_attributes_id = null ) {\n\t\tif (!is_null($orders_products_attributes_id)) {\n\t\t\t$sql = 'select * from cart_orders_products_attributes where orders_products_attributes_id=' . $orders_products_attributes_id;\n\t\t\tif (!$result = Database::singleton()->query_fetch($sql)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$this->setId($result['orders_products_attributes_id']);\n\t\t\t$this->setOrderid($result['orders_id']);\n\t\t\t$this->setProductid($result['orders_products_id']);\n\t\t\t$this->setProducts_options($result['products_options']);\n\t\t\t$this->setProducts_options_values($result['products_options_values']);\n\t\t\t$this->setOptions_values_price($result['options_values_price']);\n\t\t\t$this->setPrice_prefix($result['price_prefix']);\n\t\t\t$this->setProduct_attribute_is_free($result['product_attribute_is_free']);\n\t\t\t$this->setProducts_attributes_weight($result['products_attributes_weight']);\n\t\t\t$this->setProducts_attributes_weight_prefix($result['products_attributes_weight_prefix']);\n\t\t\t$this->setAttributes_discounted($result['attributes_discounted']);\n\t\t\t$this->setAttributes_price_base_included($result['attributes_price_base_included']);\n\t\t\t$this->setAttributes_price_onetime($result['attributes_price_onetime']);\n\t\t\t$this->setAttributes_price_factor($result['attributes_price_factor']);\n\t\t\t$this->setAttributes_price_factor_offset($result['attributes_price_factor_offset']);\n\t\t\t$this->setAttributes_price_factor_onetime($result['attributes_price_factor_onetime']);\n\t\t\t$this->setAttributes_price_factor_onetime_offset($result['attributes_price_factor_onetime_offset']);\n\t\t\t$this->setAttributes_qty_prices($result['attributes_qty_prices']);\n\t\t\t$this->setAttributes_qty_prices_onetime($result['attributes_qty_prices_onetime']);\n\t\t\t$this->setAttributes_price_words($result['attributes_price_words']);\n\t\t\t$this->setAttributes_price_words_free($result['attributes_price_words_free']);\n\t\t\t$this->setAttributes_price_letters($result['attributes_price_letters']);\n\t\t\t$this->setAttributes_price_letters_free($result['attributes_price_letters_free']);\n\t\t\t$this->setProducts_options_id($result['products_options_id']);\n\t\t\t$this->setProducts_options_values_id($result['products_options_values_id']);\n\t\t\t$this->setProducts_prid($result['products_prid']);\n\t\t}\n\t}", "function _wp_add_global_attributes($value)\n {\n }", "public function createAttribute(array $params)\n {\n }", "public static function getProductAttributes(&$product, $id_lang)\n {\n $sql\n = 'SELECT\n\t\t\t\tpa.`id_product_attribute`,\n\t\t\t\tpa.`reference`,\n\t\t\t\tpa.`supplier_reference`,\n\t\t\t\tpa.`location`,\n\t\t\t\tpa.`ean13`,\n\t\t\t\tpa.`wholesale_price`,\n\t\t\t\tpa.`price`,\n\t\t\t\tpa.`ecotax`,\n\t\t\t\tpa.`quantity`,\n\t\t\t\tpa.`weight`,\n\t\t\t\tpa.`default_on`,\n\t\t\t\t'.(version_compare(_PS_VERSION_, '1.2', '>=') ? 'pai.`id_image`' : 'pa.`id_image`').',\n\t\t\t\til.`legend`,\n\t\t\t\ta.`id_attribute_group`,\n\t\t\t\tal.`name`\n\t\t\tFROM `'._DB_PREFIX_.'product_attribute` pa\n\t\t\tLEFT JOIN `'._DB_PREFIX_.'product_attribute_combination` pac\n\t\t\t\tON pa.`id_product_attribute` = pac.`id_product_attribute`\n\t\t\t'.(version_compare(_PS_VERSION_, '1.2', '>=') ? 'LEFT JOIN `'._DB_PREFIX_.'product_attribute_image` paiON pa.`id_product_attribute` = pai.`id_product_attribute`' : '').'\n\t\t\tLEFT JOIN `'._DB_PREFIX_.'image_lang` il\n\t\t\t\tON '.(version_compare(_PS_VERSION_, '1.2', '>=') ? 'pai' : 'pa').'.`id_image` = il.`id_image`\n\t\t\t\tAND il.`id_lang` = '.(int)$id_lang.'\n\t\t\tLEFT JOIN `'._DB_PREFIX_.'attribute` a\n\t\t\t\tON pac.`id_attribute` = a.`id_attribute`\n\t\t\tLEFT JOIN `'._DB_PREFIX_.'attribute_lang` al\n\t\t\t\tON a.`id_attribute` = al.`id_attribute`\n\t\t\t\tAND al.`id_lang` = '.(int)$id_lang.'\n\t\t\tWHERE pa.`id_product` = '.(int)$product['id_product'];\n\n $attributes = Db::getInstance()->ExecuteS($sql);\n\n if (!$attributes) {\n return false;\n }\n\n foreach ($attributes as &$attr) {\n $id_pa = (int)$attr['id_product_attribute'];\n $id_ag = (int)$attr['id_attribute_group'];\n\n if (!isset($product['attr_'.$id_ag])\n || !in_array($attr['name'], $product['attr_'.$id_ag])\n ) {\n $product['attr_'.$id_ag][] = $attr['name'];\n }\n\n if ($attr['default_on']) {\n $product['id_product_attribute'] = (int)$id_pa;\n\n if (!empty($attr['reference'])) {\n $product['reference'] = $attr['reference'];\n }\n\n if (!empty($attr['supplier_reference'])) {\n $product['supplier_reference']\n = $attr['supplier_reference'];\n }\n\n if (!empty($attr['location'])) {\n $product['location'] = $attr['location'];\n }\n\n if (!empty($attr['ean13'])) {\n $product['ean13'] = $attr['ean13'];\n }\n\n if (!empty($attr['wholesale_price'])\n && $attr['wholesale_price'] > 0\n ) {\n $product['wholesale_price'] = $attr['wholesale_price'];\n }\n\n if (!empty($attr['price']) && $attr['price'] > 0) {\n $product['default_attribute_price'] = $attr['price'];\n }\n\n if (!empty($attr['ecotax']) && $attr['ecotax'] > 0) {\n $product['ecotax'] = $attr['ecotax'];\n }\n\n $product['quantity'] = $attr['quantity'];\n\n if (!empty($attr['weight']) && $attr['weight'] > 0) {\n $product['attr_weight'] = (float)$attr['weight'];\n }\n\n if (!empty($attr['id_image']) && $attr['id_image'] > 0) {\n $product['id_image'] = $attr['id_image'];\n }\n\n if (!empty($attr['legend']) && $attr['legend'] > 0) {\n $product['image_legend'] = $attr['legend'];\n }\n }\n }\n\n return true;\n }", "public function createProduct($item)\n\t{\n\t\t\t\n\t\t\t\n\t\t\t$productSku = $item->LITM;\n\t\t\t$productLoad = Mage::getModel('catalog/product')->loadByAttribute('sku', $productSku);\n\t\t\t \n\t\t\t if(!$productLoad){\n\t\t\t\t$product = Mage::getModel('catalog/product');\n \n\t\t\t } else {\n\t\t\t\t $product = Mage::getModel('catalog/product')->load($productLoad->getId());\n\t\t\t }\n\t\t\t \n\t\t\t $product->setStoreId(1) //you can set data in store scope\n\t\t\t\t\t\t->setWebsiteIds(array(1)) //website ID the product is assigned to, as an array\n\t\t\t\t\t\t->setAttributeSetId(4) //ID of a attribute set named 'default'\n\t\t\t\t\t\t->setTypeId('simple') //product type\n\t\t\t\t\t\t->setCreatedAt(strtotime('now')) //product creation time\n\t\t\t\t\t\t->setStatus(1) //product status (1 - enabled, 2 - disabled)\n\t\t\t\t\t\t->setTaxClassId(4) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)\n\t\t\t\t\t\t->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH); //catalog and search visibility\n\t\t\t\n\t\t\t $product->setGtin($item->part_number->EITM);\n\t\t\t $product->setMpn($item->part_number->MITM);\n\t\t\t $product->setName($item->part_description->WTXT);\n\t\t\t $product->setShortDescription($item->part_description->DES2);\n\t\t\t $product->setDescription($item->part_description->WTX2);\n\t\t\t $product->setWeight($item->additional_information->GWGH);\n\t\t\t \n\t\t\t\n\t\t\t $product->setManufacturer($this->retrieveOptionId('manufacturer',$item->additional_information->MAFT)); //option needs to be selected\n\t\t\t\n\t\t\t\n\t\t\t $product->setStockData(array(\n 'use_config_manage_stock' => 0, //'Use config settings' checkbox\n 'manage_stock'\t\t\t => 1, //manage stock\n 'min_sale_qty'\t\t\t => 1, //Minimum Qty Allowed in Shopping Cart\n 'use_config_max_sale_qty' => 1, //Maximum Qty Allowed in Shopping Cart\n 'is_in_stock' \t\t\t => 1, //Stock Availability\n 'qty' \t\t\t\t\t => $item->additional_information->STQU //qty\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\t\t$product->setSku($item->LITM);\n\t\t\t$product->setDistributor($this->retrieveOptionId(\"distributor\",\"Alltron\"));\n\t\t\t$product->setEstimatedShippingTime(\"1-2 Werktage\");\n\t\t\t$product->setQty($item->STQU);\n\t\t\t\n\t\t\t$categories[] = $this->getCategoryId($item->part_catagory->CAT1);\n\t\t\t$categories[] = $this->getCategoryId($item->part_catagory->CAT2);\n\t\t\t$categories[] = $this->getCategoryId($item->part_catagory->CAT3);\n\t\t\t$categories[] = $this->getCategoryId($item->part_catagory->CATA);\t\t\t\n\t\t\t$product->setCategoryIds($categories);\n\n\t\t\t$product->save();\n\t}", "function add_attribute($dom, $element, $name, $value) {\n\t$attr = $element->appendChild($dom->createAttribute($name));\n\t$attr->appendChild($dom->createTextNode($value));\n\treturn $attr;\n}", "public function addAttribute($name, $value);", "public static function touchAttributeValue(ProductAttribute $attribute, string $value)\n {\n //====================================================================//\n // Load Product Attribute Value\n $attrValue = self::getAttributeValueByName($attribute, $value);\n if (!$attrValue) {\n //====================================================================//\n // Add Product Attribute Value\n $attrValue = self::addAttributeValue($attribute, $value);\n }\n\n return $attrValue;\n }", "function add_product_fields( $product_id,\n$product ) {\nif ( $product->post_type == 'products' ) {\n// Store data in post meta table if present in post data\nif ( isset( $_POST['product_SKU'] ) &&\n$_POST['product_SKU'] != '' ) {\nupdate_post_meta( $product_id, 'SKU',\n$_POST['product_SKU'] );\n}\n\nif ( isset( $_POST['product_position'] ) &&\n$_POST['product_position'] != '' ) {\nupdate_post_meta( $product_id, 'position',\n$_POST['product_position'] );\n}\n}\n}", "function woocommerce_product( $id ) {\n\t\t\n\t\t$this->id = $id;\n\n\t\t$product_custom_fields = get_post_custom( $this->id );\n\n\t\tif (isset($product_custom_fields['SKU'][0]) && !empty($product_custom_fields['SKU'][0])) $this->sku = $product_custom_fields['SKU'][0]; else $this->sku = $this->id;\n\t\t\n\t\tif (isset($product_custom_fields['product_data'][0])) $this->data = maybe_unserialize( $product_custom_fields['product_data'][0] ); else $this->data = '';\n\t\t\n\t\tif (isset($product_custom_fields['product_attributes'][0])) $this->attributes = maybe_unserialize( $product_custom_fields['product_attributes'][0] ); else $this->attributes = array();\t\t\n\t\t\n\t\tif (isset($product_custom_fields['price'][0])) $this->price = $product_custom_fields['price'][0]; else $this->price = 0;\n\n\t\tif (isset($product_custom_fields['visibility'][0])) $this->visibility = $product_custom_fields['visibility'][0]; else $this->visibility = 'hidden';\n\t\t\n\t\tif (isset($product_custom_fields['stock'][0])) $this->stock = $product_custom_fields['stock'][0]; else $this->stock = 0;\n\t\t\n\t\t// Again just in case, to fix WP bug\n\t\t$this->data = maybe_unserialize( $this->data );\n\t\t$this->attributes = maybe_unserialize( $this->attributes );\n\t\t\n\t\t$terms = wp_get_object_terms( $id, 'product_type' );\n\t\tif (!is_wp_error($terms) && $terms) :\n\t\t\t$term = current($terms);\n\t\t\t$this->product_type = $term->slug; \n\t\telse :\n\t\t\t$this->product_type = 'simple';\n\t\tendif;\n\t\t\n\t\t$this->get_children();\n\t\t\n\t\tif ($this->data) :\n\t\t\t$this->exists = true;\t\t\n\t\telse :\n\t\t\t$this->exists = false;\t\n\t\tendif;\n\t}", "public function sync_product_custom_fields_attributes( $product_id ) {\n\t\tglobal $sync_taxonomies;\n\n\t\t// Features.\n\t\t$features = get_post_meta( $product_id, '_features', true );\n\t\tif ( ! is_array( $features ) ) {\n\t\t\t$features = [];\n\t\t}\n\n\t\tdelete_field( 'ussc_features', $product_id );\n\n\t\t$features = array_map( function ( $feature ) {\n\t\t\treturn [\n\t\t\t\t'feature' => $feature['value'],\n\t\t\t];\n\t\t}, $features );\n\n\t\tedgenet()->debug->notice( __( sprintf( 'Updating %s features.', count( $features ) ), 'edgenet' ) );\n\t\tupdate_field( 'ussc_features', $features, $product_id );\n\n\t\t// Others.\n\t\t$others = get_post_meta( $product_id, '_other', true );\n\n\t\tif ( ! $others || ! is_array( $others ) ) {\n\t\t\t$others = [];\n\t\t}\n\n\t\tdelete_field( 'ussc_other', $product_id );\n\n\t\t$others = array_map( function ( $other ) {\n\t\t\treturn [\n\t\t\t\t'label' => $other['attribute']->description,\n\t\t\t\t'value' => $other['value'],\n\t\t\t];\n\t\t}, $others );\n\n\t\tedgenet()->debug->notice( __( sprintf( 'Updating %s others.', count( $others ) ), 'edgenet' ) );\n\t\tupdate_field( 'ussc_other', $others, $product_id );\n\n\t\t// Regulatory.\n\t\t$regulatory = get_post_meta( $product_id, '_regulatory', true );\n\t\tif ( ! $regulatory || ! is_array( $regulatory ) ) {\n\t\t\t$regulatory = [];\n\t\t}\n\n\t\tdelete_field( 'ussc_regulatory', $product_id );\n\n\t\t$regulatory = array_map( function ( $regulation ) {\n\t\t\treturn [\n\t\t\t\t'label' => $regulation['attribute']->description,\n\t\t\t\t'value' => $regulation['value'],\n\t\t\t];\n\t\t}, $regulatory );\n\n\t\tedgenet()->debug->notice( __( sprintf( 'Updating %s regulatory.', count( $regulatory ) ), 'edgenet' ) );\n\t\tupdate_field( 'ussc_regulatory', $regulatory, $product_id );\n\n\t\t// Dimensions.\n\t\t$dimensions = get_post_meta( $product_id, '_dimensions', true );\n\t\tif ( ! $dimensions || ! is_array( $dimensions ) ) {\n\t\t\t$dimensions = [];\n\t\t}\n\n\t\tdelete_field( 'ussc_dimensions', $product_id );\n\n\t\t$dimensions = array_map( function ( $dimension ) {\n\t\t\treturn [\n\t\t\t\t'label' => $dimension['attribute']->description,\n\t\t\t\t'value' => $dimension['value'],\n\t\t\t];\n\t\t}, $dimensions );\n\n\t\t// update field.\n\t\tedgenet()->debug->notice( __( sprintf( 'Updating %s dimensions.', count( $dimensions ) ), 'edgenet' ) );\n\t\tupdate_field( 'ussc_dimensions', $dimensions, $product_id );\n\n\t\t$specs = get_post_meta( $product_id, '_category_attributes', true );\n\t\tif ( ! is_array( $specs ) ) {\n\t\t\t$specs = [];\n\t\t}\n\n\t\t$att_meta = [];\n\t\tedgenet()->debug->notice( __( sprintf( 'Updating %s attributes.', count( $specs ) ), 'edgenet' ) );\n\t\tforeach ( $specs as $spec ) {\n\t\t\t$label = $spec['attribute']->description;\n\t\t\t$pa_args = [\n\t\t\t\t'name' => $label,\n\t\t\t\t'slug' => substr( sanitize_title_with_dashes( preg_replace( '/[^A-Za-z0-9\\-_ ]/', '', $label ) ), 0, 27 ),\n\t\t\t\t'type' => 'text',\n\t\t\t];\n\n\t\t\t$taxonomy = wc_attribute_taxonomy_name( $pa_args['slug'] );\n\n\t\t\tedgenet()->debug->notice( __( sprintf( 'Taxonomy: %s', $taxonomy ), 'edgenet' ) );\n\t\t\t$tax_name = wc_attribute_taxonomy_name( $taxonomy );\n\t\t\tif ( ! taxonomy_exists( $tax_name ) && ! in_array( $tax_name, $sync_taxonomies ) ) {\n\t\t\t\tedgenet()->debug->notice( __( '- Creating', 'edgenet' ) );\n\n\t\t\t\t$status = wc_create_attribute( $pa_args );\n\n\t\t\t\t$sync_taxonomies[] = $tax_name;\n\n\t\t\t\tedgenet()->debug->notice( __( '- Created', 'edgenet' ), $status );\n\t\t\t} else {\n\t\t\t\tedgenet()->debug->notice( __( '- Found', 'edgenet' ) );\n\t\t\t}\n\n\t\t\tif ( ! has_term( $spec['value'], $taxonomy, $product_id ) ) {\n\t\t\t\tedgenet()->debug->notice( __( sprintf( '- Assigning term \"%s\" to Product ID: %s', $spec['value'], $product_id ), 'edgenet' ) );\n\t\t\t\twp_set_object_terms( $product_id, $spec['value'], $taxonomy );\n\t\t\t} else {\n\t\t\t\tedgenet()->debug->notice( __( sprintf( '- Term exists \"%s\" on Product ID: %s', $spec['value'], $product_id ), 'edgenet' ) );\n\t\t\t}\n\n\t\t\t$att_meta[] = [\n\t\t\t\t'name' => $taxonomy,\n\t\t\t\t'value' => $spec['value'],\n\t\t\t\t'is_visible' => 1,\n\t\t\t\t'is_variation' => 1,\n\t\t\t\t'is_taxonomy' => 1,\n\t\t\t];\n\t\t}\n\n\t\tedgenet()->debug->notice( __( '- Updating product attributes post meta', 'edgenet' ) );\n\t\tupdate_post_meta( $product_id, '_product_attributes', $att_meta );\n\t}", "function jigoshop_upgrade_99() {\n\tglobal $wpdb;\n\n\t$q = $wpdb->get_results(\"SELECT *\n\t\tFROM $wpdb->term_taxonomy\n\t\tWHERE taxonomy LIKE 'product_attribute_%'\n\t\");\n\n\tforeach($q as $item) {\n\t\t$taxonomy = str_replace('product_attribute_', 'pa_', $item->taxonomy);\n\n\t\t$wpdb->update(\n\t\t\t$wpdb->term_taxonomy,\n\t\t\tarray('taxonomy' => $taxonomy),\n\t\t\tarray('term_taxonomy_id' => $item->term_taxonomy_id)\n\t\t);\n\t}\n}", "public static function makeFakeProduct($attributes = []) {\n list($product) = self::makeFromFile(storage_path('/testing/VALID_TESTFILE.XML'));\n foreach ($attributes as $attribute => $value) {\n $product->$attribute = $value;\n }\n return $product;\n }", "public function createAttributes(array $attributes=null, PpTask $ppTask=null){\n // TODO: Implement createAttributes() method.\n throw new NotImplementedException();\n }", "function addVariation($data,$form){\r\n\t\tif(isset($data['ProductAttributes'])){\r\n\t\t\t$data['ProductAttributes'] = Convert::raw2sql($data['ProductAttributes']);\r\n\t\t\t$variation = $this->owner->getVariationByAttributes($data['ProductAttributes']);\r\n\t\t\tif($variation) {\r\n\t\t\t\tif($variation->canPurchase()) {\r\n\t\t\t\t\t$quantity = round($data['Quantity'], $variation->QuantityDecimals());\r\n\t\t\t\t\tif(!$quantity) {\r\n\t\t\t\t\t\t$quantity = 1;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tShoppingCart::singleton()->addBuyable($variation,$quantity);\r\n\t\t\t\t\tif($variation->IsInCart()) {\r\n\t\t\t\t\t\t$msg = _t(\"ProductWithVariationDecorator.SUCCESSFULLYADDED\",\"Added to cart.\");\r\n\t\t\t\t\t\t$status = \"good\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$msg = _t(\"ProductWithVariationDecorator.NOTSUCCESSFULLYADDED\",\"Not added to cart.\");\r\n\t\t\t\t\t\t$status = \"bad\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$msg = _t(\"ProductWithVariationDecorator.VARIATIONNOTAVAILABLE\",\"That option is not available.\");\r\n\t\t\t\t\t$status = \"bad\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$msg = _t(\"ProductWithVariationDecorator.VARIATIONNOTAVAILABLE\",\"That option is not available.\");\r\n\t\t\t\t$status = \"bad\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$msg = _t(\"ProductWithVariationDecorator.VARIATIONNOTFOUND\",\"The item(s) you are looking for are not available.\");\r\n\t\t\t$status = \"bad\";\r\n\t\t}\r\n\t\tif(Director::is_ajax()){\r\n\t\t\treturn ShoppingCart::singleton()->setMessageAndReturn($msg, $status);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t$form->sessionMessage($msg,$status);\r\n\t\t\tDirector::redirectBack();\r\n\t\t}\r\n\t}", "function get_product_category_attribute_terms($category_id) {\n $args = array(\n 'post_type' => 'product',\n 'post_status' => 'publish',\n 'ignore_sticky_posts' => 1,\n 'posts_per_page' => -1, // return all products (offset ignored with -1)\n 'tax_query' => array(\n array(\n 'taxonomy' => 'product_cat',\n 'field' => 'term_id', //This is optional, as it defaults to 'term_id'\n 'terms' => $category_id,\n 'operator' => 'IN' // Possible values are 'IN', 'NOT IN', 'AND'.\n ),\n array(\n 'taxonomy' => 'product_visibility',\n 'field' => 'slug',\n 'terms' => 'exclude-from-catalog', // Possibly 'exclude-from-search' too\n 'operator' => 'NOT IN'\n )\n )\n );\n $products_response = new WP_Query($args);\n $products = $products_response->posts;\n // Get product attribute details\n $attribute_taxonomies = wc_get_attribute_taxonomies();\n // Initialize response array\n $category_attribute_terms = array();\n // For each product attribute\n foreach ($attribute_taxonomies as $attribute_taxonomy) {\n // Get all attribute options for each product in the category\n $options = array_map(function($product) use ($attribute_taxonomy) {\n $terms = get_the_terms($product->ID, 'pa_' . $attribute_taxonomy->attribute_name);\n return $terms ? $terms : [];\n }, $products);\n // Remove duplicate options\n $unique_options =\n array_values(\n array_unique(\n array_merge(...$options),\n SORT_REGULAR\n )\n );\n // Push attribute details and options to attribute terms array\n $category_attribute_terms[] = (object) [\n 'id' => $attribute_taxonomy->attribute_id,\n 'name' => $attribute_taxonomy->attribute_name,\n 'label' => $attribute_taxonomy->attribute_label,\n 'slug' => 'pa_' . $attribute_taxonomy->attribute_name,\n 'options' => $unique_options\n ];\n }\n return $category_attribute_terms;\n}", "public function createAttribute($attribute, $value){\r\n \r\n if(isset($this->xmlselect)){\r\n \r\n foreach ($this->xmlselect as $node) { \r\n $node->setAttribute($attribute, $value);\r\n }\r\n \r\n return TRUE;\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "public function create_attribute( $name, $type, $enumeration_values = [ ], $active = true ) {\n $a = $this->call( 'metaCreateAttributeDefinitions', [\n 'attributeDefinitions' => [\n 'name' => $name,\n 'type' => strtoupper( $type ),\n 'enumerationValues' => $enumeration_values,\n 'active' => $active,\n ] ] );\n\n return $a ? true : false;\n }", "public function __construct()\n {\n $defaultAttributeSetId = \\Mage::getSingleton('eav/config')\n ->getEntityType(\\Mage_Catalog_Model_Product::ENTITY)\n ->getDefaultAttributeSetId();\n $set = \\Mage::getModel('eav/entity_attribute_set')->load(4);\n $gid = $set->getDefaultGroupId();\n\n $that = $this;\n $this->setDefaultParameters(array(\n 'type'=> 'text',\n 'input'=> 'text',\n 'label'=> 'Test Attribute',\n 'global'=> \\Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,\n 'is_required'=> '0',\n 'is_comparable'=> '0',\n 'is_searchable'=> '0',\n 'is_unique'=> '1',\n 'is_configurable'=> '1',\n 'user_defined'=> '1',\n 'attribute_code' => function() use($that) { return $that->nextValue('attribute_code', function($i){return 'attribute_fixture_code_' . $i; }); },\n 'frontend_label' => function() use($that) { return $that->nextValue('frontend_label', function($i){return 'Attribute Fixture ' . $i; }); },\n 'attribute_set_id' => $defaultAttributeSetId,\n 'attribute_group_id' => $gid\n ));\n }", "function set_variation_attributes(array $data) {\n\t\tif ( ! empty( $this->variation_data ) && is_array( $this->variation_data ) ) foreach ($this->variation_data as $attribute=>$value) {\n\t\t\tif(isset($data[$attribute])) {\n\t\t\t\t$this->variation_data[$attribute] = $data[$attribute];\n\t\t\t}\n\t\t}\n\t}", "public function store(Request $request)\n\t{\n\t\t$params = $request->except('_token');\n\t\t\n\t\t$product = Product::findOrFail($params['product_id']);\n\t\t$slug = $product->slug;\n\n\t\t$attributes = [];\n\t\tif ($product->configurable()) {\n\t\t\t$product = Product::from('products as p')\n\t\t\t\t\t\t\t->whereRaw(\"p.parent_id = :parent_product_id\n\t\t\t\t\t\t\tand (select pav.text_value \n\t\t\t\t\t\t\t\t\tfrom product_attribute_values pav\n\t\t\t\t\t\t\t\t\tjoin attributes a on a.id = pav.attribute_id\n\t\t\t\t\t\t\t\t\twhere a.code = :size_code\n\t\t\t\t\t\t\t\t\tand pav.product_id = p.id\n\t\t\t\t\t\t\t\t\tlimit 1\n\t\t\t\t\t\t\t\t) = :size_value\n\t\t\t\t\t\t\tand (select pav.text_value \n\t\t\t\t\t\t\t\t\tfrom product_attribute_values pav\n\t\t\t\t\t\t\t\t\tjoin attributes a on a.id = pav.attribute_id\n\t\t\t\t\t\t\t\t\twhere a.code = :color_code\n\t\t\t\t\t\t\t\t\tand pav.product_id = p.id\n\t\t\t\t\t\t\t\t\tlimit 1\n\t\t\t\t\t\t\t\t) = :color_value\n\t\t\t\t\t\t\t\t\", [\n\t\t\t\t\t\t\t\t\t'parent_product_id' => $product->id,\n\t\t\t\t\t\t\t\t\t'size_code' => 'size',\n\t\t\t\t\t\t\t\t\t'size_value' => $params['size'],\n\t\t\t\t\t\t\t\t\t'color_code' => 'color',\n\t\t\t\t\t\t\t\t\t'color_value' => $params['color'],\n\t\t\t\t\t\t\t\t])->firstOrFail();\n\n\t\t\t$attributes['size'] = $params['size'];\n\t\t\t$attributes['color'] = $params['color'];\n\t\t}\n\n\t\t$item = [\n\t\t\t'id' => md5($product->id),\n\t\t\t'name' => $product->name,\n\t\t\t'price' => $product->price,\n\t\t\t'quantity' => $params['qty'],\n\t\t\t'attributes' => $attributes,\n\t\t\t'associatedModel' => $product,\n\t\t];\n\n\t\t\\Cart::add($item);\n\n\t\t\\Session::flash('success', 'Product '. $item['name'] .' has been added to cart');\n\t\treturn redirect('/product/'. $slug);\n\t}", "function save_custom_field( $post_id ) {\r\n $user = wp_get_current_user();\r\n $_warehouse_flag = isset( $_POST['_warehouse_flag'] ) ? $_POST['_warehouse_flag'] : '';\r\n $product = wc_get_product( $post_id );\r\n \r\n if($_warehouse_flag==1){\r\n\t $product->update_meta_data( '_warehouse_flag', 'A' );\r\n }\r\n if($_warehouse_flag==2){\r\n\t $product->update_meta_data( '_warehouse_flag', 'V' );\r\n }\r\n $_enable_warehouse = isset( $_POST['_enable_warehouse'] ) ? $_POST['_enable_warehouse'] : '0';\r\n \r\n \r\n $product->update_meta_data( '_enable_warehouse', $_enable_warehouse );\r\n if($_enable_warehouse==1){\r\n\t $categories = [ 'Warehouse Product'];\r\n\t wp_set_object_terms( $post_id, $categories, 'warehouses' );\r\n }\r\n else{\r\n\t $categories = [ 'Warehouse Product'];\r\n\t wp_set_object_terms( $post_id, null, 'warehouses' );\r\n }\r\n \r\n $product->save();\r\n \r\n \r\n}", "private function createWarrantyProduct()\n {\n /**\n * @var $product Mage_Catalog_Model_Product\n */\n foreach ($this->warrantyProductSkus as $warrantyProductSku => $productName) {\n if (!$product = Mage::getModel('catalog/product')->loadByAttribute('sku', $warrantyProductSku)) {\n $product = Mage::getModel('catalog/product');\n\n $product->setTypeId(Mulberry_Warranty_Model_Product_Type_Warranty::TYPE_ID)\n ->setSku($warrantyProductSku)\n ->setName($productName)\n ->setDescription(sprintf('%s, Product Placeholder', $productName))\n ->setShortDescription(sprintf('%s, Product Placeholder', $productName))\n ->setStatus(Mage_Catalog_Model_Product_Status::STATUS_ENABLED)\n ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_IN_CATALOG)\n ->setAttributeSetId(4)\n ->setTaxClassId(0)\n ->setPrice(10.00)\n ->setStockData(array(\n 'use_config_manage_stock' => 0,\n 'manage_stock' => 0,\n 'is_in_stock' => 1,\n 'qty' => 10,\n ));\n\n $product->save();\n }\n }\n }", "protected function _generateAttributeOnToken()\n\t{\n\t\tif (!isset($this->_tempToken[\"args\"][\"attributes\"])) {\n\t\t\t$this->_tempToken[\"args\"][\"attributes\"] = array();\n\t\t}\n\t\tif (isset($this->_tempToken[\"args\"][\"attributes\"][$this->_attribute])) {\n\t\t\t$this->_attribute = null;\n\t\t} else {\n\t\t\t$this->_tempToken[\"args\"][\"attributes\"][$this->_attribute] = array(\n\t\t\t\t\"value\" => \"\"\n\t\t\t);\n\t\t}\n\t}", "private function getSwatchAttributes(Product $product)\n {\n $swatchAttributes = $this->swatchAttributesProvider->provide($product);\n return $swatchAttributes;\n }", "function check_for_product_attribute( $attribute ) {\n\n\tglobal $wpdb;\n\n\t$taxonomy_table_name = $wpdb->prefix . \"term_taxonomy\";\n\n\t$taxonomy_sql = \"SELECT * FROM \" . $taxonomy_table_name . \" WHERE taxonomy = 'pa_$attribute'\";\n\t$taxonomy_table_rows = $wpdb->get_results($taxonomy_sql, ARRAY_A);\n\n\tif ( $taxonomy_table_rows ) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n}", "public function addProductAttributes(Varien_Event_Observer $observer)\n {\n // @var Varien_Object\n $attributesTransfer = $observer->getEvent()->getAttributes();\n\n $attributes = Mage::getResourceModel('amshiprules/rule')->getAttributes();\n \n $result = array();\n foreach ($attributes as $code) {\n $result[$code] = true;\n }\n $attributesTransfer->addData($result);\n \n return $this;\n }", "public function getProductAttribute($product_id) {\n\t\t$attribute = array();\n\n\t\tif ($this->MultiLanguages && $this->CountLanguages > 1) {\n\t\t\t$field = ', patt.attribute_id';\n\t\t} else {\n\t\t\t$field = '';\n\t\t}\n\n\t\t$sql = \"SELECT CONCAT_WS('\" . $this->AttributeDelimiter . \"'\" . $field . \", attgd.name, attd.name, patt.text) AS p_attribute FROM `\" . DB_PREFIX . \"product_attribute` patt\n\t\t \tLEFT JOIN `\" . DB_PREFIX . \"attribute_description` attd ON (attd.attribute_id = patt.attribute_id)\n\t\t \tLEFT JOIN `\" . DB_PREFIX . \"attribute` att ON (attd.attribute_id = att.attribute_id) \n\t\t \tLEFT JOIN `\" . DB_PREFIX . \"attribute_group_description` attgd ON (attgd.attribute_group_id = att.attribute_group_id)\n\t\t \tWHERE patt.product_id = \" . (int)$product_id . \" AND attgd.language_id = '\" . (int)$this->LanguageID . \"' AND attd.language_id = '\" . (int)$this->LanguageID . \"' AND patt.language_id = '\" . (int)$this->LanguageID . \"'\";\n\t\t$query = $this->db->query($sql);\n\n\t\tforeach ( $query->rows as $result ) {\n\t\t\t$attribute[] = htmlspecialchars_decode($result['p_attribute']);\n\t\t}\n\n\t\treturn implode(\"\\n\", $attribute);\n\t}", "protected function prepareAttributeSet()\n {\n /** @var ConfigurableAttributesData $configurableAttributesData */\n $configurableAttributesData = $this->fixture->getDataFieldConfig('configurable_attributes_data')['source'];\n $attributeSet = $configurableAttributesData->getAttributeSet();\n\n $this->fields['product']['attribute_set_id'] = $attributeSet->getAttributeSetId();\n }", "public function store()\n {\n $this->validate(request(), [\n 'code' => ['required', 'unique:attributes,code,NULL,NULL,entity_type,' . request('entity_type'), new Code],\n 'name' => 'required',\n 'type' => 'required',\n ]);\n\n Event::dispatch('settings.attribute.create.before');\n\n request()->request->add(['quick_add' => 1]);\n\n $attribute = $this->attributeRepository->create(request()->all());\n\n Event::dispatch('settings.attribute.create.after', $attribute);\n\n session()->flash('success', trans('admin::app.settings.attributes.create-success'));\n\n return redirect()->route('admin.settings.attributes.index');\n }", "function storeObjectAttribute( $attribute )\n {}", "public function add($data)\n {\n // create product SKU\n $this->model->creating(function ($product) use ($data) {\n\n $product->sku = $this->generateProductSKU();\n\n $product->category_id = array_get($data, 'category_id');\n $product->subcategory_id = array_get($data, 'subcategory_id');\n $product->brand_id = array_get($data, 'brand_id');\n });\n\n return parent::add($data);\n }", "public static function update_product_enhanced_catalog_attribute( \\WC_Product $product, $attribute_key, $value ) {\n\t\t// Ensure that we don't override a default with the same value\n\t\t// as the default.\n\t\tif ( self::get_enhanced_catalog_attribute( $attribute_key, $product ) === $value ) {\n\t\t\treturn;\n\t\t}\n\t\t$product->update_meta_data( self::ENHANCED_CATALOG_ATTRIBUTES_META_KEY_PREFIX . $attribute_key, $value );\n\t\t$product->save_meta_data();\n\t}", "private function createNewProduct($data, $taxClassIds, $logFile)\n\t{\t\n\t\t$sku = $data[1];\n\t\t$inventory = $data[4];\n\t\t$answer_code = $data[3];\n\n\t\t$websiteIds[0] = Mage::getModel('core/website')->load('Main Website', 'name')->getId();\n\t\t$storeIds[0] = Mage::getModel('core/store')->load('Default Store View', 'name')->getId();\n \t\n\t\t$product = new Mage_Catalog_Model_Product();\n\t\t$product->setWebsiteIDs($websiteIds);\n\t\t$product->setStoreIDs($storeIds);\n\t\t\t\n\t\tif($data[13] == \"V\") //Virtual Product\n\t\t{\n\t\t\t$product->setTypeId('virtual');\n\t\t}\n\t\telse if ($data[13] == \"D\") //Downloadable\n\t\t{\n\t\t\t$product->setTypeId('downloadable');\t\n\t\t}\n\t\telse if ($data[13] == \"G\") //Gift Card\n\t\t{\n\t\t\t$product->setTypeId('giftcard');\t\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$product->setTypeId('simple');\t\n\t\t}\n\n\t\t//Attribute Set Id\n\t\t$attrSetName = \"Default\";\n\t\t$entityTypeId = Mage::getModel('eav/entity')->setType('catalog_product')->getTypeId();\n\t\t$attributeSetName = $attrSetName;\n\t\t$attributeSetId = Mage::getModel('eav/entity_attribute_set')\n\t\t\t->getCollection()\n\t\t\t->setEntityTypeFilter($entityTypeId)\n\t\t\t->addFieldToFilter('attribute_set_name', $attributeSetName)\n\t\t\t->getFirstItem()->getAttributeSetId();\n\t\t\t\t\t\n\t\t$product->setAttributeSetId($attributeSetId);\n\t\t$product->setSku($sku);\t\t \t \t\t\n\t\t$product->setName($data[12]);\n \t\t$product->setVisibility(1);\n\t\t$product->setStatus(1);\n\n\t\t$urlKey = $product->getName();\n\t\t$urlKey = Mage::helper('catalog/product_url')->format($urlKey);\n\t\t$urlKey = preg_replace('#[^0-9a-z]+#i', '-',$urlKey);\n\t\t$urlKey = $urlKey . '-' . $sku;\n\t\t$urlKey = strtolower($urlKey);\n\t\ttrim($urlKey, '-');\n\t\t$product->setUrlKey($urlKey);\n\n\t $product->setTaxClassId($taxClassIds[\"Taxable Goods\"]);\n\t\t$product->setData('taxware_taxcode',$data[19]);\n\t\t\t\n\t\t$product->save();\n\t\tMage::log(\"Created Product: \".$product->getSku().\"\\r\\n\",null, $logFile);\n \t\t\t\t\t\n \t$this->createStockItem($product, $logFile);\n\n\t\treturn $product;\n\t}", "public static function product_has_attribute( \\WC_Product $product, $attribute_name ) {\n\n\t\t$found = false;\n\n\t\tforeach ( self::get_available_product_attributes( $product ) as $slug => $attribute ) {\n\n\t\t\t// taxonomy attributes have a slugged name, but custom attributes do not so we check the attribute key\n\t\t\tif ( $attribute_name === $slug ) {\n\t\t\t\t$found = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $found;\n\t}" ]
[ "0.7642212", "0.71080834", "0.679357", "0.679022", "0.67631924", "0.66569114", "0.661187", "0.6421657", "0.63534504", "0.6316779", "0.62813246", "0.6220715", "0.6215473", "0.61746836", "0.61465317", "0.6143786", "0.612489", "0.6116451", "0.6090914", "0.6072141", "0.6052166", "0.60482234", "0.6011499", "0.600438", "0.5982449", "0.5956709", "0.5956701", "0.5946729", "0.59167385", "0.59030753", "0.5890837", "0.58816785", "0.58762753", "0.58365107", "0.5828569", "0.58256274", "0.5817501", "0.579852", "0.57720524", "0.5763144", "0.5715909", "0.57001996", "0.56996", "0.56964594", "0.56889516", "0.56787604", "0.5664386", "0.5661477", "0.56554806", "0.5640781", "0.5633326", "0.5629755", "0.56259936", "0.56205225", "0.56129974", "0.5601632", "0.5569089", "0.5540591", "0.55402595", "0.5529049", "0.55288947", "0.5513189", "0.55092067", "0.5508777", "0.55048895", "0.5500437", "0.54957885", "0.54878205", "0.54858375", "0.54762304", "0.5475251", "0.54686683", "0.54585254", "0.5457039", "0.54297984", "0.542883", "0.5428495", "0.5426449", "0.5426346", "0.5419771", "0.541971", "0.54127306", "0.5410594", "0.5403323", "0.5399764", "0.5399756", "0.5391975", "0.538874", "0.5388645", "0.5387599", "0.5384515", "0.53757936", "0.5375056", "0.5371577", "0.5365646", "0.53646857", "0.5354553", "0.53507566", "0.5346312", "0.5344021" ]
0.8040051
0
/ / Check for existing WooCommerce Product Attribute Term /
function check_for_attribute_term( $term_name ) { global $wpdb; $terms_table = $wpdb->prefix . "terms"; $terms_sql = "SELECT * FROM " . $terms_table . " WHERE name = '$term_name'"; if ( $wpdb->get_results($terms_sql, ARRAY_A) ) { $response = true; } else { $response = false; } return $response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function check_for_product_attribute( $attribute ) {\n\n\tglobal $wpdb;\n\n\t$taxonomy_table_name = $wpdb->prefix . \"term_taxonomy\";\n\n\t$taxonomy_sql = \"SELECT * FROM \" . $taxonomy_table_name . \" WHERE taxonomy = 'pa_$attribute'\";\n\t$taxonomy_table_rows = $wpdb->get_results($taxonomy_sql, ARRAY_A);\n\n\tif ( $taxonomy_table_rows ) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n}", "public function hasTermAttributes() {\n return $this->_has(19);\n }", "function create_product_attribute_term( $term_name, $attribute_name ) {\n\tif ( wp_insert_term( $term_name, $attribute_name ) ) {\n\t\twisync_admin_notice__success( $term_name . ' added to Product Attributes.' );\n\t} else {\n\t\twisync_admin_notice__error( 'Failed to add ' . $term_name . ' to Product Attributes.' );\n\t}\n}", "function create_product_attribute( $label_name ) {\n global $wpdb;\n\n $slug = sanitize_title( $label_name );\n\n if ( strlen( $slug ) >= 28 ) {\n return new WP_Error( 'invalid_product_attribute_slug_too_long', sprintf( __( 'Name \"%s\" is too long (28 characters max). Shorten it, please.', 'woocommerce' ), $slug ), array( 'status' => 400 ) );\n } elseif ( wc_check_if_attribute_name_is_reserved( $slug ) ) {\n return new WP_Error( 'invalid_product_attribute_slug_reserved_name', sprintf( __( 'Name \"%s\" is not allowed because it is a reserved term. Change it, please.', 'woocommerce' ), $slug ), array( 'status' => 400 ) );\n } elseif ( taxonomy_exists( wc_attribute_taxonomy_name( $label_name ) ) ) {\n return new WP_Error( 'invalid_product_attribute_slug_already_exists', sprintf( __( 'Name \"%s\" is already in use. Change it, please.', 'woocommerce' ), $label_name ), array( 'status' => 400 ) );\n }\n\n $data = array(\n 'attribute_label' => $label_name,\n 'attribute_name' => $slug,\n 'attribute_type' => 'select',\n 'attribute_orderby' => 'menu_order',\n 'attribute_public' => 0, // Enable archives ==> true (or 1)\n );\n\n $results = $wpdb->insert( \"{$wpdb->prefix}woocommerce_attribute_taxonomies\", $data );\n\n if ( is_wp_error( $results ) ) {\n return new WP_Error( 'cannot_create_attribute', $results->get_error_message(), array( 'status' => 400 ) );\n } else {\n\t\twisync_admin_notice__success( 'Created ' . $label_name . ' as Product Attribute.' );\n\t}\n\n $id = $wpdb->insert_id;\n\n do_action('woocommerce_attribute_added', $id, $data);\n\n wp_schedule_single_event( time(), 'woocommerce_flush_rewrite_rules' );\n\n delete_transient('wc_attribute_taxonomies');\n}", "public static function product_has_attribute( \\WC_Product $product, $attribute_name ) {\n\n\t\t$found = false;\n\n\t\tforeach ( self::get_available_product_attributes( $product ) as $slug => $attribute ) {\n\n\t\t\t// taxonomy attributes have a slugged name, but custom attributes do not so we check the attribute key\n\t\t\tif ( $attribute_name === $slug ) {\n\t\t\t\t$found = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $found;\n\t}", "function product_attribute_description() {\n echo wpautop( __( 'Attribute terms can be assigned to products and variations.<br/><br/><b>Note</b>: Deleting a term will remove it from all products and variations to which it has been assigned. Recreating a term will not automatically assign it back to products.', 'woocommerce' ) );\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}", "public function hasAttributes(){\n if (!JeproshopCombinationModelCombination::isFeaturePublished()){ return 0; }\n\n $db = JFactory::getDBO();\n\t\t$query = \"SELECT COUNT(*) FROM \" . $db->quoteName('#__jeproshop_product_attribute') . \" AS product_attribute \" ;\n\t\t$query .= JeproshopShopModelShop::addSqlAssociation('product_attribute') . \" WHERE product_attribute.\" . $db->quoteName('product_id') . \" = \" . (int)$this->product_id;\n\n $db->setQuery($query);\n return $db->loadResult();\n }", "function tep_has_product_attributes($products_id) {\n $attributes_query = tep_db_query(\"select count(*) as count from \" . TABLE_PRODUCTS_ATTRIBUTES . \" where products_id = '\" . $products_id . \"'\");\n $attributes = tep_db_fetch_array($attributes_query);\n\n if ($attributes['count'] > 0) {\n return true;\n } else {\n return false;\n }\n}", "function has_term_meta($term_id)\n {\n }", "function get_product_category_attribute_terms($category_id) {\n $args = array(\n 'post_type' => 'product',\n 'post_status' => 'publish',\n 'ignore_sticky_posts' => 1,\n 'posts_per_page' => -1, // return all products (offset ignored with -1)\n 'tax_query' => array(\n array(\n 'taxonomy' => 'product_cat',\n 'field' => 'term_id', //This is optional, as it defaults to 'term_id'\n 'terms' => $category_id,\n 'operator' => 'IN' // Possible values are 'IN', 'NOT IN', 'AND'.\n ),\n array(\n 'taxonomy' => 'product_visibility',\n 'field' => 'slug',\n 'terms' => 'exclude-from-catalog', // Possibly 'exclude-from-search' too\n 'operator' => 'NOT IN'\n )\n )\n );\n $products_response = new WP_Query($args);\n $products = $products_response->posts;\n // Get product attribute details\n $attribute_taxonomies = wc_get_attribute_taxonomies();\n // Initialize response array\n $category_attribute_terms = array();\n // For each product attribute\n foreach ($attribute_taxonomies as $attribute_taxonomy) {\n // Get all attribute options for each product in the category\n $options = array_map(function($product) use ($attribute_taxonomy) {\n $terms = get_the_terms($product->ID, 'pa_' . $attribute_taxonomy->attribute_name);\n return $terms ? $terms : [];\n }, $products);\n // Remove duplicate options\n $unique_options =\n array_values(\n array_unique(\n array_merge(...$options),\n SORT_REGULAR\n )\n );\n // Push attribute details and options to attribute terms array\n $category_attribute_terms[] = (object) [\n 'id' => $attribute_taxonomy->attribute_id,\n 'name' => $attribute_taxonomy->attribute_name,\n 'label' => $attribute_taxonomy->attribute_label,\n 'slug' => 'pa_' . $attribute_taxonomy->attribute_name,\n 'options' => $unique_options\n ];\n }\n return $category_attribute_terms;\n}", "function check_if_metal_types_exist()\r\n{\r\n\twrite_log(\"Checking Metal Types Exist\");\r\n\t$term = term_exists('gold', 'metal_type');\r\n\tif ($term === null) {\r\n\t\twrite_log(\"Making GOLD\");\r\n\r\n\t\twp_insert_term(\r\n\t\t 'Gold', // the term \r\n\t\t 'metal_type', // the taxonomy\r\n\t\t array(\r\n\t\t\t'description'=> 'Gold Metal',\r\n\t\t\t'slug' => 'gold',\r\n\t\t\t'parent'=> 0 // get numeric term id\r\n\t\t )\r\n\t\t);\r\n\t}\r\n\t\r\n\t$term = term_exists('silver', 'metal_type');\r\n\tif ($term === null) {\r\n\t\twrite_log(\"Making SILVER\");\r\n\r\n\t\twp_insert_term(\r\n\t\t 'Silver', // the term \r\n\t\t 'metal_type', // the taxonomy\r\n\t\t array(\r\n\t\t\t'description'=> 'Silver Metal',\r\n\t\t\t'slug' => 'silver',\r\n\t\t\t'parent'=> 0 // get numeric term id\r\n\t\t )\r\n\t\t);\r\n\t}\r\n\r\n\t$term = term_exists('platinum', 'metal_type');\r\n\tif ($term === null) {\r\n\t\twrite_log(\"Making Platinum\");\r\n\r\n\t\twp_insert_term(\r\n\t\t 'Platinum', // the term \r\n\t\t 'metal_type', // the taxonomy\r\n\t\t array(\r\n\t\t\t'description'=> 'Platinum Metal',\r\n\t\t\t'slug' => 'platinum',\r\n\t\t\t'parent'=> 0 // get numeric term id\r\n\t\t )\r\n\t\t);\r\n\t}\r\n\r\n\t$term = term_exists('palladium', 'metal_type');\r\n\tif ($term === null) {\r\n\t\twrite_log(\"Making Palladium\");\r\n\r\n\t\twp_insert_term(\r\n\t\t 'Palladium', // the term \r\n\t\t 'metal_type', // the taxonomy\r\n\t\t array(\r\n\t\t\t'description'=> 'Palladium Metal',\r\n\t\t\t'slug' => 'palladium',\r\n\t\t\t'parent'=> 0 // get numeric term id\r\n\t\t )\r\n\t\t);\r\n\t}\r\n\t\r\n\t\r\n\twrite_log(\"End of Metal Types Exist\");\t\t\t\r\n}", "function acf_isset_termmeta($taxonomy = '')\n{\n}", "function tep_has_product_attributes($products_id) {\n\t$attributes_query = tep_db_query(\"select count(*) as count from \" . TABLE_PRODUCTS_ATTRIBUTES . \" where products_id = '\" . (int)$products_id . \"'\");\n\t$attributes = tep_db_fetch_array($attributes_query);\n\tif ($attributes['count'] > 0) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "private function has_attribute($attritube)\n {\n $allattribute=$this->attribute();\n if(array_key_exists($attritube,$allattribute))\n return true;\n return false;\n }", "function wp_check_term_meta_support_prefilter($check)\n {\n }", "function specialities_taxonomy_custom_fields($tag) {\n // Check for existing taxonomy meta for the term you're editing\n $t_id = $tag->term_id; // Get the ID of the term you're editing\n $term_meta = get_option( \"taxonomy_term_$t_id\" ); // Do the check\n\t?>\n\n\t<tr class=\"form-field\">\n\t\t<th scope=\"row\" valign=\"top\">\n\t\t\t<label for=\"s_keyword\"><?php _e('Search Keyword'); ?></label>\n\t\t</th>\n\t\t<td>\n\t\t\t<input type=\"text\" name=\"term_meta[s_keyword]\" id=\"term_meta[s_keyword]\" size=\"25\" style=\"width:60%;\" value=\"<?php echo $term_meta['s_keyword'] ? $term_meta['s_keyword'] : ''; ?>\" data-role=\"tagsinput\"><br />\n\t\t\t<span class=\"description\"><?php _e('Search Keyword description'); ?></span>\n\t\t</td>\n\t</tr>\n\n\t<?php\n}", "function jigoshop_upgrade_99() {\n\tglobal $wpdb;\n\n\t$q = $wpdb->get_results(\"SELECT *\n\t\tFROM $wpdb->term_taxonomy\n\t\tWHERE taxonomy LIKE 'product_attribute_%'\n\t\");\n\n\tforeach($q as $item) {\n\t\t$taxonomy = str_replace('product_attribute_', 'pa_', $item->taxonomy);\n\n\t\t$wpdb->update(\n\t\t\t$wpdb->term_taxonomy,\n\t\t\tarray('taxonomy' => $taxonomy),\n\t\t\tarray('term_taxonomy_id' => $item->term_taxonomy_id)\n\t\t);\n\t}\n}", "public function add_attribute($post_id, $key, $value) \n\t { \n\t global $wpdb;\n\t global $woocommerce;\n\t\t\t \n\t // get attribute name, label\n\t if ( isset($this->amz_settings['attr_title_normalize']) && $this->amz_settings['attr_title_normalize'] == 'yes' )\n\t \t$attribute_label = $this->attrclean_splitTitle( $key );\n\t\t\telse\n\t\t\t\t$attribute_label = $key;\n\t $attribute_name = $this->the_plugin->cleanTaxonomyName($key, false);\n\n\t // set attribute type\n\t $attribute_type = 'select';\n\t \n\t // check for duplicates\n\t $attribute_taxonomies = $wpdb->get_var(\"SELECT * FROM {$wpdb->prefix}woocommerce_attribute_taxonomies WHERE attribute_name = '\".esc_sql($attribute_name).\"'\");\n\t \n\t if ($attribute_taxonomies) {\n\t // update existing attribute\n\t $wpdb->update(\n $wpdb->prefix . 'woocommerce_attribute_taxonomies', array(\n\t\t 'attribute_label' => $attribute_label,\n\t\t 'attribute_name' => $attribute_name,\n\t\t 'attribute_type' => $attribute_type,\n\t\t 'attribute_orderby' => 'name'\n ), array('attribute_name' => $attribute_name)\n\t );\n\t } else {\n\t // add new attribute\n\t $wpdb->insert(\n\t $wpdb->prefix . 'woocommerce_attribute_taxonomies', array(\n\t \t'attribute_label' => $attribute_label,\n\t \t'attribute_name' => $attribute_name,\n\t \t'attribute_type' => $attribute_type,\n\t \t'attribute_orderby' => 'name'\n\t )\n\t );\n\t }\n\n\t // avoid object to be inserted in terms\n\t if (is_object($value))\n\t return;\n\t\n\t // add attribute values if not exist\n\t $taxonomy = $this->the_plugin->cleanTaxonomyName($attribute_name);\n\t\t\t\n\t if( is_array( $value ) )\n\t {\n\t $values = $value;\n\t }\n\t else\n\t {\n\t $values = array($value);\n\t }\n \n\t // check taxonomy\n\t if( !taxonomy_exists( $taxonomy ) ) \n\t {\n\t // add attribute value\n\t foreach ($values as $attribute_value) {\n\t \t$attribute_value = (string) $attribute_value;\n\n\t if (is_string($attribute_value)) {\n\t // add term\n\t //$name = stripslashes($attribute_value);\n\t\t\t\t\t\t$name = $this->the_plugin->cleanValue( $attribute_value ); // 2015, october 28 - attributes bug update!\n\t $slug = sanitize_title($name);\n\t\t\t\t\t\t\n\t if( !term_exists($name) ) {\n\t if( trim($slug) != '' && trim($name) != '' ) {\n\t \t$this->the_plugin->db_custom_insert(\n\t \t\t$wpdb->terms,\n\t \t\tarray(\n\t \t\t\t'values' => array(\n\t\t \t'name' => $name,\n\t\t \t'slug' => $slug\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t'format' => array(\n\t\t\t\t\t\t\t\t\t\t\t'%s', '%s'\n\t\t\t\t\t\t\t\t\t\t)\n\t \t\t),\n\t \t\ttrue\n\t \t);\n\t /*$wpdb->insert(\n $wpdb->terms, array(\n\t\t 'name' => $name,\n\t\t 'slug' => $slug\n )\n\t );*/\n\t\n\t // add term taxonomy\n\t $term_id = $wpdb->insert_id;\n\t \t$this->the_plugin->db_custom_insert(\n\t \t\t$wpdb->term_taxonomy,\n\t \t\tarray(\n\t \t\t\t'values' => array(\n\t\t \t'term_id' => $term_id,\n\t\t \t'taxonomy' => $taxonomy\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t'format' => array(\n\t\t\t\t\t\t\t\t\t\t\t'%d', '%s'\n\t\t\t\t\t\t\t\t\t\t)\n\t \t\t),\n\t \t\ttrue\n\t \t);\n\t /*$wpdb->insert(\n $wpdb->term_taxonomy, array(\n\t\t 'term_id' => $term_id,\n\t\t 'taxonomy' => $taxonomy\n )\n\t );*/\n\t\t\t\t\t\t\t\t$term_taxonomy_id = $wpdb->insert_id;\n\t\t\t\t\t\t\t\t$__dbg = compact('taxonomy', 'attribute_value', 'term_id', 'term_taxonomy_id');\n\t\t\t\t\t\t\t\t//var_dump('<pre>1: ',$__dbg,'</pre>');\n\t }\n\t } else {\n\t // add term taxonomy\n\t $term_id = $wpdb->get_var(\"SELECT term_id FROM {$wpdb->terms} WHERE name = '\".esc_sql($name).\"'\");\n\t $this->the_plugin->db_custom_insert(\n\t \t$wpdb->term_taxonomy,\n\t \tarray(\n\t \t\t'values' => array(\n\t\t \t\t'term_id' => $term_id,\n\t\t \t\t'taxonomy' => $taxonomy\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'format' => array(\n\t\t\t\t\t\t\t\t\t\t'%d', '%s'\n\t\t\t\t\t\t\t\t\t)\n\t \t),\n\t \ttrue\n\t );\n\t /*$wpdb->insert(\n \t\t$wpdb->term_taxonomy, array(\n\t\t 'term_id' => $term_id,\n\t\t 'taxonomy' => $taxonomy\n )\n\t );*/\n\t\t\t\t\t\t\t$term_taxonomy_id = $wpdb->insert_id;\n\t\t\t\t\t\t\t$__dbg = compact('taxonomy', 'attribute_value', 'term_id', 'term_taxonomy_id');\n\t\t\t\t\t\t\t//var_dump('<pre>1c: ',$__dbg,'</pre>');\n\t }\n\t }\n\t }\n\t }\n\t else \n\t {\n\t // get already existing attribute values\n\t $attribute_values = array();\n\t /*$terms = get_terms($taxonomy, array('hide_empty' => true));\n\t\t\t\tif( !is_wp_error( $terms ) ) {\n\t \tforeach ($terms as $term) {\n\t \t$attribute_values[] = $term->name;\n\t \t}\n\t\t\t\t} else {\n\t\t\t\t\t$error_string = $terms->get_error_message();\n\t\t\t\t\tvar_dump('<pre>',$error_string,'</pre>'); \n\t\t\t\t}*/\n\t\t\t\t$terms = $this->the_plugin->load_terms($taxonomy);\n\t foreach ($terms as $term) {\n\t \t$attribute_values[] = $term->name;\n\t }\n\t \n\t // Check if $attribute_value is not empty\n\t if( !empty( $attribute_values ) )\n\t {\n\t foreach( $values as $attribute_value ) \n\t {\n\t \t$attribute_value = (string) $attribute_value;\n\t\t\t\t\t\t$attribute_value = $this->the_plugin->cleanValue( $attribute_value ); // 2015, october 28 - attributes bug update!\n\t if( !in_array( $attribute_value, $attribute_values ) ) \n\t {\n\t // add new attribute value\n\t $__term_and_tax = wp_insert_term($attribute_value, $taxonomy);\n\t\t\t\t\t\t\t$__dbg = compact('taxonomy', 'attribute_value', '__term_and_tax');\n\t\t\t\t\t\t\t//var_dump('<pre>1b: ',$__dbg,'</pre>');\n\t }\n\t }\n\t }\n\t }\n\t\n\t // Add terms\n\t if( is_array( $value ) )\n\t {\n\t foreach( $value as $dm_v )\n\t {\n\t \t$dm_v = (string) $dm_v;\n\t if( !is_array($dm_v) && is_string($dm_v)) {\n\t \t$dm_v = $this->the_plugin->cleanValue( $dm_v ); // 2015, october 28 - attributes bug update!\n\t $__term_and_tax = wp_insert_term( $dm_v, $taxonomy );\n\t\t\t\t\t\t$__dbg = compact('taxonomy', 'dm_v', '__term_and_tax');\n\t\t\t\t\t\t//var_dump('<pre>2: ',$__dbg,'</pre>');\n\t }\n\t }\n\t }\n\t else\n\t {\n\t \t$value = (string) $value;\n\t if( !is_array($value) && is_string($value) ) {\n\t \t$value = $this->the_plugin->cleanValue( $value ); // 2015, october 28 - attributes bug update!\n\t $__term_and_tax = wp_insert_term( $value, $taxonomy );\n\t\t\t\t\t$__dbg = compact('taxonomy', 'value', '__term_and_tax');\n\t\t\t\t\t//var_dump('<pre>2b: ',$__dbg,'</pre>');\n\t }\n\t }\n\t\t\t\n\t // link to woocommerce attribute values\n\t if( !empty( $values ) )\n\t {\n\t foreach( $values as $term )\n\t {\n\t \t\n\t if( !is_array($term) && !is_object( $term ) )\n\t { \n\t $term = sanitize_title($term);\n\t \n\t $term_taxonomy_id = $wpdb->get_var( \"SELECT tt.term_taxonomy_id FROM {$wpdb->terms} AS t INNER JOIN {$wpdb->term_taxonomy} as tt ON tt.term_id = t.term_id WHERE t.slug = '\".esc_sql($term).\"' AND tt.taxonomy = '\".esc_sql($taxonomy).\"'\" );\n \n\t if( $term_taxonomy_id ) \n\t {\n\t $checkSql = \"SELECT * FROM {$wpdb->term_relationships} WHERE object_id = {$post_id} AND term_taxonomy_id = {$term_taxonomy_id}\";\n\t if( !$wpdb->get_var($checkSql) ) {\n\t $wpdb->insert(\n\t $wpdb->term_relationships, array(\n\t\t\t 'object_id' => $post_id,\n\t\t\t 'term_taxonomy_id' => $term_taxonomy_id\n\t )\n\t );\n\t }\n\t }\n\t }\n\t }\n\t }\n\t }", "function vendor_defined_taxonomy() {\n // The targeted product attribute taxonomy\n return 'pa_color'; \n}", "private function has_the_attribute($the_attribute){\n \n $object_properties = get_object_vars($this); //Function get_object_vars\n \n return array_key_exists($the_attribute, $object_properties);\n }", "public function hasTerm() {\n return $this->_has(1);\n }", "public function addAttributes($post_id)\n\t{\n\t\t$attr = 'custom';\n\t\t\n\t\twp_set_object_terms($post_id, '0', $attr);\n\n $thedata[sanitize_title($attr)] = array(\n \t'name' => wc_clean($attr),\n 'value' => '0',\n 'postion' => '0',\n 'is_visible' => '0',\n 'is_variation' => '1',\n 'is_taxonomy' => '1'\n );\n \n\t\tupdate_post_meta($post_id, '_product_attributes', $thedata);\n\t\t\t\t\t\t\n\t}", "public function hasProductAttributes(): bool\n {\n return ($this->productAttributes()->count() !== 0) ? true : false;\n }", "function filter_product_category_multiple_attributes( $query ) {\n if ($query->is_main_query()) {\n return;\n }\n // // Filter by multiple attributes and terms.\n foreach ( wc_get_attribute_taxonomy_names() as $attribute ) {\n if ( isset($_GET[$attribute]) ) {\n \t\t$array = array(\n \t\t\t'relation' \t => 'AND'\n \t\t);\n \t\tforeach ( wc_get_attribute_taxonomy_names() as $attribute ) {\n \t\t\tif ( isset($_GET[$attribute]) ) {\n \t\t\t\t$array[] = array(\n \t\t\t\t\t'taxonomy' => $attribute,\n \t\t\t\t\t'field' => 'term_id',\n \t\t\t\t\t'terms' => explode(',', $_GET[$attribute]),\n \t\t\t\t\t'operator' => 'IN'\n \t\t\t\t);\n \t\t\t}\n \t\t}\n $tax_query = $query->get( 'tax_query' );\n $tax_query[] = $array;\n \t\t$query->set( 'tax_query', $tax_query );\n \t\tbreak;\n }\n }\n return $query;\n}", "function has_term($term = '', $taxonomy = '', $post = \\null)\n {\n }", "public function validateCatalogProductAttributeCreateAction()\n {\n if (!$this->_role->getIsAll() && !$this->_request->getParam('attribute_id')) {\n $this->_forward();\n return false;\n }\n\n return true;\n }", "protected function getProductAttrCodesUseForTermGeneration()\n {\n if (count($this->_productAttrCodesUseForTermGeneration) < 1) {\n $productAttributeCodes = $this->_helper->getAutocompleteSetting('termgeneration/product_attribute_codes');\n $productAttributeCodes = trim($productAttributeCodes, ',');\n $this->_productAttrCodesUseForTermGeneration = explode(',', $productAttributeCodes);\n }\n return $this->_productAttrCodesUseForTermGeneration;\n }", "function checkAttribute($current_value_id, $current_pid, $current_product_option_id) {\n global $db,$attribute_value_price,$sortorder, $attribute_value_weight, $attribute_value_weight_prefix, $attribute_value_prefix, $attribute_value_model, $attribute_value_stock, $posCheck, $negCheck, $posCheck_weight, $negCheck_weight,$attribute_value_download_count, $attribute_value_download_expire,$attribute_value_download_filename;\n\n $query = \"SELECT * FROM products_attributes where options_values_id = '\" . $current_value_id . \"' AND products_id = ' \" . $current_pid . \"' AND options_id = '\" . $current_product_option_id . \"'\";\n $line = $db->Execute($query);\n if ($line->RecordCount()>0) {\n while(!$line->EOF) {\n\t $dl_res = $db->Execute(\"SELECT products_attributes_maxdays, products_attributes_filename, products_attributes_maxcount FROM products_attributes_download WHERE products_attributes_id = '\" . $line->fields['products_attributes_id'] . \"'\") or die(mysql_error());\n $attribute_value_download_filename= $dl_res->fields['products_attributes_filename'];\n $attribute_value_download_count = $dl_res->fields['products_attributes_maxcount'];\n $attribute_value_download_expire = $dl_res->fields['products_attributes_maxdays'];\n\n $attribute_value_price = $line->fields['options_values_price'];\n $sortorder = $line->fields['sortorder'];\n $attribute_value_prefix = $line->fields['price_prefix'];\n $attribute_value_weight_prefix = $line->fields['weight_prefix'];\n $attribute_value_model = $line->fields['attributes_model'];\n $attribute_value_stock = $line->fields['attributes_stock'];\n $attribute_value_weight = $line->fields['options_values_weight'];\n\n if ($attribute_value_prefix == '+') {\n $posCheck = ' SELECTED';\n $negCheck = '';\n } else {\n $posCheck = '';\n $negCheck = ' SELECTED';\n }\n if ($attribute_value_weight_prefix == '+') {\n $posCheck_weight = ' SELECTED';\n $negCheck_weight = '';\n } else {\n $posCheck_weight = '';\n $negCheck_weight = ' SELECTED';\n }\n\t\t$line->MoveNext();\n }\n return true;\n } else {\n $attribute_value_price = '';\n $sortorder = '';\n $attribute_value_weight = ''; \n $attribute_value_prefix = '';\n $attribute_value_weight_prefix = '';\n $attribute_value_model = '';\n $attribute_value_stock = '';\n $posCheck = '';\n $negCheck = '';\n $posCheck_weight = '';\n $negCheck_weight = '';\n return false;\n }\n }", "function gcd_tax_edit_meta_field($term) {\r\n $t_id = $term->term_id;\r\n \r\n // retrieve the existing value(s) for this meta field. This returns an array\r\n $term_meta = get_option( \"taxonomy_$t_id\" ); ?>\r\n <tr class=\"form-field\">\r\n <th scope=\"row\" valign=\"top\"><label for=\"term_meta[featured]\"><?php _e( 'Featured ?', '' ); ?></label></th>\r\n <td>\r\n <input type=\"text\" name=\"term_meta[featured]\" id=\"term_meta[featured]\" value=\"<?php echo esc_attr( $term_meta['featured'] ) ? esc_attr( $term_meta['featured'] ) : ''; ?>\">\r\n <p class=\"description\"><?php _e( 'Type 1 if you want to list category as featured','' ); ?></p>\r\n </td>\r\n </tr>\r\n <tr class=\"form-field\">\r\n <th scope=\"row\" valign=\"top\"><label for=\"term_meta[subtitle]\"><?php _e( 'Subtitle', '' ); ?></label></th>\r\n <td>\r\n <input type=\"text\" name=\"term_meta[subtitle]\" id=\"term_meta[subtitle]\" value=\"<?php echo esc_attr( $term_meta['subtitle'] ) ? esc_attr( $term_meta['subtitle'] ) : ''; ?>\">\r\n <p class=\"description\"><?php _e( 'Subtitle for your project','' ); ?></p>\r\n </td>\r\n </tr>\r\n<?php\r\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 elex_bep_create_product_variation( $product_id, $variation_data ) {\n //Get varaible product object parent\n $product = wc_get_product( $product_id );\n //\n $variation_post = array(\n 'post_title' => $product->get_name(),\n 'post_name' => 'product-'.$product_id.'-varation',\n 'post_status' => 'publish',\n 'post_parent' => $product_id,\n 'post_type' => 'product_variation',\n 'guid' => $product->get_permalink()\n );\n\n $variation_id = wp_insert_post( $variation_post );\n $variation = new WC_Product_Variation( $variation_id );\n error_log( $variation_id );\n\n foreach ($variation_data['attributes'] as $attribute => $term_names )\n {\n $taxonomy = 'pa_'.$attribute; // The attribute taxonomy\n\n // If taxonomy doesn't exists we create it (Thanks to Carl F. Corneil)\n if( ! taxonomy_exists( $taxonomy ) ){ \n register_taxonomy(\n $taxonomy, 'product_variation',\n array(\n 'hierarchical' => false,\n 'label' => ucfirst( $attribute ),\n 'query_var' => true,\n 'rewrite' => array( 'slug' => sanitize_title($attribute) ), // The base slug\n )\n );\n }\n foreach( $term_names as $key=> $term_name ){\n error_log( $key. ' '. $term_name );\n // Check if the Term name exist and if not we create it.\n if( ! term_exists( $term_name, $taxonomy ) ){\n wp_insert_term( $term_name, $taxonomy ); // Create the term\n }\n $term_slug = get_term_by('name', $term_name, $taxonomy )->slug; // Get the term slug\n error_log( print_r($term_slug, TRUE ));\n\n // // Get the post Terms names from the parent variable product.\n $post_term_names = wp_get_post_terms( $product_id, $taxonomy, array('fields' => 'names') );\n\n // // Check if the post term exist and if not we set it in the parent variable product.\n if( ! in_array( $term_name, $post_term_names ) )\n wp_set_post_terms( $product_id, $term_name, $taxonomy, true );\n\n // // Set/save the attribute data in the product variation\n update_post_meta( $variation_id, 'attribute_'.$taxonomy, $term_slug );\n }\n }\n if( ! empty( $variation_data['sku'] ) )\n $variation->set_sku( $variation_data['sku'] );\n\n // Prices\n if( empty( $variation_data['sale_price'] ) ){\n $variation->set_price( $variation_data['regular_price'] );\n } else {\n $variation->set_price( $variation_data['sale_price'] );\n $variation->set_sale_price( $variation_data['sale_price'] );\n }\n $variation->set_regular_price( $variation_data['regular_price'] );\n\n // Stock\n if( ! empty($variation_data['stock_qty']) ){\n $variation->set_stock_quantity( $variation_data['stock_qty'] );\n $variation->set_manage_stock(true);\n $variation->set_stock_status('');\n } else {\n $variation->set_manage_stock(false);\n }\n $variation->set_weight(''); // weight (reseting)\n error_log( print_r( $variation, TRUE ));\n $variation->save(); \n}", "private function has_attribute($attribute){\r\n //(incl.private ones!) as the keys and their current values as the value\r\n $object_vars = $this->attributes();\r\n //we dont care about the value, we just want to know if the key exists\r\n //will return true or false\r\n return array_key_exists($attribute, $object_vars);\r\n }", "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}", "function taxonomy_is_movie_attribute( $name ) {\n global $masvideos_attributes;\n\n return taxonomy_exists( $name ) && array_key_exists( $name, (array) $masvideos_attributes['movie'] );\n }", "function filter_woocommerce_rest_prepare_product_object( $response, $object, $request ) {\n if( empty( $response->data ) ) {\n return $response;\n }\n\n $attribute_taxonomies = wc_get_attribute_taxonomies();\n\n // Loop through the attributes on current product\n $attributes = $response->data['attributes'];\n foreach($attributes as $attrkey => $attribute) {\n\n /* ########################################################\n - Adding new swatch key to attribute response for color attributes,\n which holds the hex code for each swatch color option\n ######################################################## */\n // Get an array of attributes whose attribute type is color\n $color_type_attribute_taxonomies = array_filter($attribute_taxonomies, function($attribute_taxonomy) {\n return $attribute_taxonomy->attribute_type == 'color';\n });\n // Loop through the color type attributes\n foreach($color_type_attribute_taxonomies as $tax_object) {\n //Check if current attribute is a color type attribute\n if ($attribute['id'] == $tax_object->attribute_id) {\n // Get current attribute's options\n $options = $response->data['attributes'][$attrkey]['options'];\n // Get current attribute's terms\n $color_terms = get_terms('pa_' . $tax_object->attribute_name);\n foreach( $options as $option ) {\n foreach($color_terms as $term) {\n if ($term->name == $option) {\n // Add a new swatch with hex value for each color option\n $response->data['attributes'][$attrkey]['swatches'][$option] = get_term_meta( $term->term_id, 'product_attribute_color', true);\n }\n }\n }\n }\n }\n\n /* ########################################################\n - Adding attribute taxonomy to the attribute response\n - Adding attribute identifier to the attribute response\n - Adding more detailed option data to the attribute options response\n ######################################################## */\n foreach($attribute_taxonomies as $attribute_taxonomy) {\n if ($attribute['id'] == $attribute_taxonomy->attribute_id) {\n\n /* Add slug to current attribute response */\n $response->data['attributes'][$attrkey]['taxonomy'] = ('pa_' . $attribute_taxonomy->attribute_name);\n\n /* Add attribute identifier to current attribute response */\n $response->data['attributes'][$attrkey]['slug'] = $attribute_taxonomy->attribute_name;\n\n /* Replace default options data with detailed options data for current attribute */\n $options = $response->data['attributes'][$attrkey]['options'];\n $new_options = array();\n $attribute_terms = get_terms('pa_' . $attribute_taxonomy->attribute_name);\n\n foreach( $options as $option ) {\n foreach($attribute_terms as $attribute_term) {\n if ($attribute_term->name == $option) {\n $new_options[] = (object) [\n 'id' => $attribute_term->term_id,\n 'name' => $attribute_term->name,\n 'slug' => $attribute_term->slug,\n 'taxonomy' => $attribute_term->taxonomy,\n 'description' => $attribute_term->description,\n 'count' => $attribute_term->count\n ];\n }\n }\n }\n $response->data['attributes'][$attrkey]['options'] = $new_options;\n }\n }\n }\n\n /* ########################################################\n - Replacing Variation IDs with Variation details\n ######################################################## */\n\n // Get the current product object\n $variation_ids = $response->data['variations'];\n\n $detailed_variations = array_map(function($variation_id) {\n $variation = wc_get_product($variation_id);\n return (object) [\n 'variation_id' => $variation->get_id(),\n 'image_url' => wp_get_attachment_url($variation->get_image_id()),\n 'variation_regular_price' => $variation->get_regular_price(),\n 'variation_sale_price' => $variation->get_sale_price(),\n 'attributes' => $variation->get_attributes(),\n 'is_on_sale' => $variation->is_on_sale()\n ];\n }, $variation_ids);\n\n $response->data['variations'] = $detailed_variations;\n\n\n /* ########################################################\n - Get ALL Variation attributes for a product\n ######################################################## */\n if ($response->data['type'] == 'variable') {\n $variation_attributes = wc_get_product($response->data['id'])->get_variation_attributes();\n $variation_attributes = array_map(function($attribute) {\n return (array_values($attribute));\n }, $variation_attributes);\n $response->data['variation_attributes'] = $variation_attributes;\n }\n\n\n\n /* Return new response */\n return $response;\n}", "public function termsAndConditionAccpeted()\n\t{\n\n\t}", "private function has_attribute($attribute){\n\t\t//(inlcuding private ones) as keys and current values as value.\n\t\t\n\t\t$object_vars = $this->attributes();\n\t\t//want to check key exists, dont care about value here\n\t\t//returns true or false\t\n\t\t\n\t\treturn array_key_exists($attribute, $object_vars);\n\t}", "public static function get_product_attributes($arg = array())\n {\n $default = array(\n 'children' => false,\n 'slug' => false,\n 'id' => false,\n 'terms_query' => array(\n 'hide_empty' => false\n )\n );\n $args = wp_parse_args($arg, $default);\n\n $product_attributes = array();\n $attribute_taxonomies = wc_get_attribute_taxonomies();\n\n foreach ($attribute_taxonomies as $attribute) {\n $array = array(\n 'id' => intval($attribute->attribute_id),\n 'name' => $attribute->attribute_label,\n 'slug' => wc_attribute_taxonomy_name($attribute->attribute_name),\n 'type' => $attribute->attribute_type,\n 'order_by' => $attribute->attribute_orderby,\n 'has_archives' => (bool)$attribute->attribute_public,\n );\n\n if ($args['children']) {\n // Get Terms\n $terms_default_query = array(\n 'taxonomy' => wc_attribute_taxonomy_name($attribute->attribute_name)\n );\n $terms = get_terms(wp_parse_args($args['terms_query'], $terms_default_query));\n $array['children'] = WooCommerce_Helper::object_to_array($terms);\n }\n\n // Push To List\n $product_attributes[wc_sanitize_taxonomy_name($attribute->attribute_name)] = $array;\n }\n\n // Get By Slug\n if ($args['slug'] != false) {\n if (isset($product_attributes[$args['slug']])) {\n return $product_attributes[$args['slug']];\n } else {\n return array();\n }\n }\n\n // Get By ID\n if ($args['id'] != false) {\n foreach ($product_attributes as $attribute) {\n if ($attribute['id'] == $args['id']) {\n return $attribute;\n }\n }\n\n return array();\n }\n\n return $product_attributes;\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}", "public function testInsertProductAttributeSkipsAttributesNotInScope()\n\t{\n\t\t$repository = new ProductRepository();\n\t\t$product = $repository->getProduct(1);\n\n\t\t$product->attributes[self::ATTRIBUTE_AUTHOR] = \"J. K. Rowling\";\n\t\t$product->attributes[self::ATTRIBUTE_PUBLISH_YEAR] = 2003;\n\t\t$product->attributes[self::ATTRIBUTE_COLOR] = \"Blue\";\n\n\t\t$repository->updateProduct($product);\n\n\t\t$new_product = $repository->getProduct(1);\n\n\t\t$this->assertEquals(2, count($new_product->attributes));\n\n\t\t$this->assertFalse(array_key_exists(self::ATTRIBUTE_COLOR, $new_product->attributes));\n\t\t$this->assertEquals(\"J. K. Rowling\", $new_product->attributes[self::ATTRIBUTE_AUTHOR]);\n\t\t$this->assertEquals(2003, $new_product->attributes[self::ATTRIBUTE_PUBLISH_YEAR]);\n\t}", "function am2_vanity_add_taxonomy_fields( $term ) { //check for existing featured ID\n $t_id = $term->term_id;\n $vanity_urls = get_option('am2_vanity_urls');\n\t$value = '';\n\tif(!empty($vanity_urls[$_REQUEST['taxonomy'].\"_\".$term->term_id]['url'])){\n\t\t$value = $vanity_urls[$_REQUEST['taxonomy'].\"_\".$term->term_id]['url'];\n\t}\n?>\n<tr class=\"form-field\">\n\t<th scope=\"row\" valign=\"top\"><label for=\"_am2_vanity_url\"><?php _e('Vanity URL'); ?></label></th>\n\t<td>\n \t<?php echo site_url().'/'; ?>\n\t\t<input type=\"hidden\" name=\"_am2_vanity_term_name\" value=\"<?php echo $_REQUEST['taxonomy']; ?>\" />\n <input type=\"text\" name=\"_am2_vanity_url\" id=\"_am2_vanity_url\" placeholder=\"any-url\" size=\"3\" style=\"width:60%;\" value=\"<?php echo $value; ?>\"><br />\n <span class=\"description\"><?php _e('This URL will replace the dafault category URL with new one.'); ?></span>\n </td>\n</tr>\n<?php\n}", "function glbs_edit_extra_tax_fields( $term ) { //check for existing featured ID\n\t$id = $term->term_id;\n\t\n\t$title = get_term_meta( $id, 'basic_seo_title', true );\n\t$key = get_term_meta( $id, 'basic_seo_keywords', true );\n\t$desc = get_term_meta( $id, 'basic_seo_description', true );\n\t?>\n\t<?php wp_nonce_field( '_glbs_nonce_tax', 'glbs_nonce_tax' ); ?>\n\t<table class=\"form-table\">\n\t\t<tr class=\"form-field\">\n\t\t\t<th scope=\"row\"><label for=\"basic_seo_title\"><?php _e( 'SEO Title', 'glbs' ); ?></label></th>\n\t\t\t<td>\n\t\t\t\t<input class=\"large-text\" type=\"text\" name=\"basic_seo_title\" id=\"basic_seo_title\" value=\"<?php echo $title ? $title : ''; ?>\"><br/>\n\t\t\t\t<span class=\"description\">Leave empty to use default title</span>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"form-field\">\n\t\t\t<th scope=\"row\"><label for=\"basic_seo_keywords\"><?php _e( 'SEO Keywords', 'glbs' ); ?></label></th>\n\t\t\t<td>\n\t\t\t\t<input class=\"large-text\" type=\"text\" name=\"basic_seo_keywords\" id=\"basic_seo_keywords\" value=\"<?php echo $key ? $key : ''; ?>\"><br/>\n\t\t\t\t<span class=\"description\">Enter the list of keywords separated by comma</span>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"form-field\">\n\t\t\t<th scope=\"row\"><label for=\"basic_seo_description\"><?php _e( 'SEO Description', 'glbs' ); ?></label></th>\n\t\t\t<td>\n\t\t\t\t<textarea class=\"large-text\" name=\"basic_seo_description\" id=\"basic_seo_description\" rows=\"5\"><?php echo $desc ? $desc : ''; ?></textarea><br/>\n\t\t\t\t<span class=\"description\">Enter meta description for this Term</span>\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n\t<?php\n}", "private function has_attribute($attribute)\n {\n //including priate ones as the keys and their current values are the value\n $object_vars = $this->attributes();\n\n //here i do not care what the specific values are but just interested if they exist\n return array_key_exists($attribute, $object_vars);\n }", "public function testSearchForProductByAttributeType()\n {\n // full results flag returns the full data set for the product\n }", "function is_product_tag( $term = '' ) {\n\t\treturn is_tax( 'product_tag', $term );\n\t}", "function wc_show_attribute_links() {\n\tglobal $post;\n\t$attribute_names = array( 'pa_serie');\n\t\t\n\tforeach ( $attribute_names as $attribute_name ) {\n\t\t$taxonomy = get_taxonomy( $attribute_name );\n\t\t\n\t\tif ( $taxonomy && ! is_wp_error( $taxonomy ) ) {\n\t\t\t$terms = wp_get_post_terms( $post->ID, $attribute_name );\n\t\t\t$terms_array = array();\n\t\t\n\t if ( ! empty( $terms ) ) {\n\t\t foreach ( $terms as $term ) {\n\t\t\t $archive_link = get_term_link( $term->slug, $attribute_name );\n\t\t\t $full_line = '<a href=\"' . $archive_link . '\">'. $term->name . '</a>';\n\t\t\t array_push( $terms_array, $full_line );\n\t\t }\n\t\t echo $taxonomy->labels->name . ' ' . implode( $terms_array, ', ' );\n\t }\n \t}\n }\n}", "public function testAdministerProductAttributes() {\n $this->drupalGet('admin/commerce/product-attributes/add');\n $this->assertSession()->statusCodeEquals(200);\n\n $this->submitForm([\n 'id' => 'colors_id',\n 'label' => 'Color Names',\n 'elementLabel' => 'Choose Color',\n ], 'Save');\n\n $this->assertSession()->pageTextContains('Created the Color Names product attribute.');\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/product-attributes\\/manage\\/colors_id$/');\n $attribute = ProductAttribute::load('colors_id');\n // Check if elementLabel is saved and then diplayed as the default value.\n $this->assertEquals('Choose Color', $attribute->getElementLabel());\n $elementLabel = $this->getSession()->getPage()->findField('elementLabel')->getValue();\n $this->assertEquals('Choose Color', $elementLabel);\n\n $colors = [\n [\n 'attribute' => 'colors_id',\n 'name' => 'Red',\n 'weight' => 1,\n ],\n [\n 'attribute' => 'colors_id',\n 'name' => 'ForestGreen',\n 'weight' => 2,\n ],\n [\n 'attribute' => 'colors_id',\n 'name' => 'Blue',\n 'weight' => 3,\n ],\n ];\n\n foreach ($colors as $values) {\n $this->createEntity('commerce_product_attribute_value', $values);\n }\n\n $this->drupalGet('admin/commerce/product-attributes/add');\n $this->assertSession()->statusCodeEquals(200);\n\n $this->submitForm([\n 'id' => 'sizes_id',\n 'label' => 'Size Names',\n 'elementLabel' => 'Choose Size',\n ], 'Save');\n\n $this->assertSession()->pageTextContains('Created the Size Names product attribute.');\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/product-attributes\\/manage\\/sizes_id$/');\n $attribute = ProductAttribute::load('sizes_id');\n $this->assertEquals('Choose Size', $attribute->getElementLabel());\n $elementLabel = $this->getSession()->getPage()->findField('elementLabel')->getValue();\n $this->assertEquals('Choose Size', $elementLabel);\n\n foreach (range(1, 102) as $i) {\n $values = [\n 'attribute' => 'sizes_id',\n 'name' => $i,\n 'weight' => $i,\n ];\n $this->createEntity('commerce_product_attribute_value', $values);\n }\n\n $this->drupalGet('admin/commerce/product-attributes');\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->pageTextContains('colors_id');\n $this->assertSession()->pageTextContains('Color Names');\n $this->assertSession()->pageTextContains('Choose Color');\n $this->assertSession()->pageTextContains('sizes_id');\n $this->assertSession()->pageTextContains('Size Names');\n $this->assertSession()->pageTextContains('Choose Size');\n // Attribute names are truncated if they exceed 10 characters.\n $this->assertSession()->pageTextContains('Red, ForestGre…, Blue');\n // Only one hundred attribute names can be displayed. A counter (N more\n // values…) displayed for all the rest of the names.\n $this->assertSession()->pageTextContains('1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 (2 more values…)');\n\n $this->drupalGet('admin/commerce/config/product-variation-types/default/edit');\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->pageTextContains('Color Names');\n $this->assertSession()->linkNotExistsExact('Color Names');\n $this->assertSession()->pageTextContains('Size Names');\n $this->assertSession()->linkNotExistsExact('Size Names');\n $this->assertSession()->linkExistsExact('colors_id');\n $this->assertSession()->linkExistsExact('sizes_id');\n\n $this->getSession()->getPage()->clickLink('colors_id');\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/product-attributes\\/manage\\/colors_id$/');\n\n $this->drupalGet('admin/commerce/config/product-variation-types/default/edit');\n $this->assertSession()->statusCodeEquals(200);\n $this->submitForm([\n 'attributes[colors_id]' => 'colors_id',\n 'attributes[sizes_id]' => 'sizes_id',\n ], t('Save'));\n\n $this->drupalGet('admin/commerce/config/product-variation-types/default/edit');\n $this->assertSession()->statusCodeEquals(200);\n // Now 'Color Names' and 'Size Names' should turn into links with\n // 'Choose Color' and 'Choose Size' elementLabel text.\n $this->assertSession()->linkExistsExact('Choose Color');\n $this->assertSession()->linkExistsExact('Choose Size');\n $this->assertSession()->linkExistsExact('colors_id');\n $this->assertSession()->linkExistsExact('sizes_id');\n\n $this->getSession()->getPage()->clickLink('Choose Color');\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/config\\/product-variation-types\\/default\\/edit\\/fields\\/commerce_product_variation\\.default\\.attribute_colors_id$/');\n $this->submitForm([\n 'label' => 'My Color',\n ], t('Save settings'));\n\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/config\\/product-variation-types\\/default\\/edit\\/fields$/');\n $this->assertSession()->pageTextContains('My Color', 'The customer facing label is changed on the default variation type attribute field');\n\n $this->drupalGet('admin/commerce/config/product-variation-types/default/edit');\n $this->assertSession()->statusCodeEquals(200);\n // After the 'Choose Color' is changed the link text should also be changed\n // to 'My Color' elementLabel text.\n $this->assertSession()->linkExistsExact('My Color');\n $this->assertSession()->linkExistsExact('Choose Size');\n $this->assertSession()->linkExistsExact('colors_id');\n $this->assertSession()->linkExistsExact('sizes_id');\n }", "private function has_attribute($attribute){\r\n\t // (incl. private ones!) as the keys and their current values as the value\r\n\t $object_vars = get_object_vars($this);\r\n\t // We don't care about the value, we just want to know if the key exists\r\n\t // Will return true or false\r\n\t return array_key_exists($attribute, $object_vars);\r\n }", "public function has_the_attribute($the_attribute){\n\t\t$object_properties = get_object_vars($this); \n\t\treturn array_key_exists($the_attribute,$object_properties);\n\t }", "function is_exists_item_attribute_type($s_item_type, $s_attribute_type, $order_no = NULL) {\n\t$query = \"SELECT 'x' FROM s_item_attribute_type \";\n\n\tif (strlen($s_attribute_type) > 0) {\n\t\t$where .= \" s_attribute_type = '\" . $s_attribute_type . \"'\";\n\t\tif (is_numeric($order_no))\n\t\t\t$where .= \" AND order_no = '$order_no'\";\n\t}\n\n\t// Support check for any instances of the s_attribute_type in the s_item_attribute_type table,\n\t// or a specific s_item_type instance if $s_item_type specified.\t\n\tif (strlen($s_item_type) > 0) {\n\t\tif (strlen($s_attribute_type) > 0)\n\t\t\t$where .= \" AND \";\n\t\t$where .= \"s_item_type = '$s_item_type'\";\n\t}\n\n\tif (strlen($where) > 0)\n\t\t$query .= \" WHERE $where \";\n\n\t$result = db_query($query);\n\tif ($result && db_num_rows($result) > 0) {\n\t\tdb_free_result($result);\n\t\treturn TRUE;\n\t}\n\n\t//else\n\treturn FALSE;\n}", "public static function get_attribution_product_fields($product)\n {\n $list = array();\n if ($product['type'] == \"variable\" and count($product['variations']) > 0) {\n foreach ($product['attributes'] as $attribute) {\n\n // If Attribute Not User For Variation\n if ($attribute['variation'] === false) {\n continue;\n }\n\n // Get Basic Detail\n $list[wc_attribute_taxonomy_name($attribute['slug'])] = array(\n 'name' => $attribute['name'],\n 'options' => array()\n );\n $options = array();\n foreach ($attribute['terms'] as $term_key => $term) {\n\n // Check Term in Variables Product\n $exist = false;\n foreach ($product['variations'] as $variations_product) {\n $in_stock = $variations_product['in_stock'];\n $stock_quantity = $variations_product['stock_quantity'];\n if ($in_stock === true) {\n foreach ($variations_product['attributes'] as $variations_product_attribute) {\n if ($term['slug'] == $variations_product_attribute['option']) {\n $exist = true;\n break;\n }\n }\n }\n }\n if ($exist === true) {\n $options[$term['slug']] = $term['name'];\n }\n }\n $list[wc_attribute_taxonomy_name($attribute['slug'])]['options'] = $options;\n }\n }\n\n /**\n * [pa_color] => Array\n * (\n * [name] => رنگ\n * [options] => Array\n * (\n * [blue] => آبی\n * [red] => قرمز\n * )\n * )\n * [pa_size] => Array\n * (\n * [name] => سایز\n * [options] => Array\n * (\n * [l] => L\n */\n return $list;\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 function addTermAttributes(\\obiba\\mica\\TermAttributesDto $value) {\n return $this->_add(19, $value);\n }", "private function has_attribute($attribute) {\n // Will return true or false\n return array_key_exists($attribute, $this->attributes());\n }", "private function has_attribute($attribute)\n\t\t{\n\t\t//(incl. private ones!) as the keys and their current values as the value\n\t\t$object_vars = get_object_vars($this);\n\t\t//we don't care about the value, we just want to know if the key exists \n\t\t//will return true or false\n\t\treturn array_key_exists($attribute, $object_vars);\n\t\t}", "private function has_attribute($attribute) {\r\n // (incl. private ones!) as the keys and their current values as the value\r\n $object_vars = get_object_vars($this);\r\n // We don't care about the value, we just want to know if the key exists\r\n // Will return true or false\r\n return array_key_exists($attribute, $object_vars);\r\n }", "protected function verifyAttributes()\n {\n $formOptions = $this->sortOptions($this->productView->getOptions($this->product)['configurable_options']);\n $fixtureOptions = $this->prepareFixtureOptions();\n $errors = $this->verifyData($fixtureOptions, $formOptions, true, false);\n return empty($errors) ? null : $this->prepareErrors($errors, 'Error configurable options:');\n }", "private function has_attribute($attribute) {\n\t // Will return true or false\n\t return array_key_exists($attribute, $this->attributes());\n\t}", "private function has_attribute($attribute) {\n\t // (incl. private ones!) as the keys and their current values as the value\n\t $object_vars = get_object_vars($this);\n\t // We don't care about the value, we just want to know if the key exists\n\t // Will return true or false\n\t return array_key_exists($attribute, $object_vars);\n\t}", "private function has_attribute($attribute) {\n\t // (incl. private ones!) as the keys and their current values as the value\n\t $object_vars = get_object_vars($this);\n\t // We don't care about the value, we just want to know if the key exists\n\t // Will return true or false\n\t return array_key_exists($attribute, $object_vars);\n\t}", "public function hasTerms() {\n return $this->_has(2);\n }", "function extra_tax_fields($tag)\n\n{\n\n //check for existing taxonomy meta for term ID\n\n $t_id = $tag->term_id;\n\n $term_meta = get_option(\"taxonomy_$t_id\");\n\n ?>\n\n\n\n <tr class=\"form-field\">\n\n <th scope=\"row\" valign=\"top\"><label for=\"avisors\"><?php _e('Avisors', 'leadvisors'); ?></label></th>\n\n <td>\n\n <select name=\"term_meta[avisors]\" id=\"term_meta[avisors]\">\n\n <option\n\n value=\"0\" <?php echo $term_meta['avisors'] == 0 ? 'selected' : ''; ?>><?php _e('No', 'leadvisors'); ?></option>\n\n <option\n\n value=\"1\" <?php echo $term_meta['avisors'] == 1 ? 'selected' : ''; ?>><?php _e('Yes', 'leadvisors'); ?></option>\n\n </select>\n\n </td>\n\n </tr>\n\n <?php }", "public function productAttribute($product, $attributeHtml, $attributeName)\n {\n $productId = $product->getId();\n\n if (!mage::registry('product')) {\n Mage::register('product', $product);\n Mage::register('current_product', $product);\n\n }\n\n if ($attributeName == 'image') {\n return parent::productAttribute($product, $attributeHtml, $attributeName);\n }\n\n $productDescriptionPriority = Mage::getStoreConfig('icecat_root/icecat/descript_priority');\n $productShortDescrPriority = Mage::getStoreConfig('icecat_root/icecat/shortdescr_priority');\n $productNamePriority = Mage::getStoreConfig('icecat_root/icecat/name_priority');\n\n\n $dbDescriptionPriority = false;\n $dbShortDescriptionPriority = false;\n $current_page = Mage::app()->getFrontController()->getRequest()->getControllerName();\n if ($productDescriptionPriority == 'Db' && $attributeName == 'description') {\n $dbDescriptionPriority = true;\n }\n if ($productShortDescrPriority == 'Db' && $attributeName == 'short_description') {\n $dbShortDescriptionPriority = true;\n }\n\n if ($current_page == 'product') {\n\n $bin_prod = new Iceshop_Icecatlive_Model_Catalog_Product();\n if ($attributeName == 'description' || $attributeName == 'short_description') {\n $descr = $bin_prod->checkIcecatProdDescription($productId, $attributeName);\n }\n }\n $prod_source = Iceshop_Icecatlive_Model_Catalog_Product::$_product_source;\n\n if ($prod_source == 'DB' && empty($descr)) {\n $dbDescriptionPriority = true;\n $dbShortDescriptionPriority = true;\n }\n\n if ($dbShortDescriptionPriority || ($current_page != 'product'\n && $prod_source != 'DB') && $attributeName != 'name'\n ) {\n if ($attributeName == 'short_description') {\n $attributeHtml = $product->getData('short_description');\n }\n\n if ($attributeName == 'description' && $attributeHtml == 1) {\n $attributeHtml = $product->getData('description');\n }\n return parent::productAttribute($product, $attributeHtml, $attributeName);\n }\n\n $this->iceCatModel = Mage::getSingleton('icecatlive/import');\n\n if ($this->isFirstTime) {\n $helper = Mage::helper('icecatlive/getdata');\n $helper->getProductDescription($product);\n\n if ($helper->hasError() && $attributeName != 'name') {\n $this->error = true;\n }\n $this->isFirstTime = false;\n }\n\n if ($this->error) {\n\n if ($attributeName != 'description' && $attributeName != 'short_description') {\n return parent::productAttribute($product, $attributeHtml, $attributeName);\n } else {\n return '';\n }\n\n }\n\n $id = $product->getData('entity_id');\n\n if ($attributeName == 'name' && $productNamePriority != 'Db') {\n //if we on product page then mage::registry('product') exist\n if ($product->getId() == $this->iceCatModel->entityId && $name = $this->iceCatModel->getProductName()) {\n return $name;\n } else if (!empty($descr)) {\n return $descr;\n }\n $manufacturerId = Mage::getStoreConfig('icecat_root/icecat/manufacturer');\n $mpn = Mage::getStoreConfig('icecat_root/icecat/sku_field');\n $ean = Mage::getStoreConfig('icecat_root/icecat/ean_code');\n $collection = Mage::getResourceModel('catalog/product_collection');\n $collection->addAttributeToSelect($manufacturerId)->addAttributeToSelect($mpn)->addAttributeToSelect($ean)\n ->addAttributeToSelect('name')\n ->addAttributeToFilter('entity_id', array('eq' => $id));\n $product = $collection->getFirstItem();\n return $product->getName();\n }\n\n if ($attributeName == 'short_description' && !$dbShortDescriptionPriority) {\n\n $icecat_descr = $this->iceCatModel->getShortProductDescription();\n if (!empty($descr)) {\n return $descr;\n } else if (!empty($icecat_descr)) {\n return $icecat_descr;\n } else {\n $attributeHtml = $product->getData('short_description');\n return parent::productAttribute($product, $attributeHtml, $attributeName);\n }\n }\n\n if ($attributeName == 'description' && !$dbDescriptionPriority) {\n\n $icecat_full_descr = $this->iceCatModel->getFullProductDescription();\n\n if (!empty($icecat_full_descr)) {\n return str_replace(\"\\\\n\", \"<br>\", $icecat_full_descr);\n } else {\n $attributeHtml = $product->getData('description');\n }\n }\n return parent::productAttribute($product, $attributeHtml, $attributeName);\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}", "public function hasAttributes() {\n return $this->_has(9);\n }", "public function requireAcceptingTermsIfApplicable($attribute)\n {\n if ($this->api->hasTerms() && ($this->accepted_terms_on === null)) {\n $this->addError(\n $attribute,\n 'You must accept the terms in order to request a key to this API.'\n );\n }\n }", "public function testInsertProductAttribute()\n\t{\n\t\t$repository = new ProductRepository();\n\t\t$product = $repository->getProduct(1);\n\n\t\t// Update a global attribute, just to check that update works\n\t\t// Global = applies to all categories\n\t\t$product->attributes[self::ATTRIBUTE_URL] = \"some-slug\";\n\t\t$repository->updateProduct($product);\n\n\t\t$new_product = $repository->getProduct(1);\n\n\t\t$this->assertEquals(1, count($new_product->attributes));\n\t\t$this->assertEquals(\"some-slug\", $new_product->attributes[self::ATTRIBUTE_URL]);\n\t}", "private function has_attribute($attribute){\n // (including private ones) as the keys and their current values as the value\n $object_vars = get_object_vars($this);\n\n // We don't care about the value, we just want to know if the key exists\n // does $attribute(key) exist in $object_vars\n // Will return true or false\n return array_key_exists($attribute, $object_vars);\n }", "public function passes($attribute, $value)\n { \n \n if(Auth::user()->user_type != 'admin'){\n $sku = Product::where('product_sku',$value)->where('seller_id',Auth::user()->id)->first();\n if(!empty($sku)){\n return true;\n }else{\n return false;\n }\n }else{\n return true;\n }\n \n }", "public function hasVocabularyTerms() {\n return $this->_has(2);\n }", "private function update_edgenet_taxonomy_attributes( $taxonomynode_path, $product, $post_id ) {\n\t\tforeach ( $taxonomynode_path as $taxonomynode ) {\n\t\t\tif ( isset( $taxonomynode->attributes ) && ! empty( $taxonomynode->attributes ) ) {\n\n\t\t\t\t$attribute_ids = array_map( function ( $attribute ) {\n\t\t\t\t\treturn $attribute['BaseAttribute'];\n\t\t\t\t}, $taxonomynode->attributes );\n\n\t\t\t\t$attributes = edgenet()->api_adapter->attribute( $attribute_ids );\n\n\t\t\t\t$meta = $product->get_attributes_values( $attributes );\n\n\t\t\t\tupdate_post_meta( $post_id, '_category_attributes', (array) $meta );\n\t\t\t}\n\t\t}\n\t}", "public function hasAttributes() {\n return $this->_has(2);\n }", "public function getTermAttributesList() {\n return $this->_get(19);\n }", "public function issetSearchAttributes($index)\n {\n return isset($this->searchAttributes[$index]);\n }", "private function has_attribute($attribute) {\n\t\t// Wil return true or false\n\t\t$object_vars = get_object_vars($this);\n\n\t\treturn array_key_exists($attribute, $object_vars);\n\t}", "function get_eco_attributes($product_id)\n\t{\n\t\t\t$product = $this->product_model->reset()->load($product_id);\n\t\t\t$attribute_name = 'ecoattribute';\n\t\n\t\t\t$eco_attributes = $product->getAttributeText($attribute_name);\n\t\t\tif(count($eco_attributes) == 1) $eco_attributes = array($eco_attributes); //put in array if there's ONE eco attribute filled\n\t\t\treturn $eco_attributes;\n\t}", "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 isAttributeCodeAlreadyExist($wholedata)\r\n {\r\n $attributes = $this->_objectManager->get('Magento\\Catalog\\Model\\Product')->getAttributes();\r\n $allattrcodes = [];\r\n foreach ($attributes as $a) {\r\n $allattrcodes[] = $a->getEntityType()->getAttributeCodes();\r\n }\r\n\r\n $this->_logger->info('####### Seller Attribute Log : allattrcodes: '.json_encode($allattrcodes));\r\n\r\n if (!empty($allattrcodes)) {\r\n if (!empty($allattrcodes) && in_array($wholedata['attribute_code'], $allattrcodes)) {\r\n $this->messageManager->addError( __('Attribute Code already exists'));\r\n return $this->resultRedirectFactory->create()->setPath('*/*/new',\r\n ['_secure' => $this->getRequest()->isSecure()]\r\n );\r\n }\r\n }\r\n }", "function sanitize_term_field($field, $value, $term_id, $taxonomy, $context)\n {\n }", "function basel_compare_available_fields( $new = false ) {\n\t\t$product_attributes = array();\n\n\t\tif ( function_exists( 'wc_get_attribute_taxonomies' ) ) {\n\t\t\t$product_attributes = wc_get_attribute_taxonomies();\n\t\t}\n\n\t\tif ( $new ) {\n\t\t\t$options = array(\n\t\t\t\t'description' => array(\n\t\t\t\t\t'name' => esc_html__( 'Description', 'basel' ),\n\t\t\t\t\t'value' => 'description',\n\t\t\t\t),\n\t\t\t\t'dimensions' => array(\n\t\t\t\t\t'name' => esc_html__( 'Dimensions', 'basel' ),\n\t\t\t\t\t'value' => 'dimensions',\n\t\t\t\t),\n\t\t\t\t'weight' => array(\n\t\t\t\t\t'name' => esc_html__( 'Weight', 'basel' ),\n\t\t\t\t\t'value' => 'weight',\n\t\t\t\t),\n\t\t\t\t'availability' => array(\n\t\t\t\t\t'name' => esc_html__( 'Availability', 'basel' ),\n\t\t\t\t\t'value' => 'availability',\n\t\t\t\t),\n\t\t\t\t'sku' => array(\n\t\t\t\t\t'name' => esc_html__( 'Sku', 'basel' ),\n\t\t\t\t\t'value' => 'sku',\n\t\t\t\t),\n\n\t\t\t);\n\n\t\t\tif ( count( $product_attributes ) > 0 ) {\n\t\t\t\tforeach ( $product_attributes as $attribute ) {\n\t\t\t\t\t$options[ 'pa_' . $attribute->attribute_name ] = array(\n\t\t\t\t\t\t'name' => wc_attribute_label( $attribute->attribute_label ),\n\t\t\t\t\t\t'value' => 'pa_' . $attribute->attribute_name,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $options;\n\t\t}\n\n\t\t$fields = array(\n\t\t\t'enabled' => array(\n\t\t\t\t'description' => esc_html__( 'Description', 'basel' ),\n\t\t\t\t'sku' => esc_html__( 'Sku', 'basel' ),\n\t\t\t\t'availability' => esc_html__( 'Availability', 'basel' ),\n\t\t\t),\n\t\t\t'disabled' => array(\n\t\t\t\t'weight' => esc_html__( 'Weight', 'basel' ),\n\t\t\t\t'dimensions' => esc_html__( 'Dimensions', 'basel' ),\n\t\t\t),\n\t\t);\n\n\t\tif ( count( $product_attributes ) > 0 ) {\n\t\t\tforeach ( $product_attributes as $attribute ) {\n\t\t\t\t$fields['disabled'][ 'pa_' . $attribute->attribute_name ] = $attribute->attribute_label;\n\t\t\t}\n\t\t}\n\n\t\treturn $fields;\n\t}", "public function sync_product_custom_fields_attributes( $product_id ) {\n\t\tglobal $sync_taxonomies;\n\n\t\t// Features.\n\t\t$features = get_post_meta( $product_id, '_features', true );\n\t\tif ( ! is_array( $features ) ) {\n\t\t\t$features = [];\n\t\t}\n\n\t\tdelete_field( 'ussc_features', $product_id );\n\n\t\t$features = array_map( function ( $feature ) {\n\t\t\treturn [\n\t\t\t\t'feature' => $feature['value'],\n\t\t\t];\n\t\t}, $features );\n\n\t\tedgenet()->debug->notice( __( sprintf( 'Updating %s features.', count( $features ) ), 'edgenet' ) );\n\t\tupdate_field( 'ussc_features', $features, $product_id );\n\n\t\t// Others.\n\t\t$others = get_post_meta( $product_id, '_other', true );\n\n\t\tif ( ! $others || ! is_array( $others ) ) {\n\t\t\t$others = [];\n\t\t}\n\n\t\tdelete_field( 'ussc_other', $product_id );\n\n\t\t$others = array_map( function ( $other ) {\n\t\t\treturn [\n\t\t\t\t'label' => $other['attribute']->description,\n\t\t\t\t'value' => $other['value'],\n\t\t\t];\n\t\t}, $others );\n\n\t\tedgenet()->debug->notice( __( sprintf( 'Updating %s others.', count( $others ) ), 'edgenet' ) );\n\t\tupdate_field( 'ussc_other', $others, $product_id );\n\n\t\t// Regulatory.\n\t\t$regulatory = get_post_meta( $product_id, '_regulatory', true );\n\t\tif ( ! $regulatory || ! is_array( $regulatory ) ) {\n\t\t\t$regulatory = [];\n\t\t}\n\n\t\tdelete_field( 'ussc_regulatory', $product_id );\n\n\t\t$regulatory = array_map( function ( $regulation ) {\n\t\t\treturn [\n\t\t\t\t'label' => $regulation['attribute']->description,\n\t\t\t\t'value' => $regulation['value'],\n\t\t\t];\n\t\t}, $regulatory );\n\n\t\tedgenet()->debug->notice( __( sprintf( 'Updating %s regulatory.', count( $regulatory ) ), 'edgenet' ) );\n\t\tupdate_field( 'ussc_regulatory', $regulatory, $product_id );\n\n\t\t// Dimensions.\n\t\t$dimensions = get_post_meta( $product_id, '_dimensions', true );\n\t\tif ( ! $dimensions || ! is_array( $dimensions ) ) {\n\t\t\t$dimensions = [];\n\t\t}\n\n\t\tdelete_field( 'ussc_dimensions', $product_id );\n\n\t\t$dimensions = array_map( function ( $dimension ) {\n\t\t\treturn [\n\t\t\t\t'label' => $dimension['attribute']->description,\n\t\t\t\t'value' => $dimension['value'],\n\t\t\t];\n\t\t}, $dimensions );\n\n\t\t// update field.\n\t\tedgenet()->debug->notice( __( sprintf( 'Updating %s dimensions.', count( $dimensions ) ), 'edgenet' ) );\n\t\tupdate_field( 'ussc_dimensions', $dimensions, $product_id );\n\n\t\t$specs = get_post_meta( $product_id, '_category_attributes', true );\n\t\tif ( ! is_array( $specs ) ) {\n\t\t\t$specs = [];\n\t\t}\n\n\t\t$att_meta = [];\n\t\tedgenet()->debug->notice( __( sprintf( 'Updating %s attributes.', count( $specs ) ), 'edgenet' ) );\n\t\tforeach ( $specs as $spec ) {\n\t\t\t$label = $spec['attribute']->description;\n\t\t\t$pa_args = [\n\t\t\t\t'name' => $label,\n\t\t\t\t'slug' => substr( sanitize_title_with_dashes( preg_replace( '/[^A-Za-z0-9\\-_ ]/', '', $label ) ), 0, 27 ),\n\t\t\t\t'type' => 'text',\n\t\t\t];\n\n\t\t\t$taxonomy = wc_attribute_taxonomy_name( $pa_args['slug'] );\n\n\t\t\tedgenet()->debug->notice( __( sprintf( 'Taxonomy: %s', $taxonomy ), 'edgenet' ) );\n\t\t\t$tax_name = wc_attribute_taxonomy_name( $taxonomy );\n\t\t\tif ( ! taxonomy_exists( $tax_name ) && ! in_array( $tax_name, $sync_taxonomies ) ) {\n\t\t\t\tedgenet()->debug->notice( __( '- Creating', 'edgenet' ) );\n\n\t\t\t\t$status = wc_create_attribute( $pa_args );\n\n\t\t\t\t$sync_taxonomies[] = $tax_name;\n\n\t\t\t\tedgenet()->debug->notice( __( '- Created', 'edgenet' ), $status );\n\t\t\t} else {\n\t\t\t\tedgenet()->debug->notice( __( '- Found', 'edgenet' ) );\n\t\t\t}\n\n\t\t\tif ( ! has_term( $spec['value'], $taxonomy, $product_id ) ) {\n\t\t\t\tedgenet()->debug->notice( __( sprintf( '- Assigning term \"%s\" to Product ID: %s', $spec['value'], $product_id ), 'edgenet' ) );\n\t\t\t\twp_set_object_terms( $product_id, $spec['value'], $taxonomy );\n\t\t\t} else {\n\t\t\t\tedgenet()->debug->notice( __( sprintf( '- Term exists \"%s\" on Product ID: %s', $spec['value'], $product_id ), 'edgenet' ) );\n\t\t\t}\n\n\t\t\t$att_meta[] = [\n\t\t\t\t'name' => $taxonomy,\n\t\t\t\t'value' => $spec['value'],\n\t\t\t\t'is_visible' => 1,\n\t\t\t\t'is_variation' => 1,\n\t\t\t\t'is_taxonomy' => 1,\n\t\t\t];\n\t\t}\n\n\t\tedgenet()->debug->notice( __( '- Updating product attributes post meta', 'edgenet' ) );\n\t\tupdate_post_meta( $product_id, '_product_attributes', $att_meta );\n\t}", "public function isAttributeCheckbox()\n {\n return trim(Mage::getStoreConfig('training_layred/catalog/attribute_checkbox'));\n }", "function sanitize_term($term, $taxonomy, $context = 'display')\n {\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 hasAttributes() {\n return $this->_has(3);\n }", "function wp_kses_attr_check(&$name, &$value, &$whole, $vless, $element, $allowed_html)\n {\n }", "public function passes($attribute, $value)\n {\n // get collection of supplier products\n $products = Product::where('supplier_id', $this->supplier_id)->get();\n\n // if the product already exists and is the current product the all is well\n\n // dd($this->product_id == $id);\n\n\n // if the products collection contains the value (product name)\n if ($products->contains('name', $value)) {\n return false; // is unique\n } else {\n return true;\n }\n }", "protected function condition() {\n\t\treturn apply_filters( 'appthemes_html_term_description_condition', true, $this->get_current_taxonomy() );\n\t}", "function acf_get_term($term_id, $taxonomy = '')\n{\n}", "function add_carton_term_meta( $term_id, $meta_key, $meta_value, $unique = false ){\n\treturn add_metadata( 'carton_term', $term_id, $meta_key, $meta_value, $unique );\n}", "function acf_upgrade_550_termmeta()\n{\n}", "function showspace_terms_accepted() {\n $options = get_option('showspace_options');\n return array_key_exists('showspace_terms_accepted', $options);\n}", "public function check_product_exists($attr_id, $base_product_id)\n\t{\n\t\t$productIntTable = Mage::getSingleton('core/resource')->getTableName('catalog_product_entity_int');\n\t\t$sql = \"select entity_id from \" . $productIntTable . \"\n\t\t\t\t\t\t\t where attribute_id = '\" . (int) $attr_id . \"' \n\t\t\t\t\t\t\t and value = '\" . (int) $base_product_id . \"'\";\n\t\t$prod = Mage::getSingleton('core/resource')->getConnection('core_read')->fetchRow($sql);\n\t\tif (!empty($prod)) {\n\t\t\t$pid = $prod['entity_id'];\n\t\t\tunset($prod);\n\t\t\treturn $pid;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function qode_tours_get_tour_attributes() {\n\t\t$tour_attributes = array();\n\t\t\n\t\t$terms = get_terms(array(\n\t\t\t'taxonomy' => 'tour-attribute',\n\t\t\t'hide_empty' => false,\n\t\t\t)\n\t\t);\n\n\t\tforeach($terms as $term) {\n\t\t\t$tour_attributes[$term->slug] = $term->name;\n\t\t}\n\n\t\treturn $tour_attributes;\n\t}", "function save_extra_taxonomy_fields($term_id)\n\n {\n\n if (isset($_POST['term_meta'])) {\n\n $t_id = $term_id;\n\n $term_meta = get_option(\"taxonomy_$t_id\");\n\n $cat_keys = array_keys($_POST['term_meta']);\n\n foreach ($cat_keys as $key) {\n\n if (isset($_POST['term_meta'][$key])) {\n\n $term_meta[$key] = $_POST['term_meta'][$key];\n\n }\n\n }\n\n update_option(\"taxonomy_$t_id\", $term_meta);\n\n }\n\n }", "public function checkAttrName(Request $request){\n $attrId = $request->attr_id;\n if(isset($attrId) && !empty($attrId)){\n $data = ProductAttributeList::where('attribute_name',$request->attrName)->where('id','!=',$attrId)->get();\n if(count($data) > 0){\n $responce = 1;\n }else{\n $responce = 0;\n }\n }else{\n $data = ProductAttributeList::where('attribute_name',$request->attrName)->get();\n if(count($data) > 0){\n $responce = 1;\n }else{\n $responce = 0;\n }\n }\n echo $responce;\n }", "function acf_get_valid_terms($terms = \\false, $taxonomy = 'category')\n{\n}", "function _s_primary_menu_menu_atts( $atts, $item, $args ) {\n \n if( 'primary' != $args->theme_location ) {\n return $items;\n }\n \n $classes = $item->classes;\n \n foreach( $classes as $class ) {\n \n if( ( strpos( $class, 'product_cat' ) !== false ) || ( strpos( $class, 'design_cat' ) !== false ) ) {\n $term_id = $item->object_id;\n $taxonomy = str_replace( 'menu-item-object-', '', $class );\n $term_object = get_term_by( 'id', $term_id, $taxonomy );\n \n if ( $term_object instanceof WP_Term ) {\n \n $attachment_id = get_woocommerce_term_meta( $term_id, 'thumbnail_id', true );\n \n if( $photo = wp_get_attachment_image( $attachment_id, 'medium' ) ) {\n $atts['data-photo'] = esc_html( $photo );\n }\n \n }\n }\n \n }\n \n return $atts;\n}", "public function supportsTermCatalog() {\n \treturn $this->manager->supportsTermCatalog();\n\t}" ]
[ "0.74713624", "0.6855101", "0.68172103", "0.65320796", "0.6283546", "0.62783366", "0.62559515", "0.6155726", "0.6070046", "0.6021501", "0.590866", "0.59049076", "0.5903992", "0.5888175", "0.5828932", "0.5824053", "0.5816375", "0.5799008", "0.57399553", "0.57211685", "0.5667101", "0.56633765", "0.5661474", "0.5641994", "0.5613845", "0.56084704", "0.56076676", "0.5543339", "0.5540935", "0.54942435", "0.54811025", "0.5445862", "0.5443545", "0.54341716", "0.5417504", "0.54142517", "0.5401908", "0.53993624", "0.53836554", "0.53569585", "0.5332607", "0.5291144", "0.5262372", "0.52382654", "0.5234193", "0.5231673", "0.5230989", "0.52059555", "0.5201431", "0.5196531", "0.5190544", "0.51754326", "0.5168715", "0.5152981", "0.51296747", "0.51275903", "0.51272416", "0.51189905", "0.51099503", "0.5109434", "0.5109434", "0.5104596", "0.51017886", "0.50989413", "0.5094952", "0.50858915", "0.50592804", "0.5056473", "0.5055541", "0.50531536", "0.5050597", "0.504909", "0.5047251", "0.50457776", "0.50437856", "0.50411814", "0.5035332", "0.5034992", "0.5033205", "0.5032359", "0.5020544", "0.5019183", "0.50130224", "0.50098866", "0.5009334", "0.5000354", "0.49992773", "0.49981922", "0.49868295", "0.49799576", "0.49791732", "0.49763253", "0.4975368", "0.49749407", "0.49732774", "0.49716708", "0.49700534", "0.49653655", "0.49603736", "0.495974" ]
0.7280545
1
/ / Create WooCommerce Product Attribute Term /
function create_product_attribute_term( $term_name, $attribute_name ) { if ( wp_insert_term( $term_name, $attribute_name ) ) { wisync_admin_notice__success( $term_name . ' added to Product Attributes.' ); } else { wisync_admin_notice__error( 'Failed to add ' . $term_name . ' to Product Attributes.' ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_product_attribute( $label_name ) {\n global $wpdb;\n\n $slug = sanitize_title( $label_name );\n\n if ( strlen( $slug ) >= 28 ) {\n return new WP_Error( 'invalid_product_attribute_slug_too_long', sprintf( __( 'Name \"%s\" is too long (28 characters max). Shorten it, please.', 'woocommerce' ), $slug ), array( 'status' => 400 ) );\n } elseif ( wc_check_if_attribute_name_is_reserved( $slug ) ) {\n return new WP_Error( 'invalid_product_attribute_slug_reserved_name', sprintf( __( 'Name \"%s\" is not allowed because it is a reserved term. Change it, please.', 'woocommerce' ), $slug ), array( 'status' => 400 ) );\n } elseif ( taxonomy_exists( wc_attribute_taxonomy_name( $label_name ) ) ) {\n return new WP_Error( 'invalid_product_attribute_slug_already_exists', sprintf( __( 'Name \"%s\" is already in use. Change it, please.', 'woocommerce' ), $label_name ), array( 'status' => 400 ) );\n }\n\n $data = array(\n 'attribute_label' => $label_name,\n 'attribute_name' => $slug,\n 'attribute_type' => 'select',\n 'attribute_orderby' => 'menu_order',\n 'attribute_public' => 0, // Enable archives ==> true (or 1)\n );\n\n $results = $wpdb->insert( \"{$wpdb->prefix}woocommerce_attribute_taxonomies\", $data );\n\n if ( is_wp_error( $results ) ) {\n return new WP_Error( 'cannot_create_attribute', $results->get_error_message(), array( 'status' => 400 ) );\n } else {\n\t\twisync_admin_notice__success( 'Created ' . $label_name . ' as Product Attribute.' );\n\t}\n\n $id = $wpdb->insert_id;\n\n do_action('woocommerce_attribute_added', $id, $data);\n\n wp_schedule_single_event( time(), 'woocommerce_flush_rewrite_rules' );\n\n delete_transient('wc_attribute_taxonomies');\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}", "function product_attribute_description() {\n echo wpautop( __( 'Attribute terms can be assigned to products and variations.<br/><br/><b>Note</b>: Deleting a term will remove it from all products and variations to which it has been assigned. Recreating a term will not automatically assign it back to products.', 'woocommerce' ) );\n}", "public function addAttributes($post_id)\n\t{\n\t\t$attr = 'custom';\n\t\t\n\t\twp_set_object_terms($post_id, '0', $attr);\n\n $thedata[sanitize_title($attr)] = array(\n \t'name' => wc_clean($attr),\n 'value' => '0',\n 'postion' => '0',\n 'is_visible' => '0',\n 'is_variation' => '1',\n 'is_taxonomy' => '1'\n );\n \n\t\tupdate_post_meta($post_id, '_product_attributes', $thedata);\n\t\t\t\t\t\t\n\t}", "public function add_attribute($post_id, $key, $value) \n\t { \n\t global $wpdb;\n\t global $woocommerce;\n\t\t\t \n\t // get attribute name, label\n\t if ( isset($this->amz_settings['attr_title_normalize']) && $this->amz_settings['attr_title_normalize'] == 'yes' )\n\t \t$attribute_label = $this->attrclean_splitTitle( $key );\n\t\t\telse\n\t\t\t\t$attribute_label = $key;\n\t $attribute_name = $this->the_plugin->cleanTaxonomyName($key, false);\n\n\t // set attribute type\n\t $attribute_type = 'select';\n\t \n\t // check for duplicates\n\t $attribute_taxonomies = $wpdb->get_var(\"SELECT * FROM {$wpdb->prefix}woocommerce_attribute_taxonomies WHERE attribute_name = '\".esc_sql($attribute_name).\"'\");\n\t \n\t if ($attribute_taxonomies) {\n\t // update existing attribute\n\t $wpdb->update(\n $wpdb->prefix . 'woocommerce_attribute_taxonomies', array(\n\t\t 'attribute_label' => $attribute_label,\n\t\t 'attribute_name' => $attribute_name,\n\t\t 'attribute_type' => $attribute_type,\n\t\t 'attribute_orderby' => 'name'\n ), array('attribute_name' => $attribute_name)\n\t );\n\t } else {\n\t // add new attribute\n\t $wpdb->insert(\n\t $wpdb->prefix . 'woocommerce_attribute_taxonomies', array(\n\t \t'attribute_label' => $attribute_label,\n\t \t'attribute_name' => $attribute_name,\n\t \t'attribute_type' => $attribute_type,\n\t \t'attribute_orderby' => 'name'\n\t )\n\t );\n\t }\n\n\t // avoid object to be inserted in terms\n\t if (is_object($value))\n\t return;\n\t\n\t // add attribute values if not exist\n\t $taxonomy = $this->the_plugin->cleanTaxonomyName($attribute_name);\n\t\t\t\n\t if( is_array( $value ) )\n\t {\n\t $values = $value;\n\t }\n\t else\n\t {\n\t $values = array($value);\n\t }\n \n\t // check taxonomy\n\t if( !taxonomy_exists( $taxonomy ) ) \n\t {\n\t // add attribute value\n\t foreach ($values as $attribute_value) {\n\t \t$attribute_value = (string) $attribute_value;\n\n\t if (is_string($attribute_value)) {\n\t // add term\n\t //$name = stripslashes($attribute_value);\n\t\t\t\t\t\t$name = $this->the_plugin->cleanValue( $attribute_value ); // 2015, october 28 - attributes bug update!\n\t $slug = sanitize_title($name);\n\t\t\t\t\t\t\n\t if( !term_exists($name) ) {\n\t if( trim($slug) != '' && trim($name) != '' ) {\n\t \t$this->the_plugin->db_custom_insert(\n\t \t\t$wpdb->terms,\n\t \t\tarray(\n\t \t\t\t'values' => array(\n\t\t \t'name' => $name,\n\t\t \t'slug' => $slug\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t'format' => array(\n\t\t\t\t\t\t\t\t\t\t\t'%s', '%s'\n\t\t\t\t\t\t\t\t\t\t)\n\t \t\t),\n\t \t\ttrue\n\t \t);\n\t /*$wpdb->insert(\n $wpdb->terms, array(\n\t\t 'name' => $name,\n\t\t 'slug' => $slug\n )\n\t );*/\n\t\n\t // add term taxonomy\n\t $term_id = $wpdb->insert_id;\n\t \t$this->the_plugin->db_custom_insert(\n\t \t\t$wpdb->term_taxonomy,\n\t \t\tarray(\n\t \t\t\t'values' => array(\n\t\t \t'term_id' => $term_id,\n\t\t \t'taxonomy' => $taxonomy\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t'format' => array(\n\t\t\t\t\t\t\t\t\t\t\t'%d', '%s'\n\t\t\t\t\t\t\t\t\t\t)\n\t \t\t),\n\t \t\ttrue\n\t \t);\n\t /*$wpdb->insert(\n $wpdb->term_taxonomy, array(\n\t\t 'term_id' => $term_id,\n\t\t 'taxonomy' => $taxonomy\n )\n\t );*/\n\t\t\t\t\t\t\t\t$term_taxonomy_id = $wpdb->insert_id;\n\t\t\t\t\t\t\t\t$__dbg = compact('taxonomy', 'attribute_value', 'term_id', 'term_taxonomy_id');\n\t\t\t\t\t\t\t\t//var_dump('<pre>1: ',$__dbg,'</pre>');\n\t }\n\t } else {\n\t // add term taxonomy\n\t $term_id = $wpdb->get_var(\"SELECT term_id FROM {$wpdb->terms} WHERE name = '\".esc_sql($name).\"'\");\n\t $this->the_plugin->db_custom_insert(\n\t \t$wpdb->term_taxonomy,\n\t \tarray(\n\t \t\t'values' => array(\n\t\t \t\t'term_id' => $term_id,\n\t\t \t\t'taxonomy' => $taxonomy\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t'format' => array(\n\t\t\t\t\t\t\t\t\t\t'%d', '%s'\n\t\t\t\t\t\t\t\t\t)\n\t \t),\n\t \ttrue\n\t );\n\t /*$wpdb->insert(\n \t\t$wpdb->term_taxonomy, array(\n\t\t 'term_id' => $term_id,\n\t\t 'taxonomy' => $taxonomy\n )\n\t );*/\n\t\t\t\t\t\t\t$term_taxonomy_id = $wpdb->insert_id;\n\t\t\t\t\t\t\t$__dbg = compact('taxonomy', 'attribute_value', 'term_id', 'term_taxonomy_id');\n\t\t\t\t\t\t\t//var_dump('<pre>1c: ',$__dbg,'</pre>');\n\t }\n\t }\n\t }\n\t }\n\t else \n\t {\n\t // get already existing attribute values\n\t $attribute_values = array();\n\t /*$terms = get_terms($taxonomy, array('hide_empty' => true));\n\t\t\t\tif( !is_wp_error( $terms ) ) {\n\t \tforeach ($terms as $term) {\n\t \t$attribute_values[] = $term->name;\n\t \t}\n\t\t\t\t} else {\n\t\t\t\t\t$error_string = $terms->get_error_message();\n\t\t\t\t\tvar_dump('<pre>',$error_string,'</pre>'); \n\t\t\t\t}*/\n\t\t\t\t$terms = $this->the_plugin->load_terms($taxonomy);\n\t foreach ($terms as $term) {\n\t \t$attribute_values[] = $term->name;\n\t }\n\t \n\t // Check if $attribute_value is not empty\n\t if( !empty( $attribute_values ) )\n\t {\n\t foreach( $values as $attribute_value ) \n\t {\n\t \t$attribute_value = (string) $attribute_value;\n\t\t\t\t\t\t$attribute_value = $this->the_plugin->cleanValue( $attribute_value ); // 2015, october 28 - attributes bug update!\n\t if( !in_array( $attribute_value, $attribute_values ) ) \n\t {\n\t // add new attribute value\n\t $__term_and_tax = wp_insert_term($attribute_value, $taxonomy);\n\t\t\t\t\t\t\t$__dbg = compact('taxonomy', 'attribute_value', '__term_and_tax');\n\t\t\t\t\t\t\t//var_dump('<pre>1b: ',$__dbg,'</pre>');\n\t }\n\t }\n\t }\n\t }\n\t\n\t // Add terms\n\t if( is_array( $value ) )\n\t {\n\t foreach( $value as $dm_v )\n\t {\n\t \t$dm_v = (string) $dm_v;\n\t if( !is_array($dm_v) && is_string($dm_v)) {\n\t \t$dm_v = $this->the_plugin->cleanValue( $dm_v ); // 2015, october 28 - attributes bug update!\n\t $__term_and_tax = wp_insert_term( $dm_v, $taxonomy );\n\t\t\t\t\t\t$__dbg = compact('taxonomy', 'dm_v', '__term_and_tax');\n\t\t\t\t\t\t//var_dump('<pre>2: ',$__dbg,'</pre>');\n\t }\n\t }\n\t }\n\t else\n\t {\n\t \t$value = (string) $value;\n\t if( !is_array($value) && is_string($value) ) {\n\t \t$value = $this->the_plugin->cleanValue( $value ); // 2015, october 28 - attributes bug update!\n\t $__term_and_tax = wp_insert_term( $value, $taxonomy );\n\t\t\t\t\t$__dbg = compact('taxonomy', 'value', '__term_and_tax');\n\t\t\t\t\t//var_dump('<pre>2b: ',$__dbg,'</pre>');\n\t }\n\t }\n\t\t\t\n\t // link to woocommerce attribute values\n\t if( !empty( $values ) )\n\t {\n\t foreach( $values as $term )\n\t {\n\t \t\n\t if( !is_array($term) && !is_object( $term ) )\n\t { \n\t $term = sanitize_title($term);\n\t \n\t $term_taxonomy_id = $wpdb->get_var( \"SELECT tt.term_taxonomy_id FROM {$wpdb->terms} AS t INNER JOIN {$wpdb->term_taxonomy} as tt ON tt.term_id = t.term_id WHERE t.slug = '\".esc_sql($term).\"' AND tt.taxonomy = '\".esc_sql($taxonomy).\"'\" );\n \n\t if( $term_taxonomy_id ) \n\t {\n\t $checkSql = \"SELECT * FROM {$wpdb->term_relationships} WHERE object_id = {$post_id} AND term_taxonomy_id = {$term_taxonomy_id}\";\n\t if( !$wpdb->get_var($checkSql) ) {\n\t $wpdb->insert(\n\t $wpdb->term_relationships, array(\n\t\t\t 'object_id' => $post_id,\n\t\t\t 'term_taxonomy_id' => $term_taxonomy_id\n\t )\n\t );\n\t }\n\t }\n\t }\n\t }\n\t }\n\t }", "function elex_bep_create_product_variation( $product_id, $variation_data ) {\n //Get varaible product object parent\n $product = wc_get_product( $product_id );\n //\n $variation_post = array(\n 'post_title' => $product->get_name(),\n 'post_name' => 'product-'.$product_id.'-varation',\n 'post_status' => 'publish',\n 'post_parent' => $product_id,\n 'post_type' => 'product_variation',\n 'guid' => $product->get_permalink()\n );\n\n $variation_id = wp_insert_post( $variation_post );\n $variation = new WC_Product_Variation( $variation_id );\n error_log( $variation_id );\n\n foreach ($variation_data['attributes'] as $attribute => $term_names )\n {\n $taxonomy = 'pa_'.$attribute; // The attribute taxonomy\n\n // If taxonomy doesn't exists we create it (Thanks to Carl F. Corneil)\n if( ! taxonomy_exists( $taxonomy ) ){ \n register_taxonomy(\n $taxonomy, 'product_variation',\n array(\n 'hierarchical' => false,\n 'label' => ucfirst( $attribute ),\n 'query_var' => true,\n 'rewrite' => array( 'slug' => sanitize_title($attribute) ), // The base slug\n )\n );\n }\n foreach( $term_names as $key=> $term_name ){\n error_log( $key. ' '. $term_name );\n // Check if the Term name exist and if not we create it.\n if( ! term_exists( $term_name, $taxonomy ) ){\n wp_insert_term( $term_name, $taxonomy ); // Create the term\n }\n $term_slug = get_term_by('name', $term_name, $taxonomy )->slug; // Get the term slug\n error_log( print_r($term_slug, TRUE ));\n\n // // Get the post Terms names from the parent variable product.\n $post_term_names = wp_get_post_terms( $product_id, $taxonomy, array('fields' => 'names') );\n\n // // Check if the post term exist and if not we set it in the parent variable product.\n if( ! in_array( $term_name, $post_term_names ) )\n wp_set_post_terms( $product_id, $term_name, $taxonomy, true );\n\n // // Set/save the attribute data in the product variation\n update_post_meta( $variation_id, 'attribute_'.$taxonomy, $term_slug );\n }\n }\n if( ! empty( $variation_data['sku'] ) )\n $variation->set_sku( $variation_data['sku'] );\n\n // Prices\n if( empty( $variation_data['sale_price'] ) ){\n $variation->set_price( $variation_data['regular_price'] );\n } else {\n $variation->set_price( $variation_data['sale_price'] );\n $variation->set_sale_price( $variation_data['sale_price'] );\n }\n $variation->set_regular_price( $variation_data['regular_price'] );\n\n // Stock\n if( ! empty($variation_data['stock_qty']) ){\n $variation->set_stock_quantity( $variation_data['stock_qty'] );\n $variation->set_manage_stock(true);\n $variation->set_stock_status('');\n } else {\n $variation->set_manage_stock(false);\n }\n $variation->set_weight(''); // weight (reseting)\n error_log( print_r( $variation, TRUE ));\n $variation->save(); \n}", "public function addTermAttributes(\\obiba\\mica\\TermAttributesDto $value) {\n return $this->_add(19, $value);\n }", "function vendor_defined_taxonomy() {\n // The targeted product attribute taxonomy\n return 'pa_color'; \n}", "function gcd_tax_add_new_meta_field() {\r\n ?>\r\n <div class=\"form-field\">\r\n <label for=\"term_meta[featured]\"><?php _e( 'Featured ?', '' ); ?></label>\r\n <input type=\"text\" name=\"term_meta[featured]\" id=\"term_meta[featured]\" value=\"\">\r\n <p class=\"description\"><?php _e( 'Type 1 if you want to list category as featured','' ); ?></p>\r\n </div>\r\n\r\n <div class=\"form-field\">\r\n <label for=\"term_meta[subtitle]\"><?php _e( 'Subtitle', '' ); ?></label>\r\n <input type=\"text\" name=\"term_meta[subtitle]\" id=\"term_meta[subtitle]\" value=\"\">\r\n <p class=\"description\"><?php _e( 'Subtitle for your group','' ); ?></p>\r\n <div>\r\n<?php\r\n}", "function createTerm($vocabulary) {\n $term = entity_create('taxonomy_term', array(\n 'name' => $this->randomName(),\n 'description' => $this->randomName(),\n // Use the first available text format.\n 'format' => db_query_range('SELECT format FROM {filter_format}', 0, 1)->fetchField(),\n 'vid' => $vocabulary->vid,\n 'langcode' => LANGUAGE_NOT_SPECIFIED,\n ));\n taxonomy_term_save($term);\n return $term;\n }", "public function postCreate()\n {\n \tLog::info(\"postCreate in AttributeController\");\n\n \t$product_id = Input::get('product_id');\n \t\n \t$form = $this->attribute->getForm();\n \n \tLog::info(\"111111111111111111\");\n \tif (! $form->isValid()) {\n \t\tLog::info(\"22222222\");\n \t\treturn $this->redirectRoute('admin.attribute.index')\n \t\t->withErrors($form->getErrors())\n \t\t->withInput();\n \t}\n \tLog::info(\"3333333333333333333\");\n \n \t$attribute = $this->attribute->create($form->getInputData());\n \t\n \t$product = $this->product->findById($product_id);\n \t$product->attributes()->attach($attribute->id);\n \t\n \t$attributes = $this->product->findAttributesById($product_id);\n \t\n \t//var_dump($attributes);\n //\t$attributes = $this->product\n \n \treturn $attributes;\n }", "function create_product_variation( $product_id, $variation_data ){\n // Get the Variable product object (parent)\n $product = wc_get_product($product_id);\n\n $variation_post = array(\n 'post_title' => $product->get_title(),\n 'post_name' => 'product-'.$product_id.'-variation',\n 'post_status' => 'publish',\n 'post_parent' => $product_id,\n 'post_type' => 'product_variation',\n 'guid' => $product->get_permalink()\n );\n\n // Creating the product variation\n $variation_id = wp_insert_post( $variation_post );\n\n // Get an instance of the WC_Product_Variation object\n $variation = new WC_Product_Variation( $variation_id );\n\n // Iterating through the variations attributes\n foreach ($variation_data['attributes'] as $attribute => $term_name )\n {\n $taxonomy = 'pa_'.$attribute; // The attribute taxonomy\n\n // Check if the Term name exist and if not we create it.\n if( ! term_exists( $term_name, $taxonomy ) )\n wp_insert_term( $term_name, $taxonomy ); // Create the term\n\n $term_slug = get_term_by('name', $term_name, $taxonomy )->slug; // Get the term slug\n\n // Get the post Terms names from the parent variable product.\n $post_term_names = wp_get_post_terms( $product_id, $taxonomy, array('fields' => 'names') );\n\n // Check if the post term exist and if not we set it in the parent variable product.\n if( ! in_array( $term_name, $post_term_names ) )\n wp_set_post_terms( $product_id, $term_name, $taxonomy, true );\n\n // Set/save the attribute data in the product variation\n update_post_meta( $variation_id, 'attribute_'.$taxonomy, $term_slug );\n\n }\n\n ## Set/save all other data\n\n // SKU\n if( ! empty( $variation_data['sku'] ) )\n $variation->set_sku( $variation_data['sku'] );\n\n // Prices\n if( empty( $variation_data['sale_price'] ) ){\n $variation->set_price( $variation_data['regular_price'] );\n } else {\n $variation->set_price( $variation_data['sale_price'] );\n $variation->set_sale_price( $variation_data['sale_price'] );\n }\n $variation->set_regular_price( $variation_data['regular_price'] );\n\n // Stock\n if( ! empty($variation_data['stock_qty']) ){\n $variation->set_stock_quantity( $variation_data['stock_qty'] );\n $variation->set_manage_stock(true);\n $variation->set_stock_status('');\n } else {\n $variation->set_manage_stock(false);\n }\n\n $variation->set_weight(''); // weight (resetting)\n\n $variation->save(); // Save the data\n }", "function omfg_mobile_artist_add_theme_taxonomy() {\n\n\twp_insert_term(\n \t\t'Artist Theme', \t\t\t\t// the term\n \t\t'omfg_mobile_pro_themes', \t// the taxonomy\n \t\tarray(\n \t\t'description' => 'Artist Theme for the OMFG Mobile Landing Page Plugin.',\n \t\t'slug' => 'omfg-mobile-artist-theme'\n \t\t)\n\t);\n\n}", "public function create() {\n\t\tupdate_option( 'woocommerce_calc_taxes', 'yes' );\n\t\tupdate_option( 'woocommerce_prices_include_tax', 'yes' );\n\n\t\t// Create tax rates.\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '25' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '12' );\n\t\t$this->tax_rate_ids[] = $this->create_tax_rate( '6' );\n\t\t$this->product = ( new Krokedil_Simple_Product() )->create();\n\t}", "public static function action_created_term( $term_id, $tt_id, $taxonomy ) {\n\t\tself::purge_term( $term_id );\n\t\tpantheon_wp_clear_edge_keys( array( 'rest-' . $taxonomy . '-collection' ) );\n\t}", "public function CreateAttribute($attribute_data,$attribute_set_id){\n\n $attribute_code = $attribute_data['attribute_code'];\n $attribute_name = $attribute_data['attribute_name'];\n $field_type_id = $attribute_data['field_type_id'];\n $input_type = 'text';\n if($field_type_id == 1){\n $input_type = 'select';\n }else if($field_type_id ==4){\n $input_type = 'multiselect';\n }\n\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\".$attribute_code,0);\n\n if(isset($result['message'])){\n\n $data['attribute'] = array(\n \"attribute_code\" => $attribute_code,\n \"frontend_input\" => $input_type,\n \"scope\" => \"global\",\n \"is_unique\" => 0,\n \"is_required\" => 0,\n \"is_searchable\" => 0,\n \"is_visible_in_advanced_search\" => 0,\n \"is_comparable\" => 0,\n \"is_used_for_promo_rules\" => 0,\n \"is_visible_on_front\" => 0,\n \"used_in_product_listing\" => 0,\n \"default_frontend_label\" => $attribute_name,\n \"frontend_labels\" => array(array(\"store_id\" => \"0\", \"label\" => $attribute_name))\n );\n\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\",1,json_encode($data));\n\n $attribute_id = $result['attribute_id'];\n\n }else{\n $attribute_id = $result['attribute_id'];\n }\n\n $result2 = $this->curlRequest(\"/rest/V1/products/attribute-sets/attributes\",1,json_encode([\n \"attributeSetId\" => $attribute_set_id,\n \"attributeCode\" => $attribute_code,\n \"attributeGroupId\" => 130,\n \"sortOrder\" => 0\n ]) );\n\n return $attribute_id;\n\n }", "function am2_vanity_add_taxonomy_fields( $term ) { //check for existing featured ID\n $t_id = $term->term_id;\n $vanity_urls = get_option('am2_vanity_urls');\n\t$value = '';\n\tif(!empty($vanity_urls[$_REQUEST['taxonomy'].\"_\".$term->term_id]['url'])){\n\t\t$value = $vanity_urls[$_REQUEST['taxonomy'].\"_\".$term->term_id]['url'];\n\t}\n?>\n<tr class=\"form-field\">\n\t<th scope=\"row\" valign=\"top\"><label for=\"_am2_vanity_url\"><?php _e('Vanity URL'); ?></label></th>\n\t<td>\n \t<?php echo site_url().'/'; ?>\n\t\t<input type=\"hidden\" name=\"_am2_vanity_term_name\" value=\"<?php echo $_REQUEST['taxonomy']; ?>\" />\n <input type=\"text\" name=\"_am2_vanity_url\" id=\"_am2_vanity_url\" placeholder=\"any-url\" size=\"3\" style=\"width:60%;\" value=\"<?php echo $value; ?>\"><br />\n <span class=\"description\"><?php _e('This URL will replace the dafault category URL with new one.'); ?></span>\n </td>\n</tr>\n<?php\n}", "public function createAttribute()\n\t{\n\n\t\t$this->createCustomAttribute($this->attributeName, $this->arguments);\n\n\t}", "function add_carton_term_meta( $term_id, $meta_key, $meta_value, $unique = false ){\n\treturn add_metadata( 'carton_term', $term_id, $meta_key, $meta_value, $unique );\n}", "function gcd_tax_edit_meta_field($term) {\r\n $t_id = $term->term_id;\r\n \r\n // retrieve the existing value(s) for this meta field. This returns an array\r\n $term_meta = get_option( \"taxonomy_$t_id\" ); ?>\r\n <tr class=\"form-field\">\r\n <th scope=\"row\" valign=\"top\"><label for=\"term_meta[featured]\"><?php _e( 'Featured ?', '' ); ?></label></th>\r\n <td>\r\n <input type=\"text\" name=\"term_meta[featured]\" id=\"term_meta[featured]\" value=\"<?php echo esc_attr( $term_meta['featured'] ) ? esc_attr( $term_meta['featured'] ) : ''; ?>\">\r\n <p class=\"description\"><?php _e( 'Type 1 if you want to list category as featured','' ); ?></p>\r\n </td>\r\n </tr>\r\n <tr class=\"form-field\">\r\n <th scope=\"row\" valign=\"top\"><label for=\"term_meta[subtitle]\"><?php _e( 'Subtitle', '' ); ?></label></th>\r\n <td>\r\n <input type=\"text\" name=\"term_meta[subtitle]\" id=\"term_meta[subtitle]\" value=\"<?php echo esc_attr( $term_meta['subtitle'] ) ? esc_attr( $term_meta['subtitle'] ) : ''; ?>\">\r\n <p class=\"description\"><?php _e( 'Subtitle for your project','' ); ?></p>\r\n </td>\r\n </tr>\r\n<?php\r\n}", "function wp_newTerm( $args ) {\n\n global $wp_xmlrpc_server;\n $wp_xmlrpc_server->escape( $args );\n\n $blog_ID = (int) $args[0];\n $username = $args[1];\n $password = $args[2];\n $content_struct = $args[3];\n\n if ( ! $user = $wp_xmlrpc_server->login( $username, $password ) )\n return $wp_xmlrpc_server->error;\n\n if ( ! taxonomy_exists( $content_struct['taxonomy'] ) )\n return new IXR_Error( 403, __( 'Invalid taxonomy' ) );\n\n $taxonomy = get_taxonomy( $content_struct['taxonomy'] );\n\n if( ! current_user_can( $taxonomy->cap->manage_terms ) )\n return new IXR_Error( 401, __( 'You are not allowed to create terms in this taxonomy' ) );\n\n $taxonomy = (array)$taxonomy;\n\n // hold the data of the term\n $term_data = array();\n \n $term_data['name'] = trim( $content_struct['name'] );\n if ( empty ( $term_data['name'] ) )\n return new IXR_Error( 403, __( 'The term name cannot be empty' ) );\n\n if( isset ( $content_struct['parent'] ) ) {\n\n if( ! $taxonomy['hierarchical'] )\n return new IXR_Error( 403, __( 'This taxonomy is not hieararchical' ) );\n\n $parent_term_id = (int)$content_struct['parent'];\n $parent_term = get_term( $parent_term_id , $taxonomy['name'] );\n\n if ( is_wp_error( $parent_term ) )\n return new IXR_Error( 500, $term->get_error_message() );\n\n if ( ! $parent_term )\n return new IXR_Error(500, __('Parent term does not exist'));\n\n $term_data['parent'] = $content_struct['parent'];\n \n }\n\n $term_data['description'] = '';\n if( isset ( $content_struct['description'] ) )\n $term_data['description'] = $content_struct['description'];\n\n $term_data['slug'] = '';\n if( isset ( $content_struct['slug'] ) )\n $term_data['slug'] = $content_struct['slug'];\n\n $term_ID = wp_insert_term( $term_data['name'] , $taxonomy['name'] , $term_data );\n\n if ( is_wp_error( $term_ID ) )\n return new IXR_Error(500, $term_ID->get_error_message());\n\n if ( ! $term_ID )\n return new IXR_Error(500, __('Sorry, your entry could not be posted. Something wrong happened.'));\n\n return $term_ID;\n\n}", "public function createAttributes()\n {\n /** @var \\Shopware\\Components\\Model\\ModelManager $em */\n $em = $this->get('models');\n\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'link',\n 'int(11)',\n true,\n null\n );\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'show_by_default',\n 'int(1)',\n true,\n 0\n );\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'deleted_position',\n 'int(11)',\n true,\n null\n );\n\n $em->addAttribute(\n 's_categories_attributes',\n 'swag',\n 'base_sort',\n 'int(11)',\n true,\n null\n );\n\n $em->generateAttributeModels(['s_categories_attributes']);\n }", "public function create()\n {\n $attributes = AttributeModel::all();\n $products = ProductModel::all();\n\n\n return view('admin/catalog/product_attribute/create', compact('attributes','products'));\n\n }", "function get_product_category_attribute_terms($category_id) {\n $args = array(\n 'post_type' => 'product',\n 'post_status' => 'publish',\n 'ignore_sticky_posts' => 1,\n 'posts_per_page' => -1, // return all products (offset ignored with -1)\n 'tax_query' => array(\n array(\n 'taxonomy' => 'product_cat',\n 'field' => 'term_id', //This is optional, as it defaults to 'term_id'\n 'terms' => $category_id,\n 'operator' => 'IN' // Possible values are 'IN', 'NOT IN', 'AND'.\n ),\n array(\n 'taxonomy' => 'product_visibility',\n 'field' => 'slug',\n 'terms' => 'exclude-from-catalog', // Possibly 'exclude-from-search' too\n 'operator' => 'NOT IN'\n )\n )\n );\n $products_response = new WP_Query($args);\n $products = $products_response->posts;\n // Get product attribute details\n $attribute_taxonomies = wc_get_attribute_taxonomies();\n // Initialize response array\n $category_attribute_terms = array();\n // For each product attribute\n foreach ($attribute_taxonomies as $attribute_taxonomy) {\n // Get all attribute options for each product in the category\n $options = array_map(function($product) use ($attribute_taxonomy) {\n $terms = get_the_terms($product->ID, 'pa_' . $attribute_taxonomy->attribute_name);\n return $terms ? $terms : [];\n }, $products);\n // Remove duplicate options\n $unique_options =\n array_values(\n array_unique(\n array_merge(...$options),\n SORT_REGULAR\n )\n );\n // Push attribute details and options to attribute terms array\n $category_attribute_terms[] = (object) [\n 'id' => $attribute_taxonomy->attribute_id,\n 'name' => $attribute_taxonomy->attribute_name,\n 'label' => $attribute_taxonomy->attribute_label,\n 'slug' => 'pa_' . $attribute_taxonomy->attribute_name,\n 'options' => $unique_options\n ];\n }\n return $category_attribute_terms;\n}", "function acf_upgrade_550_termmeta()\n{\n}", "function glbs_edit_extra_tax_fields( $term ) { //check for existing featured ID\n\t$id = $term->term_id;\n\t\n\t$title = get_term_meta( $id, 'basic_seo_title', true );\n\t$key = get_term_meta( $id, 'basic_seo_keywords', true );\n\t$desc = get_term_meta( $id, 'basic_seo_description', true );\n\t?>\n\t<?php wp_nonce_field( '_glbs_nonce_tax', 'glbs_nonce_tax' ); ?>\n\t<table class=\"form-table\">\n\t\t<tr class=\"form-field\">\n\t\t\t<th scope=\"row\"><label for=\"basic_seo_title\"><?php _e( 'SEO Title', 'glbs' ); ?></label></th>\n\t\t\t<td>\n\t\t\t\t<input class=\"large-text\" type=\"text\" name=\"basic_seo_title\" id=\"basic_seo_title\" value=\"<?php echo $title ? $title : ''; ?>\"><br/>\n\t\t\t\t<span class=\"description\">Leave empty to use default title</span>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"form-field\">\n\t\t\t<th scope=\"row\"><label for=\"basic_seo_keywords\"><?php _e( 'SEO Keywords', 'glbs' ); ?></label></th>\n\t\t\t<td>\n\t\t\t\t<input class=\"large-text\" type=\"text\" name=\"basic_seo_keywords\" id=\"basic_seo_keywords\" value=\"<?php echo $key ? $key : ''; ?>\"><br/>\n\t\t\t\t<span class=\"description\">Enter the list of keywords separated by comma</span>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr class=\"form-field\">\n\t\t\t<th scope=\"row\"><label for=\"basic_seo_description\"><?php _e( 'SEO Description', 'glbs' ); ?></label></th>\n\t\t\t<td>\n\t\t\t\t<textarea class=\"large-text\" name=\"basic_seo_description\" id=\"basic_seo_description\" rows=\"5\"><?php echo $desc ? $desc : ''; ?></textarea><br/>\n\t\t\t\t<span class=\"description\">Enter meta description for this Term</span>\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n\t<?php\n}", "protected function _generateAttributeOnToken()\n\t{\n\t\tif (!isset($this->_tempToken[\"args\"][\"attributes\"])) {\n\t\t\t$this->_tempToken[\"args\"][\"attributes\"] = array();\n\t\t}\n\t\tif (isset($this->_tempToken[\"args\"][\"attributes\"][$this->_attribute])) {\n\t\t\t$this->_attribute = null;\n\t\t} else {\n\t\t\t$this->_tempToken[\"args\"][\"attributes\"][$this->_attribute] = array(\n\t\t\t\t\"value\" => \"\"\n\t\t\t);\n\t\t}\n\t}", "function jigoshop_upgrade_99() {\n\tglobal $wpdb;\n\n\t$q = $wpdb->get_results(\"SELECT *\n\t\tFROM $wpdb->term_taxonomy\n\t\tWHERE taxonomy LIKE 'product_attribute_%'\n\t\");\n\n\tforeach($q as $item) {\n\t\t$taxonomy = str_replace('product_attribute_', 'pa_', $item->taxonomy);\n\n\t\t$wpdb->update(\n\t\t\t$wpdb->term_taxonomy,\n\t\t\tarray('taxonomy' => $taxonomy),\n\t\t\tarray('term_taxonomy_id' => $item->term_taxonomy_id)\n\t\t);\n\t}\n}", "function set_woo_product_terms( $product_id = 0 ) {\n\n\t// Get my product category ID.\n\t$product_cat_id = get_random_term( 'product_cat' );\n\n\t// Now set the object terms.\n\twp_set_object_terms( $product_id, absint( $product_cat_id ), 'product_cat' );\n\twp_set_object_terms( $product_id, 'simple', 'product_type' );\n}", "private function update_edgenet_taxonomy_attributes( $taxonomynode_path, $product, $post_id ) {\n\t\tforeach ( $taxonomynode_path as $taxonomynode ) {\n\t\t\tif ( isset( $taxonomynode->attributes ) && ! empty( $taxonomynode->attributes ) ) {\n\n\t\t\t\t$attribute_ids = array_map( function ( $attribute ) {\n\t\t\t\t\treturn $attribute['BaseAttribute'];\n\t\t\t\t}, $taxonomynode->attributes );\n\n\t\t\t\t$attributes = edgenet()->api_adapter->attribute( $attribute_ids );\n\n\t\t\t\t$meta = $product->get_attributes_values( $attributes );\n\n\t\t\t\tupdate_post_meta( $post_id, '_category_attributes', (array) $meta );\n\t\t\t}\n\t\t}\n\t}", "public function addVocabularyTerms(\\obiba\\mica\\TermAttributeDto $value) {\n return $this->_add(2, $value);\n }", "function save_extra_taxonomy_fields($term_id)\n\n {\n\n if (isset($_POST['term_meta'])) {\n\n $t_id = $term_id;\n\n $term_meta = get_option(\"taxonomy_$t_id\");\n\n $cat_keys = array_keys($_POST['term_meta']);\n\n foreach ($cat_keys as $key) {\n\n if (isset($_POST['term_meta'][$key])) {\n\n $term_meta[$key] = $_POST['term_meta'][$key];\n\n }\n\n }\n\n update_option(\"taxonomy_$t_id\", $term_meta);\n\n }\n\n }", "function filter_woocommerce_rest_prepare_product_object( $response, $object, $request ) {\n if( empty( $response->data ) ) {\n return $response;\n }\n\n $attribute_taxonomies = wc_get_attribute_taxonomies();\n\n // Loop through the attributes on current product\n $attributes = $response->data['attributes'];\n foreach($attributes as $attrkey => $attribute) {\n\n /* ########################################################\n - Adding new swatch key to attribute response for color attributes,\n which holds the hex code for each swatch color option\n ######################################################## */\n // Get an array of attributes whose attribute type is color\n $color_type_attribute_taxonomies = array_filter($attribute_taxonomies, function($attribute_taxonomy) {\n return $attribute_taxonomy->attribute_type == 'color';\n });\n // Loop through the color type attributes\n foreach($color_type_attribute_taxonomies as $tax_object) {\n //Check if current attribute is a color type attribute\n if ($attribute['id'] == $tax_object->attribute_id) {\n // Get current attribute's options\n $options = $response->data['attributes'][$attrkey]['options'];\n // Get current attribute's terms\n $color_terms = get_terms('pa_' . $tax_object->attribute_name);\n foreach( $options as $option ) {\n foreach($color_terms as $term) {\n if ($term->name == $option) {\n // Add a new swatch with hex value for each color option\n $response->data['attributes'][$attrkey]['swatches'][$option] = get_term_meta( $term->term_id, 'product_attribute_color', true);\n }\n }\n }\n }\n }\n\n /* ########################################################\n - Adding attribute taxonomy to the attribute response\n - Adding attribute identifier to the attribute response\n - Adding more detailed option data to the attribute options response\n ######################################################## */\n foreach($attribute_taxonomies as $attribute_taxonomy) {\n if ($attribute['id'] == $attribute_taxonomy->attribute_id) {\n\n /* Add slug to current attribute response */\n $response->data['attributes'][$attrkey]['taxonomy'] = ('pa_' . $attribute_taxonomy->attribute_name);\n\n /* Add attribute identifier to current attribute response */\n $response->data['attributes'][$attrkey]['slug'] = $attribute_taxonomy->attribute_name;\n\n /* Replace default options data with detailed options data for current attribute */\n $options = $response->data['attributes'][$attrkey]['options'];\n $new_options = array();\n $attribute_terms = get_terms('pa_' . $attribute_taxonomy->attribute_name);\n\n foreach( $options as $option ) {\n foreach($attribute_terms as $attribute_term) {\n if ($attribute_term->name == $option) {\n $new_options[] = (object) [\n 'id' => $attribute_term->term_id,\n 'name' => $attribute_term->name,\n 'slug' => $attribute_term->slug,\n 'taxonomy' => $attribute_term->taxonomy,\n 'description' => $attribute_term->description,\n 'count' => $attribute_term->count\n ];\n }\n }\n }\n $response->data['attributes'][$attrkey]['options'] = $new_options;\n }\n }\n }\n\n /* ########################################################\n - Replacing Variation IDs with Variation details\n ######################################################## */\n\n // Get the current product object\n $variation_ids = $response->data['variations'];\n\n $detailed_variations = array_map(function($variation_id) {\n $variation = wc_get_product($variation_id);\n return (object) [\n 'variation_id' => $variation->get_id(),\n 'image_url' => wp_get_attachment_url($variation->get_image_id()),\n 'variation_regular_price' => $variation->get_regular_price(),\n 'variation_sale_price' => $variation->get_sale_price(),\n 'attributes' => $variation->get_attributes(),\n 'is_on_sale' => $variation->is_on_sale()\n ];\n }, $variation_ids);\n\n $response->data['variations'] = $detailed_variations;\n\n\n /* ########################################################\n - Get ALL Variation attributes for a product\n ######################################################## */\n if ($response->data['type'] == 'variable') {\n $variation_attributes = wc_get_product($response->data['id'])->get_variation_attributes();\n $variation_attributes = array_map(function($attribute) {\n return (array_values($attribute));\n }, $variation_attributes);\n $response->data['variation_attributes'] = $variation_attributes;\n }\n\n\n\n /* Return new response */\n return $response;\n}", "function add_term_meta( $term_id, $meta_key, $meta_value, $unique = false ) {\n\treturn add_metadata( 'taxonomy', $term_id, $meta_key, $meta_value, $unique );\n}", "function AddAttribute() {\n $db = Core::GetDB();\n\n $id = Core::GetFromPOST('id');\n $attrs = Core::GetFromPOST('attrs');\n\n $attrs = fix_attrs($attrs);\n\n foreach ($attrs AS $attr) {\n $attr = explode(':', $attr);\n\n if (count($attr) == 3) {\n if (empty($attr) === false) {\n $db->Query(\"DELETE FROM data_xml_attributes WHERE data_xml_item_id = $id AND attr_name='{$attr[0]}' LIMIT 1\");\n $db->Query(\"INSERT INTO data_xml_attributes (data_xml_item_id, attr_name, attr_value, attr_type) VALUES ($id, '{$attr[0]}', '{$attr[1]}', '{$attr[2]}')\");\n }\n }\n }\n}", "public function run()\n {\n $attributes = ['color','size',];\n foreach($attributes as $attribute) {\n ProductAttribute::create([\n 'name' => $attribute,\n ]);\n }\n\n }", "public function create()\n {\n $product_attributes = Product_attributes::all();\n return view('product_attributes.create');\n }", "function func_create_warehouse_taxonomy() {\r\n \r\n// Add new taxonomy, make it hierarchical like categories\r\n//first do the translations part for GUI\r\n \r\n $labels = array(\r\n 'name' => _x( 'Warehouse', 'taxonomy general name' ),\r\n 'singular_name' => _x( 'Warehouse', 'taxonomy singular name' ),\r\n 'search_items' => __( 'Search Warehouse' ),\r\n 'all_items' => __( 'All Warehouse' ),\r\n 'parent_item' => __( 'Parent Warehouse' ),\r\n 'parent_item_colon' => __( 'Parent Warehouse:' ),\r\n 'edit_item' => __( 'Edit Warehouse' ), \r\n 'update_item' => __( 'Update Warehouse' ),\r\n 'add_new_item' => __( 'Add New Warehouse' ),\r\n 'new_item_name' => __( 'New Warehouse Name' ),\r\n 'menu_name' => __( 'Warehouses' ),\r\n ); \r\n \r\n// Now register the taxonomy\r\n \r\n register_taxonomy('warehouses',array('product'), array(\r\n 'hierarchical' => true,\r\n 'labels' => $labels,\r\n 'show_ui' => true,\r\n 'show_admin_column' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array( 'slug' => 'warehouse' , 'with_front' => false),\r\n ));\r\n \r\n}", "function glbs_add_extra_tax_fields( $term ) {\n\t$id = $term->term_id;\n\t\n\t$title = get_term_meta( $id, 'basic_seo_title', true );\n\t$key = get_term_meta( $id, 'basic_seo_keywords', true );\n\t$desc = get_term_meta( $id, 'basic_seo_description', true );\n\t?>\n\t<?php wp_nonce_field( '_glbs_nonce_tax', 'glbs_nonce_tax' ); ?>\n\t<div class=\"form-field\">\n\t\t<label for=\"basic_seo_title\"><?php _e( 'SEO Title', 'glbs' ); ?></label>\n\t\t<input class=\"large-text\" type=\"text\" name=\"basic_seo_title\" id=\"basic_seo_title\" value=\"<?php echo $title ? $title : ''; ?>\"><br>\n\t\t<span class=\"description\">Leave empty to use default title</span>\n\t</div>\n\t<div class=\"form-field\">\n\t\t<label for=\"basic_seo_keywords\"><?php _e( 'SEO Keywords', 'glbs' ); ?></label>\n\t\t<input class=\"large-text\" type=\"text\" name=\"basic_seo_keywords\" id=\"basic_seo_keywords\" value=\"<?php echo $key ? $key : ''; ?>\"><br>\n\t\t<span class=\"description\">Enter the list of keywords separated by comma</span>\n\t</div>\n\t<div class=\"form-field\">\n\t\t<label for=\"basic_seo_description\"><?php _e( 'SEO Description', 'glbs' ); ?></label>\n\t\t<textarea class=\"large-text\" name=\"basic_seo_description\" id=\"basic_seo_description\" rows=\"5\"><?php echo $desc ? $desc : ''; ?></textarea><br>\n\t\t<span class=\"description\">Enter meta description for this Term</span>\n\t</div>\n\t<?php\n}", "function render_block_core_term_description($attributes)\n {\n }", "function render_block_core_post_terms($attributes, $content, $block)\n {\n }", "public function edit_taxonomy_fields( $term ) {\n\t\t$template_file = $this->media->plugin->template_path . 'taxonomy-term-transformation-fields.php';\n\t\tif ( file_exists( $template_file ) ) {\n\t\t\tinclude $template_file; // phpcs:ignore\n\t\t}\n\t}", "public function create($args)\n {\n $wpcli_args = buildCLIArgs(\n array(\n 'description',\n 'parent',\n 'slug',\n ),\n $args\n );\n\n array_unshift($wpcli_args, $args['taxonomy'], $args['term'], '--porcelain');\n $term_id = (int) $this->drivers->getDriver()->wpcli('term', 'create', $wpcli_args)['stdout'];\n\n return $this->get($term_id);\n }", "public function createtokendata() {\n $vid = $_POST['vid']; // Vocabulary machine name\n $template_tags = $_POST['template_tags']; // List of tags terms\n foreach ($template_tags as $term_value) {\n if ($terms = taxonomy_term_load_multiple_by_name($term_value, $vid)) {\n $term = reset($terms);\n }\n else {\n $term = Term::create([\n 'name' => $term_value,\n 'vid' => $vid,\n ]);\n $term->save();\n }\n }\n return $term->id();\n }", "public function testAdministerProductAttributes() {\n $this->drupalGet('admin/commerce/product-attributes/add');\n $this->assertSession()->statusCodeEquals(200);\n\n $this->submitForm([\n 'id' => 'colors_id',\n 'label' => 'Color Names',\n 'elementLabel' => 'Choose Color',\n ], 'Save');\n\n $this->assertSession()->pageTextContains('Created the Color Names product attribute.');\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/product-attributes\\/manage\\/colors_id$/');\n $attribute = ProductAttribute::load('colors_id');\n // Check if elementLabel is saved and then diplayed as the default value.\n $this->assertEquals('Choose Color', $attribute->getElementLabel());\n $elementLabel = $this->getSession()->getPage()->findField('elementLabel')->getValue();\n $this->assertEquals('Choose Color', $elementLabel);\n\n $colors = [\n [\n 'attribute' => 'colors_id',\n 'name' => 'Red',\n 'weight' => 1,\n ],\n [\n 'attribute' => 'colors_id',\n 'name' => 'ForestGreen',\n 'weight' => 2,\n ],\n [\n 'attribute' => 'colors_id',\n 'name' => 'Blue',\n 'weight' => 3,\n ],\n ];\n\n foreach ($colors as $values) {\n $this->createEntity('commerce_product_attribute_value', $values);\n }\n\n $this->drupalGet('admin/commerce/product-attributes/add');\n $this->assertSession()->statusCodeEquals(200);\n\n $this->submitForm([\n 'id' => 'sizes_id',\n 'label' => 'Size Names',\n 'elementLabel' => 'Choose Size',\n ], 'Save');\n\n $this->assertSession()->pageTextContains('Created the Size Names product attribute.');\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/product-attributes\\/manage\\/sizes_id$/');\n $attribute = ProductAttribute::load('sizes_id');\n $this->assertEquals('Choose Size', $attribute->getElementLabel());\n $elementLabel = $this->getSession()->getPage()->findField('elementLabel')->getValue();\n $this->assertEquals('Choose Size', $elementLabel);\n\n foreach (range(1, 102) as $i) {\n $values = [\n 'attribute' => 'sizes_id',\n 'name' => $i,\n 'weight' => $i,\n ];\n $this->createEntity('commerce_product_attribute_value', $values);\n }\n\n $this->drupalGet('admin/commerce/product-attributes');\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->pageTextContains('colors_id');\n $this->assertSession()->pageTextContains('Color Names');\n $this->assertSession()->pageTextContains('Choose Color');\n $this->assertSession()->pageTextContains('sizes_id');\n $this->assertSession()->pageTextContains('Size Names');\n $this->assertSession()->pageTextContains('Choose Size');\n // Attribute names are truncated if they exceed 10 characters.\n $this->assertSession()->pageTextContains('Red, ForestGre…, Blue');\n // Only one hundred attribute names can be displayed. A counter (N more\n // values…) displayed for all the rest of the names.\n $this->assertSession()->pageTextContains('1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 (2 more values…)');\n\n $this->drupalGet('admin/commerce/config/product-variation-types/default/edit');\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->pageTextContains('Color Names');\n $this->assertSession()->linkNotExistsExact('Color Names');\n $this->assertSession()->pageTextContains('Size Names');\n $this->assertSession()->linkNotExistsExact('Size Names');\n $this->assertSession()->linkExistsExact('colors_id');\n $this->assertSession()->linkExistsExact('sizes_id');\n\n $this->getSession()->getPage()->clickLink('colors_id');\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/product-attributes\\/manage\\/colors_id$/');\n\n $this->drupalGet('admin/commerce/config/product-variation-types/default/edit');\n $this->assertSession()->statusCodeEquals(200);\n $this->submitForm([\n 'attributes[colors_id]' => 'colors_id',\n 'attributes[sizes_id]' => 'sizes_id',\n ], t('Save'));\n\n $this->drupalGet('admin/commerce/config/product-variation-types/default/edit');\n $this->assertSession()->statusCodeEquals(200);\n // Now 'Color Names' and 'Size Names' should turn into links with\n // 'Choose Color' and 'Choose Size' elementLabel text.\n $this->assertSession()->linkExistsExact('Choose Color');\n $this->assertSession()->linkExistsExact('Choose Size');\n $this->assertSession()->linkExistsExact('colors_id');\n $this->assertSession()->linkExistsExact('sizes_id');\n\n $this->getSession()->getPage()->clickLink('Choose Color');\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/config\\/product-variation-types\\/default\\/edit\\/fields\\/commerce_product_variation\\.default\\.attribute_colors_id$/');\n $this->submitForm([\n 'label' => 'My Color',\n ], t('Save settings'));\n\n $this->assertSession()->addressMatches('/\\/admin\\/commerce\\/config\\/product-variation-types\\/default\\/edit\\/fields$/');\n $this->assertSession()->pageTextContains('My Color', 'The customer facing label is changed on the default variation type attribute field');\n\n $this->drupalGet('admin/commerce/config/product-variation-types/default/edit');\n $this->assertSession()->statusCodeEquals(200);\n // After the 'Choose Color' is changed the link text should also be changed\n // to 'My Color' elementLabel text.\n $this->assertSession()->linkExistsExact('My Color');\n $this->assertSession()->linkExistsExact('Choose Size');\n $this->assertSession()->linkExistsExact('colors_id');\n $this->assertSession()->linkExistsExact('sizes_id');\n }", "public function createWithAttrsOf(string $name) {\r\n return $this->word->createWithAttrsOf($name);\r\n }", "public function run()\n {\n //\n $term[] = array(\n 'name'\t =>\t\t'XSmall',\n 'slug'\t\t =>\t\t'xsmall',\n 'attributes_id'\t=>\t\t'1'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'Small',\n 'slug'\t\t =>\t\t'small',\n 'attributes_id'\t=>\t\t'1'\n );\n $term[] = array(\n 'name'\t =>\t\t'Medium',\n 'slug'\t\t =>\t\t'medium',\n 'attributes_id'\t=>\t\t'1'\n );\n $term[] = array(\n 'name'\t =>\t\t'Large',\n 'slug'\t\t =>\t\t'large',\n 'attributes_id'\t=>\t\t'1'\n );\n $term[] = array(\n 'name'\t =>\t\t'Xlarge',\n 'slug'\t\t =>\t\t'xlarge',\n 'attributes_id'\t=>\t\t'1'\n );\n $term[] = array(\n 'name'\t =>\t\t'XXlarge',\n 'slug'\t\t =>\t\t'xxlarge',\n 'attributes_id'\t=>\t\t'1'\n );\n\n\n $term[] = array(\n 'name'\t =>\t\t'36',\n 'slug'\t\t =>\t\t'36',\n 'attributes_id'\t=>\t\t'2'\n );\n $term[] = array(\n 'name'\t =>\t\t'37',\n 'slug'\t\t =>\t\t'37',\n 'attributes_id'\t=>\t\t'2'\n );\n $term[] = array(\n 'name'\t =>\t\t'38',\n 'slug'\t\t =>\t\t'38',\n 'attributes_id'\t=>\t\t'2'\n );\n $term[] = array(\n 'name'\t =>\t\t'39',\n 'slug'\t\t =>\t\t'39',\n 'attributes_id'\t=>\t\t'2'\n );\n $term[] = array(\n 'name'\t =>\t\t'40',\n 'slug'\t\t =>\t\t'40',\n 'attributes_id'\t=>\t\t'2'\n );\n $term[] = array(\n 'name'\t =>\t\t'41',\n 'slug'\t\t =>\t\t'41',\n 'attributes_id'\t=>\t\t'2'\n );\n $term[] = array(\n 'name'\t =>\t\t'X/S',\n 'slug'\t\t =>\t\t'x/s',\n 'attributes_id'\t=>\t\t'3'\n );\n $term[] = array(\n 'name'\t =>\t\t'S/M',\n 'slug'\t\t =>\t\t's/m',\n 'attributes_id'\t=>\t\t'3'\n );\n $term[] = array(\n 'name'\t =>\t\t'M/L',\n 'slug'\t\t =>\t\t'm/l',\n 'attributes_id'\t=>\t\t'3'\n ); \n $term[] = array(\n 'name'\t =>\t\t'L/XL',\n 'slug'\t\t =>\t\t'l/xl',\n 'attributes_id'\t=>\t\t'3'\n );\n $term[] = array(\n 'name'\t =>\t\t'Bordeaux',\n 'slug'\t\t =>\t\t'bordeaux',\n 'attributes_id'\t=>\t\t'4'\n );\n $term[] = array(\n 'name'\t =>\t\t'Creme',\n 'slug'\t\t =>\t\t'Creme',\n 'attributes_id'\t=>\t\t'4'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'Legergroen',\n 'slug'\t\t =>\t\t'legergroen',\n 'attributes_id'\t=>\t\t'4'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'Marineblauw',\n 'slug'\t\t =>\t\t'marineblauw',\n 'attributes_id'\t=>\t\t'4'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'Taupe',\n 'slug'\t\t =>\t\t'taupe',\n 'attributes_id'\t=>\t\t'4'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'Zwart',\n 'slug'\t\t =>\t\t'zwart',\n 'attributes_id'\t=>\t\t'4'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'antraciet',\n 'slug'\t\t =>\t\t'antraciet',\n 'attributes_id'\t=>\t\t'4'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'Babyblauw',\n 'slug'\t\t =>\t\t'babyblauw',\n 'attributes_id'\t=>\t\t'4'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'Beige',\n 'slug'\t\t =>\t\t'beige',\n 'attributes_id'\t=>\t\t'4'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'Blauw',\n 'slug'\t\t =>\t\t'blauw',\n 'attributes_id'\t=>\t\t'4'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'Bruin',\n 'slug'\t\t =>\t\t'bruin',\n 'attributes_id'\t=>\t\t'4'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'Geel',\n 'slug'\t\t =>\t\t'geel',\n 'attributes_id'\t=>\t\t'4'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'Kobaltblauw',\n 'slug'\t\t =>\t\t'kobaltblauw',\n 'attributes_id'\t=>\t\t'4'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'Koraalrood',\n 'slug'\t\t =>\t\t'koraalrood',\n 'attributes_id'\t=>\t\t'4'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'roze',\n 'slug'\t\t =>\t\t'roze',\n 'attributes_id'\t=>\t\t'4'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'mintgroen',\n 'slug'\t\t =>\t\t'mintgroen',\n 'attributes_id'\t=>\t\t'4'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'Yellow',\n 'slug'\t\t =>\t\t'yellow',\n 'attributes_id'\t=>\t\t'4'\n );\n\n $term[] = array(\n 'name'\t =>\t\t'Wit',\n 'slug'\t\t =>\t\t'wit',\n 'attributes_id'\t=>\t\t'4'\n );\n\n\n $term[] = array(\n 'name'\t =>\t\t'Zalmroze',\n 'slug'\t\t =>\t\t'Zalmroze',\n 'attributes_id'\t=>\t\t'4'\n );\n\n\n foreach($term as $term)\n {\n DB::table('terms')->insert($term);\n }\n }", "public function run()\n {\n $productForm = $this->catalogProductEdit->getFormPageActions();\n $productForm->addNewAttribute();\n $this->catalogProductEdit->getAddAttributeModal()->createNewAttribute();\n }", "function qode_tours_get_tour_attributes() {\n\t\t$tour_attributes = array();\n\t\t\n\t\t$terms = get_terms(array(\n\t\t\t'taxonomy' => 'tour-attribute',\n\t\t\t'hide_empty' => false,\n\t\t\t)\n\t\t);\n\n\t\tforeach($terms as $term) {\n\t\t\t$tour_attributes[$term->slug] = $term->name;\n\t\t}\n\n\t\treturn $tour_attributes;\n\t}", "public function create()\n {\n $url = route('dashboard.attributes.store');\n $html = view('partials.form.form-attribute', ['url' => $url, 'idForm' => 'form-create'])->render();\n\n return response()->json(['html' => $html], 200);\n }", "function add_term_meta( $term_id, $meta_key, $meta_value, $unique = false ) {\r\n\r\n if ( current_theme_supports( 'extended-taxonomies' ) ) {\r\n return add_post_meta( get_post_for_extended_term( $term_id )->ID, $meta_key, $meta_value, $unique );\r\n }\r\n\r\n return add_metadata( 'taxonomy', $term_id, $meta_key, $meta_value, $unique );\r\n }", "function bdpp_save_taxonomy_custom_meta( $term_id, $tt_id = '', $taxonomy = '' ) {\n\n\t\t$allowed_taxonomy = bdpp_get_option( 'taxonomy', array() );\n\n\t\tif( isset( $allowed_taxonomy[ $taxonomy ] ) ) {\n\n\t\t\t$prefix\t\t\t= BDPP_META_PREFIX;\n\t\t\t$term_img_id\t= !empty( $_POST[$prefix.'term_img_id'] )\t? bdpp_clean_number( $_POST[$prefix.'term_img_id'] )\t\t\t: '';\n\t\t\t$term_link\t\t= !empty( $_POST[$prefix.'term_link'] )\t\t? bdpp_clean_url( $_POST[$prefix.'term_link'] )\t\t\t\t\t: '';\n\t\t\t$term_icon\t\t= !empty( $_POST[$prefix.'term_icon'] )\t\t? bdpp_sanitize_html_classes( $_POST[$prefix.'term_icon'] )\t\t: '';\n\t\t\t$term_bg_clr\t= !empty( $_POST[$prefix.'term_bg_clr'] )\t? sanitize_hex_color( trim( $_POST[$prefix.'term_bg_clr'] ) )\t: '';\n\n\t\t\tupdate_term_meta( $term_id, $prefix.'term_img_id', $term_img_id );\n\t\t\tupdate_term_meta( $term_id, $prefix.'term_link', $term_link );\n\t\t\tupdate_term_meta( $term_id, $prefix.'term_icon', $term_icon );\n\t\t\tupdate_term_meta( $term_id, $prefix.'term_bg_clr', $term_bg_clr );\n\t\t}\n\t}", "function acf_encode_term($term)\n{\n}", "function custom_add_artwork_attr( $attributes ){\n\t\t\t$attributes['class'] .= ' equalize col-xs-12 col-sm-6 col-md-4';\n\t\t\t$attributes['itemtype'] = 'http://schema.org/ArtworkArticle';\n\t\t\t// return the attributes\n\t\t\treturn $attributes;\n\t\t}", "public function addProductAttr($post)\r\n\t{\r\n\t\t$this->db->insert('tbl_product_attr', $post);\r\n\t\t$this->result = $this->db->insert_id() ; \r\n\t\treturn $this->result ;\r\n\t}", "public function createAttributes($pid,&$item,$attmap,$isnew)\n\t{\n\t\t/**\n\t\t * get all store ids\n\t\t */\n\t\t$this->_extra_attrs=array();\n\t\t/* now is the interesring part */\n\t\t/* iterate on attribute backend type index */\n\t\tforeach($attmap as $tp=>$a)\n\t\t{\n\t\t\t/* for static types, do not insert into attribute tables */\n\t\t\tif($tp==\"static\")\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//table name for backend type data\n\t\t\t$cpet=$this->tablename(\"catalog_product_entity_$tp\");\n\t\t\t//data table for inserts\n\t\t\t$data=array();\n\t\t\t//inserts to perform on backend type eav\n\t\t\t$inserts=array();\n\t\t\t//deletes to perform on backend type eav\n\t\t\t$deletes=array();\n\n\t\t\t//use reflection to find special handlers\n\t\t\t$typehandler=\"handle\".ucfirst($tp).\"Attribute\";\n\t\t\t//iterate on all attribute descriptions for the given backend type\n\t\t\tforeach($a[\"data\"] as $attrdesc)\n\t\t\t{\n\t\t\t\t//get attribute id\n\t\t\t\t$attid=$attrdesc[\"attribute_id\"];\n\t\t\t\t//get attribute value in the item to insert based on code\n\t\t\t\t$atthandler=\"handle\".ucfirst($attrdesc[\"attribute_code\"]).\"Attribute\";\n\t\t\t\t$attrcode=$attrdesc[\"attribute_code\"];\n\t\t\t\t//if the attribute code is no more in item (plugins may have come into the way), continue\n\t\t\t\tif(!in_array($attrcode,array_keys($item)))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t//get the item value\n\t\t\t\t$ivalue=$item[$attrcode];\n\t\t\t\t//get item store id for the current attribute\n\t\t\t\t$store_ids=$this->getItemStoreIds($item,$attrdesc[\"is_global\"]);\n\n\n\t\t\t\t//do not handle empty generic int values in create mode\n\t\t\t\tif($ivalue==\"\" && $this->mode!=\"update\" && $tp==\"int\")\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t//for all store ids\n\t\t\t\tforeach($store_ids as $store_id)\n\t\t\t\t{\n\n\t\t\t\t\t//base output value to be inserted = base source value\n\t\t\t\t\t$ovalue=$ivalue;\n\t\t\t\t\t//check for attribute handlers for current attribute\n\t\t\t\t\tforeach($this->_attributehandlers as $match=>$ah)\n\t\t\t\t\t{\n\t\t\t\t\t\t$matchinfo=explode(\":\",$match);\n\t\t\t\t\t\t$mtype=$matchinfo[0];\n\t\t\t\t\t\t$mtest=$matchinfo[1];\n\t\t\t\t\t\tunset($matchinfo);\n\t\t\t\t\t\tunset($hvalue);\n\t\t\t\t\t\tif(preg_match(\"/$mtest/\",$attrdesc[$mtype]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if there is a specific handler for attribute, use it\n\t\t\t\t\t\t\tif(method_exists($ah,$atthandler))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hvalue=$ah->$atthandler($pid,$item,$store_id,$attrcode,$attrdesc,$ivalue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t//use generic type attribute\n\t\t\t\t\t\t\tif(method_exists($ah,$typehandler))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hvalue=$ah->$typehandler($pid,$item,$store_id,$attrcode,$attrdesc,$ivalue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//if handlers returned a value that is not \"__MAGMI_UNHANDLED__\" , we have our output value\n\t\t\t\t\t\t\tif(isset($hvalue) && $hvalue!=\"__MAGMI_UNHANDLED__\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ovalue=$hvalue;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if __MAGMI_UNHANDLED__ ,don't insert anything\n\t\t\t\t\tif($ovalue==\"__MAGMI_UNHANDLED__\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$ovalue=false;\n\t\t\t\t\t}\n\t\t\t\t\t//if handled value is a \"DELETE\"\n\t\t\t\t\tif($ovalue==\"__MAGMI_DELETE__\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$deletes[]=$attid;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t//if we have something to do with this value\n\t\t\t\t\tif($ovalue!==false)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$data[]=$this->prod_etype;\n\t\t\t\t\t\t$data[]=$attid;\n\t\t\t\t\t\t$data[]=$store_id;\n\t\t\t\t\t\t$data[]=$pid;\n\t\t\t\t\t\t$data[]=$ovalue;\n\t\t\t\t\t\t$insstr=\"(?,?,?,?,?)\";\n\t\t\t\t\t\t$inserts[]=$insstr;\n\t\t\t\t\t}\n\n\t\t\t\t\t//if one of the store in the list is admin\n\t\t\t\t\tif($store_id==0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sids=$store_ids;\n\t\t\t\t\t\t//remove all values bound to the other stores for this attribute,so that they default to \"use admin value\"\n\t\t\t\t\t\tarray_shift($sids);\n\t\t\t\t\t\tif(count($sids)>0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sidlist=implode(\",\",$sids);\n\t\t\t\t\t\t\t$ddata=array($this->prod_etype,$attid,$pid);\n\t\t\t\t\t\t\t$sql=\"DELETE FROM $cpet WHERE entity_type_id=? AND attribute_id=? AND store_id IN ($sidlist) AND entity_id=?\";\n\t\t\t\t\t\t\t$this->delete($sql,$ddata);\n\t\t\t\t\t\t\tunset($ddata);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($sids);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\n\t\t\tif(!empty($inserts))\n\t\t\t{\n\t\t\t\t//now perform insert for all values of the the current backend type in one\n\t\t\t\t//single insert\n\t\t\t\t$sql=\"INSERT INTO $cpet\n\t\t\t(`entity_type_id`, `attribute_id`, `store_id`, `entity_id`, `value`)\n\t\t\tVALUES \";\n\t\t\t\t$sql.=implode(\",\",$inserts);\n\t\t\t\t//this one taken from mysql log analysis of magento import\n\t\t\t\t//smart one :)\n\t\t\t\t$sql.=\" ON DUPLICATE KEY UPDATE `value`=VALUES(`value`)\";\n\t\t\t\t$this->insert($sql,$data);\n\t\t\t}\n\n\t\t\tif(!empty($deletes))\n\t\t\t{\n\t\t\t\t$sidlist=implode(\",\",$store_ids);\n\t\t\t\t$attidlist=implode(\",\",$deletes);\n\t\t\t\t$sql=\"DELETE FROM $cpet WHERE entity_type_id=? AND attribute_id IN ($attidlist) AND store_id IN ($sidlist) AND entity_id=?\";\n\t\t\t\t$this->delete($sql,array($this->prod_etype,$pid));\n\t\t\t}\n\n\t\t\tif(empty($deletes) && empty($inserts) && $isnew)\n\t\t\t{\n\t\t\t\tif(!$this->_same)\n\t\t\t\t{\n\t\t\t\t\t$this->log(\"No $tp Attributes created for sku \".$item[\"sku\"],\"warning\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($store_ids);\n\t\t\tunset($data);\n\t\t\tunset($inserts);\n\t\t\tunset($deletes);\n\t\t}\n\t\treturn $this->_extra_attrs;\n\t}", "function save_taxonomy_custom_fields( $term_id ) {\n if ( isset( $_POST['term_meta'] ) ) {\n $t_id = $term_id;\n $term_meta = get_option( \"taxonomy_term_$t_id\" );\n $cat_keys = array_keys( $_POST['term_meta'] );\n foreach ( $cat_keys as $key ){\n if ( isset( $_POST['term_meta'][$key] ) ){\n $term_meta[$key] = $_POST['term_meta'][$key];\n }\n }\n //save the option array\n update_option( \"taxonomy_term_$t_id\", $term_meta );\n }\n}", "function omfg_mobile_default_add_theme_taxonomy() {\n\n\twp_insert_term(\n \t\t'Default Theme', \t\t\t// the term\n \t\t'omfg_mobile_pro_themes', \t// the taxonomy\n \t\tarray(\n \t\t'description' => 'Default Theme for the OMFG Mobile Landing Page Plugin.',\n \t\t'slug' => 'omfg-mobile-default-theme'\n \t\t)\n\t);\n\n}", "function external_url_taxonomy_add_new_meta_field() {\n ?>\n <div class=\"form-field\">\n <label for=\"term_meta[custom_term_meta]\"><?php _e( 'External URL:', 'external_url' ); ?></label>\n <input type=\"text\" name=\"term_meta[custom_term_meta]\" id=\"term_meta[custom_term_meta]\" value=\"\">\n <p class=\"description\"><?php _e( 'Enter a value for this field','external_url' ); ?></p>\n </div>\n<?php\n}", "public function create(array $attributes): Model {\n $product = $this->model->create($attributes);\n\t\t\n $this->updateOrCreateTranslations($product, $attributes['product_translations']);\n $product->productTags()->attach($attributes['product_tag_ids']);\n\t\t\n return $this->find($product->id);\n }", "public function actionCreate()\n {\n $product_id = Yii::$app->request->get('product_id');\n $product = Product::findOne($product_id);\n if (!$product) {\n throw new HttpException(400);\n }\n /** @var \\common\\models\\AttributeValue $model */\n $model = new $this->model(['product_id' => $product_id]);\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['product/update', 'id' => $product_id]);\n } else {\n return $this->render($this->create_view, [\n 'model' => $model,\n ]);\n }\n }", "function omfg_mobile_groove_add_theme_taxonomy() {\n\n\twp_insert_term(\n \t\t'Groove Theme', \t\t\t\t// the term\n \t\t'omfg_mobile_pro_themes', \t// the taxonomy\n \t\tarray(\n \t\t'description' => 'Groove Theme for the OMFG Mobile Landing Page Plugin.',\n \t\t'slug' => 'omfg-mobile-groove-theme'\n \t\t)\n\t);\n\n}", "public function actionCreate()\n\t{\n\t\t$this->allowUser(SUPERADMINISTRATOR);\n\t\t$model=new Term;\n\t\t$languages = Language::model()->findAllByAttributes(array('active'=>1));\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif (isset($_POST['Term'])) {\n\t\t\t$attributes=$_POST['Term'];\n\t\t\tif ($attributes['parent_id']==\"\") $attributes['parent_id'] = null;\n\t\t\t$model->attributes = $attributes;\n\t\t\tif ($model->save()) {\n\t\t\t\tforeach($languages as $language) {\n \t\t$description = new TermDescription;\n \t\t$description->attributes = array(\n \t\t'term_id' => $model->primaryKey,\n \t\t'language_id'=>$language['id'],\n \t\t'title'=>$model->name,\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\t$description->save();\n \t} \n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t\t}\n\t\t}\n\t\t\n\t\t$_SESSION['KCFINDER'] = array();\n\t\t$_SESSION['KCFINDER']['disabled'] = false;\n\t\t$_SESSION['KCFINDER']['uploadURL'] = \"/uploads/terms\"; \n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "function wc_show_attribute_links() {\n\tglobal $post;\n\t$attribute_names = array( 'pa_serie');\n\t\t\n\tforeach ( $attribute_names as $attribute_name ) {\n\t\t$taxonomy = get_taxonomy( $attribute_name );\n\t\t\n\t\tif ( $taxonomy && ! is_wp_error( $taxonomy ) ) {\n\t\t\t$terms = wp_get_post_terms( $post->ID, $attribute_name );\n\t\t\t$terms_array = array();\n\t\t\n\t if ( ! empty( $terms ) ) {\n\t\t foreach ( $terms as $term ) {\n\t\t\t $archive_link = get_term_link( $term->slug, $attribute_name );\n\t\t\t $full_line = '<a href=\"' . $archive_link . '\">'. $term->name . '</a>';\n\t\t\t array_push( $terms_array, $full_line );\n\t\t }\n\t\t echo $taxonomy->labels->name . ' ' . implode( $terms_array, ', ' );\n\t }\n \t}\n }\n}", "function hometown_woocommerce_product_custom_fields_save($post_id)\n{\n $woocommerce_custom_product_text_field = $_POST['_custom_product'];\n update_post_meta($post_id, '_custom_product', esc_attr($woocommerce_custom_product_text_field));\n}", "private function saveProductAttributeValues($product, $variant) // ..\n {\n foreach (array_values($variant) as $attributeOptionID) {\n $attributeOption = AttributeOption::find($attributeOptionID);\n\n $attributeValueParams = [\n 'product_id' => $product->id,\n 'attribute_id' => $attributeOption->attribute_id,\n 'text_value' => $attributeOption->name,\n ];\n\n ProductAttributeValue::create($attributeValueParams);\n }\n }", "public function create(Request $request)\n {\n $this->authorize(\"term.create\");\n\n $vocabulary = Vocabulary::where('system_name', $request->vocabulary)->firstOrFail();\n\n $attributes = Attribute::all();\n\n return view('admin.taxonomy.terms.create', compact('vocabulary', 'attributes'));\n }", "function AddAttr() {\n $db = Core::GetDB();\n\n $title = urldecode(Core::GetFromPOST('title'));\n\n $res = $db->Query(\"SELECT data_xml_item_id FROM data_xml_items WHERE title = ? LIMIT 1\", array(\n array(1, $title, IDBController::PARAM_STR)\n ));\n $id = $res->FetchRow();\n $id = $id[0];\n\n $attrs = array(urldecode(Core::GetFromPOST('attr')));\n\n $attrs = fix_attrs($attrs);\n\n foreach ($attrs AS $attr) {\n $attr = explode(':', $attr);\n\n if (count($attr) == 3) {\n if (empty($attr) === false) {\n $db->Query(\"DELETE FROM data_xml_attributes WHERE data_xml_item_id = $id AND attr_name='{$attr[0]}' LIMIT 1\");\n $db->Query(\"INSERT INTO data_xml_attributes (data_xml_item_id, attr_name, attr_value, attr_type) VALUES ($id, '{$attr[0]}', '{$attr[1]}', '{$attr[2]}')\");\n }\n }\n }\n}", "function save_custom_field( $post_id ) {\r\n $user = wp_get_current_user();\r\n $_warehouse_flag = isset( $_POST['_warehouse_flag'] ) ? $_POST['_warehouse_flag'] : '';\r\n $product = wc_get_product( $post_id );\r\n \r\n if($_warehouse_flag==1){\r\n\t $product->update_meta_data( '_warehouse_flag', 'A' );\r\n }\r\n if($_warehouse_flag==2){\r\n\t $product->update_meta_data( '_warehouse_flag', 'V' );\r\n }\r\n $_enable_warehouse = isset( $_POST['_enable_warehouse'] ) ? $_POST['_enable_warehouse'] : '0';\r\n \r\n \r\n $product->update_meta_data( '_enable_warehouse', $_enable_warehouse );\r\n if($_enable_warehouse==1){\r\n\t $categories = [ 'Warehouse Product'];\r\n\t wp_set_object_terms( $post_id, $categories, 'warehouses' );\r\n }\r\n else{\r\n\t $categories = [ 'Warehouse Product'];\r\n\t wp_set_object_terms( $post_id, null, 'warehouses' );\r\n }\r\n \r\n $product->save();\r\n \r\n \r\n}", "public function create(array $data) : OrderProductAttribute;", "function add_post_meta($term_id, $taxonomy, $meta_key, $meta_value, $unique = false) {\n\n return add_metadata('post', $post_id, $meta_key, $meta_value, $unique);\n}", "function save_taxonomy_custom_meta( $term_id ) {\nif ( isset( $_POST['term_meta'] ) ) {\n $t_id = $term_id;\n $term_meta = get_option( \"taxonomy_$t_id\" );\n $cat_keys = array_keys( $_POST['term_meta'] );\n foreach ( $cat_keys as $key ) {\n if ( isset ( $_POST['term_meta'][$key] ) ) {\n $term_meta[$key] = $_POST['term_meta'][$key];\n }\n }\n // Save the option array.\n update_option( \"taxonomy_$t_id\", $term_meta );\n}\n}", "function create_custom_field() {\n $args = array(\n 'id' => 'custom_field_brand',\n 'label' => __( 'Detalhes da Marca'),\n 'class' => 'brand-custom-field',\n 'desc_tip' => true,\n 'description' => __( 'Enter the brand details.'),\n );\n woocommerce_wp_textarea_input( $args );\n}", "public static function get_product_attributes($arg = array())\n {\n $default = array(\n 'children' => false,\n 'slug' => false,\n 'id' => false,\n 'terms_query' => array(\n 'hide_empty' => false\n )\n );\n $args = wp_parse_args($arg, $default);\n\n $product_attributes = array();\n $attribute_taxonomies = wc_get_attribute_taxonomies();\n\n foreach ($attribute_taxonomies as $attribute) {\n $array = array(\n 'id' => intval($attribute->attribute_id),\n 'name' => $attribute->attribute_label,\n 'slug' => wc_attribute_taxonomy_name($attribute->attribute_name),\n 'type' => $attribute->attribute_type,\n 'order_by' => $attribute->attribute_orderby,\n 'has_archives' => (bool)$attribute->attribute_public,\n );\n\n if ($args['children']) {\n // Get Terms\n $terms_default_query = array(\n 'taxonomy' => wc_attribute_taxonomy_name($attribute->attribute_name)\n );\n $terms = get_terms(wp_parse_args($args['terms_query'], $terms_default_query));\n $array['children'] = WooCommerce_Helper::object_to_array($terms);\n }\n\n // Push To List\n $product_attributes[wc_sanitize_taxonomy_name($attribute->attribute_name)] = $array;\n }\n\n // Get By Slug\n if ($args['slug'] != false) {\n if (isset($product_attributes[$args['slug']])) {\n return $product_attributes[$args['slug']];\n } else {\n return array();\n }\n }\n\n // Get By ID\n if ($args['id'] != false) {\n foreach ($product_attributes as $attribute) {\n if ($attribute['id'] == $args['id']) {\n return $attribute;\n }\n }\n\n return array();\n }\n\n return $product_attributes;\n }", "public function create()\n {\n $this->setPageTitle('Attributes', 'Créer un attribut');\n return view('admin.attributes.create');\n }", "static function GetFormAttribute($a, $sub_text)\r\n\t{\r\n\t\t$frm = new Form('frmCreateAttrib');\r\n\t\t$frm->AddInput(new FormInput('Name', 'text', 'name', @$a['atr_name']));\r\n\t\t$frm->AddInput(new FormInput('Type', 'select', 'type',\r\n\t\t\tFormOption::FromArray(ModAttribute::GetTypes(), @$a['atr_type'])));\r\n\t\t$frm->AddInput(new FormInput(null, 'submit', null, $sub_text));\r\n\t\treturn $frm;\r\n\t}", "function generateVariationsFromAttributes(ProductAttributeType $attributetype, array $values){\r\n\r\n\t\t//TODO: introduce transactions here, in case objects get half made etc\r\n\r\n\t\t//if product has variation attribute types\r\n\t\tif(is_array($values)){\r\n\t\t\t//TODO: get values dataobject set\r\n\t\t\t$avalues = $attributetype->convertArrayToValues($values);\r\n\t\t\t$existingvariations = $this->owner->Variations();\r\n\t\t\tif($existingvariations->exists()){\r\n\t\t\t\t//delete old variation, and create new ones - to prevent modification of exising variations\r\n\t\t\t\tforeach($existingvariations as $oldvariation){\r\n\t\t\t\t\t$oldvalues = $oldvariation->AttributeValues();\r\n\t\t\t\t\tif($oldvalues) {\r\n\t\t\t\t\t\tforeach($avalues as $value){\r\n\t\t\t\t\t\t\t$newvariation = $oldvariation->duplicate();\r\n\t\t\t\t\t\t\t$newvariation->InternalItemID = $this->owner->InternalItemID.'-'.$newvariation->ID;\r\n\t\t\t\t\t\t\t$newvariation->AttributeValues()->addMany($oldvalues);\r\n\t\t\t\t\t\t\t$newvariation->AttributeValues()->add($value);\r\n\t\t\t\t\t\t\t$newvariation->write();\r\n\t\t\t\t\t\t\t$existingvariations->add($newvariation);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$existingvariations->remove($oldvariation);\r\n\t\t\t\t\t$oldvariation->AttributeValues()->removeAll();\r\n\t\t\t\t\t$oldvariation->delete();\r\n\t\t\t\t\t$oldvariation->destroy();\r\n\t\t\t\t\t//TODO: check that old variations actually stick around, as they will be needed for past orders etc\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif($avalues) {\r\n\t\t\t\t\tforeach($avalues as $value){\r\n\t\t\t\t\t\t$variation = new ProductVariation();\r\n\t\t\t\t\t\t$variation->ProductID = $this->owner->ID;\r\n\t\t\t\t\t\t$variation->Price = $this->owner->Price;\r\n\t\t\t\t\t\t$variation->write();\r\n\t\t\t\t\t\t$variation->InternalItemID = $this->owner->InternalItemID.'-'.$variation->ID;\r\n\t\t\t\t\t\t$variation->AttributeValues()->add($value); //TODO: find or create actual value\r\n\t\t\t\t\t\t$variation->write();\r\n\t\t\t\t\t\t$existingvariations->add($variation);\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}", "protected function getProductAttrCodesUseForTermGeneration()\n {\n if (count($this->_productAttrCodesUseForTermGeneration) < 1) {\n $productAttributeCodes = $this->_helper->getAutocompleteSetting('termgeneration/product_attribute_codes');\n $productAttributeCodes = trim($productAttributeCodes, ',');\n $this->_productAttrCodesUseForTermGeneration = explode(',', $productAttributeCodes);\n }\n return $this->_productAttrCodesUseForTermGeneration;\n }", "public function createSupplier($attributes);", "public function taxonomy_term_create($vocabulary_name, $terms, $update_existing = TRUE) {\n $vocabulary = taxonomy_vocabulary_machine_name_load($vocabulary_name);\n $vid = $vocabulary->vid;\n foreach ($terms as $term) {\n $term = (object)$term;\n // set 0 as parent by default.\n $parent = isset($term->parent) ? $term->parent : array(0);\n $result = reset(taxonomy_get_term_by_name($term->name, $vocabulary_name));\n if ($result && $update_existing) {\n $this->log(TRUE, \"$term->name already exists. Will be upated. \");\n $term->tid = $result->tid;\n }\n $term->vid = $vocabulary->vid;\n taxonomy_term_save($term);\n $this->log(TRUE, \"try to save $term->name in $vocabulary_name\");\n }\n }", "public function Create()\n {\n return view('admin.attribute.create-attribute');\n }", "public function create()\n {\n return view('monkcommerce::monkcommerce-dashboard.admin.products.attributes.create');\n }", "public function createAttributes($pid,&$item,$attmap,$isnew)\n\t{\n\t\t/**\n\t\t * get all store ids\n\t\t */\n\t\t$this->_extra_attrs=array();\n\t\t/* now is the interesring part */\n\t\t/* iterate on attribute backend type index */\n\t\tforeach($attmap as $tp=>$a)\n\t\t{\n\t\t\t//$this->log(\"createAttributes \".print_r($attmap, true), \"debug\");\n\t\t\n\t\t\t/* for static types, do not insert into attribute tables */\n\t\t\tif($tp==\"static\")\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//table name for backend type data\n\t\t\t$cpet=$this->tablename(\"catalog_category_entity_$tp\");\n\t\t\t//data table for inserts\n\t\t\t$data=array();\n\t\t\t//inserts to perform on backend type eav\n\t\t\t$inserts=array();\n\t\t\t//deletes to perform on backend type eav\n\t\t\t$deletes=array();\n\n\t\t\t//use reflection to find special handlers\n\t\t\t$typehandler=\"handle\".ucfirst($tp).\"Attribute\";\n\t\t\t//iterate on all attribute descriptions for the given backend type\n\t\t\tforeach($a[\"data\"] as $attrdesc)\n\t\t\t{\n\t\t\t\t//get attribute id\n\t\t\t\t$attid=$attrdesc[\"attribute_id\"];\n\t\t\t\t//get attribute value in the item to insert based on code\n\t\t\t\t$atthandler=\"handle\".ucfirst($attrdesc[\"attribute_code\"]).\"Attribute\";\n\t\t\t\t$attrcode=$attrdesc[\"attribute_code\"];\n\t\t\t\t//if the attribute code is no more in item (plugins may have come into the way), continue\n\t\t\t\tif(!in_array($attrcode,array_keys($item)))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t//get the item value\n\t\t\t\t$ivalue=$item[$attrcode];\n\t\t\t\t//get item store id for the current attribute\n\t\t\t\t$store_ids=$this->getItemStoreIds($item,$attrdesc[\"is_global\"]);\n\n\n\t\t\t\t//do not handle empty generic int values in create mode\n\t\t\t\tif($ivalue==\"\" && $this->mode!=\"update\" && $tp==\"int\")\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t//for all store ids\n\t\t\t\tforeach($store_ids as $store_id)\n\t\t\t\t{\n\n\t\t\t\t\t//base output value to be inserted = base source value\n\t\t\t\t\t$ovalue=$ivalue;\n\t\t\t\t\t//check for attribute handlers for current attribute\n\t\t\t\t\tforeach($this->_attributehandlers as $match=>$ah)\n\t\t\t\t\t{\n\t\t\t\t\t\t$matchinfo=explode(\":\",$match);\n\t\t\t\t\t\t$mtype=$matchinfo[0];\n\t\t\t\t\t\t$mtest=$matchinfo[1];\n\t\t\t\t\t\tunset($matchinfo);\n\t\t\t\t\t\tunset($hvalue);\n\t\t\t\t\t\tif(preg_match(\"/$mtest/\",$attrdesc[$mtype]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//if there is a specific handler for attribute, use it\n\t\t\t\t\t\t\tif(method_exists($ah,$atthandler))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hvalue=$ah->$atthandler($pid,$item,$store_id,$attrcode,$attrdesc,$ivalue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t//use generic type attribute\n\t\t\t\t\t\t\tif(method_exists($ah,$typehandler))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$hvalue=$ah->$typehandler($pid,$item,$store_id,$attrcode,$attrdesc,$ivalue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//if handlers returned a value that is not \"__MAGMI_UNHANDLED__\" , we have our output value\n\t\t\t\t\t\t\tif(isset($hvalue) && $hvalue!=\"__MAGMI_UNHANDLED__\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ovalue=$hvalue;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//if __MAGMI_UNHANDLED__ ,don't insert anything\n\t\t\t\t\tif($ovalue==\"__MAGMI_UNHANDLED__\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$ovalue=false;\n\t\t\t\t\t}\n\t\t\t\t\t//if handled value is a \"DELETE\"\n\t\t\t\t\tif($ovalue==\"__MAGMI_DELETE__\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$deletes[]=$attid;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t//if we have something to do with this value\n\t\t\t\t\tif($ovalue!==false)\n\t\t\t\t\t{\n\n\t\t\t\t\t\t$data[]=$this->cat_etype;\n\t\t\t\t\t\t$data[]=$attid;\n\t\t\t\t\t\t$data[]=$store_id;\n\t\t\t\t\t\t$data[]=$pid;\n\t\t\t\t\t\t$data[]=$ovalue;\n\t\t\t\t\t\t$insstr=\"(?,?,?,?,?)\";\n\t\t\t\t\t\t$inserts[]=$insstr;\n\t\t\t\t\t}\n\n\t\t\t\t\t//if one of the store in the list is admin\n\t\t\t\t\tif($store_id==0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$sids=$store_ids;\n\t\t\t\t\t\t//remove all values bound to the other stores for this attribute,so that they default to \"use admin value\"\n\t\t\t\t\t\tarray_pop($sids);\n\t\t\t\t\t\tif(count($sids)>0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$sidlist=implode(\",\",$sids);\n\t\t\t\t\t\t\t$ddata=array($this->cat_etype,$attid,$pid);\n\t\t\t\t\t\t\t$sql=\"DELETE FROM $cpet WHERE entity_type_id=? AND attribute_id=? AND store_id IN ($sidlist) AND entity_id=?\";\n\t\t\t\t\t\t\t$this->delete($sql,$ddata);\n\t\t\t\t\t\t\tunset($ddata);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($sids);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\n\t\t\tif(!empty($inserts))\n\t\t\t{\n\t\t\t\t//now perform insert for all values of the the current backend type in one\n\t\t\t\t//single insert\n if($pid == 484){\n $i =0;\n }\n \n\t\t\t\t$sql=\"INSERT INTO $cpet\n\t\t\t(`entity_type_id`, `attribute_id`, `store_id`, `entity_id`, `value`)\n\t\t\tVALUES \";\n\t\t\t\t$sql.=implode(\",\",$inserts);\n\t\t\t\t//this one taken from mysql log analysis of magento import\n\t\t\t\t//smart one :)\n\t\t\t\t$sql.=\" ON DUPLICATE KEY UPDATE `value`=VALUES(`value`)\";\n\t\t\t\t$this->insert($sql,$data);\n\t\t\t}\n\n\t\t\tif(!empty($deletes))\n\t\t\t{\n\t\t\t\t$sidlist=implode(\",\",$store_ids);\n\t\t\t\t$attidlist=implode(\",\",$deletes);\n\t\t\t\t$sql=\"DELETE FROM $cpet WHERE entity_type_id=? AND attribute_id IN ($attidlist) AND store_id IN ($sidlist) AND entity_id=?\";\n\t\t\t\t$this->delete($sql,array($this->cat_etype,$pid));\n\t\t\t}\n\n\t\t\tif(empty($deletes) && empty($inserts) && $isnew)\n\t\t\t{\n\t\t\t\tif(!$this->_same)\n\t\t\t\t{\n\t\t\t\t\t$this->log(\"No $tp Attributes created for category \".$item[\"category_id\"],\"warning\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($store_ids);\n\t\t\tunset($data);\n\t\t\tunset($inserts);\n\t\t\tunset($deletes);\n\t\t}\n\t\treturn $this->_extra_attrs;\n\t}", "function check_for_product_attribute( $attribute ) {\n\n\tglobal $wpdb;\n\n\t$taxonomy_table_name = $wpdb->prefix . \"term_taxonomy\";\n\n\t$taxonomy_sql = \"SELECT * FROM \" . $taxonomy_table_name . \" WHERE taxonomy = 'pa_$attribute'\";\n\t$taxonomy_table_rows = $wpdb->get_results($taxonomy_sql, ARRAY_A);\n\n\tif ( $taxonomy_table_rows ) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\n}", "function acf_get_term($term_id, $taxonomy = '')\n{\n}", "function create_post_type_gon_products_premium() {\n register_post_type( 'gon_products_premium',\n array(\n 'labels' => array(\n 'name' => __( 'Products' ),\n 'singular_name' => __( 'Product' )\n ),\n 'public' => true,\n 'has_archive' => true,\n\t 'menu_position' => 10,\n\t 'capability_type' => 'post',\n\t 'supports' => array('title', 'editor','page-attributes','thumbnail'),\n\t 'rewrite' => array( 'slug' => 'products' )\n )\n );\n \n \t//add product-type tax\n \n\tregister_taxonomy(\n\t\t'featured_product_type',\n\t\t'gon_products_premium',\n\t\tarray(\n\t\t\t'label' => __( 'Product Categories' ),\n\t\t\t'rewrite' => array( 'slug' => 'product-type' ),\n\t\t\t'hierarchical' => true,\n\t\t)\n\t);\n}", "function filter_product_category_multiple_attributes( $query ) {\n if ($query->is_main_query()) {\n return;\n }\n // // Filter by multiple attributes and terms.\n foreach ( wc_get_attribute_taxonomy_names() as $attribute ) {\n if ( isset($_GET[$attribute]) ) {\n \t\t$array = array(\n \t\t\t'relation' \t => 'AND'\n \t\t);\n \t\tforeach ( wc_get_attribute_taxonomy_names() as $attribute ) {\n \t\t\tif ( isset($_GET[$attribute]) ) {\n \t\t\t\t$array[] = array(\n \t\t\t\t\t'taxonomy' => $attribute,\n \t\t\t\t\t'field' => 'term_id',\n \t\t\t\t\t'terms' => explode(',', $_GET[$attribute]),\n \t\t\t\t\t'operator' => 'IN'\n \t\t\t\t);\n \t\t\t}\n \t\t}\n $tax_query = $query->get( 'tax_query' );\n $tax_query[] = $array;\n \t\t$query->set( 'tax_query', $tax_query );\n \t\tbreak;\n }\n }\n return $query;\n}", "function glbs_save_extra_tax_fileds( $term_id ) {\n\tif ( ! isset( $_POST['glbs_nonce_tax'] ) || ! wp_verify_nonce( $_POST['glbs_nonce_tax'], '_glbs_nonce_tax' ) ) {\n\t\treturn;\n\t}\n\t\n\tif ( isset( $_POST['basic_seo_title'] ) ) {\n\t\tupdate_term_meta( $term_id, 'basic_seo_title', esc_attr( $_POST['basic_seo_title'] ) );\n\t}\n\tif ( isset( $_POST['basic_seo_keywords'] ) ) {\n\t\tupdate_term_meta( $term_id, 'basic_seo_keywords', esc_attr( $_POST['basic_seo_keywords'] ) );\n\t}\n\tif ( isset( $_POST['basic_seo_description'] ) ) {\n\t\tupdate_term_meta( $term_id, 'basic_seo_description', esc_attr( $_POST['basic_seo_description'] ) );\n\t}\n}", "public function create_taxonomies() {\n \n }", "public function addTerms(\\obiba\\mica\\TaxonomyEntityDto $value) {\n return $this->_add(2, $value);\n }", "function bdpp_edit_taxonomy_field($term){\n\t\tinclude_once( BDPP_DIR . '/includes/admin/taxonomy/edit-form.php' );\n\t}", "public function CreateAttributeOption($attribute_code,$option_value){\n\n\n $options = $this->curlRequest(\"/rest/V1/products/attributes/\".$attribute_code.\"/options\",0);\n\n $insert = true;\n foreach($options as $option){\n if($option['label'] == $option_value){\n $insert = false;\n break;\n }\n }\n if($insert){\n $label = array (\n array(\n \"store_id\" => 1,\n \"label\" => $option_value\n )\n );\n\n $data['option'] = array(\n \"label\" => $option_value,\n \"value\" => $option_value,\n \"store_labels\" => $label,\n \"sort_order\" => \"\",\n \"is_default\" => \"\"\n\n );\n\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\".$attribute_code.\"/options\", 1, json_encode($data) );\n\n }\n return $insert;\n\n }", "public function CreateAttributeDiff($attribute_data,$attribute_set_id,$diff_attr){\n\n $diff_code = '_d';\n if($diff_attr == 'filter'){\n $diff_code = '_f';\n }\n\n $attribute_code = $attribute_data['attribute_code'] . $diff_code;\n $attribute_name = $attribute_data['attribute_name'] . $diff_code;\n $field_type_id = $attribute_data['field_type_id'];\n $input_type = 'text';\n\n $input_type = 'select';\n\n\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\".$attribute_code,0);\n\n if( isset($result['message']) ){\n\n $data['attribute'] = array(\n \"attribute_code\" => $attribute_code,\n \"frontend_input\" => $input_type,\n \"scope\" => \"global\",\n \"default_value\" => \"\",\n \"is_unique\" => 0,\n \"is_required\" => 0,\n \"is_searchable\" => 0,\n \"is_visible_in_advanced_search\" => 0,\n \"is_comparable\" => 0,\n \"is_used_for_promo_rules\" => 0,\n \"is_visible_on_front\" => 0,\n \"used_in_product_listing\" => 0,\n \"default_frontend_label\" => $attribute_name,\n \"frontend_labels\" => array(array(\"store_id\" => \"0\", \"label\" => $attribute_name))\n );\n\n $result = $this->curlRequest(\"/rest/V1/products/attributes/\",1,json_encode($data));\n $attribute_id = $result['attribute_id'];\n\n\n\n //die();\n\n }else{\n $attribute_id = $result['attribute_id'];\n }\n\n $result2 = $this->curlRequest(\"/rest/V1/products/attribute-sets/attributes\",1,json_encode([\n \"attributeSetId\" => $attribute_set_id,\n \"attributeCode\" => $attribute_code,\n \"attributeGroupId\" => 130,\n \"sortOrder\" => 0\n ]) );\n\n return $attribute_id;\n }", "function imbaf_properties_create_add_fields(){\n ?>\n <div class=\"form-field\">\n <label for=\"term_meta[imbaf_property_type]\">Typ</label>\n\n <select name=\"term_meta[imbaf_property_type]\">\n\n <?php\n\n foreach($this -> property_types as $property){\n\n ?> <option style=\"width:100%;\" value=\"<?php echo $property['value']; ?>\"><?php echo $property['label']; ?></option> <?php\n\n }\n\n\n ?>\n </select>\n\n <p class=\"description\"><?php _e('Vergleichswert-Typ','imb_affiliate'); ?></p>\n\n\n\n <label for=\"term_meta[imbaf_property_icon]\">Icon</label>\n <input type=\"text\" name=\"term_meta[imbaf_property_icon]\">\n\n <p class=\"description\"><?php _e('Font Awesome Icon','imb_affiliate'); ?></p>\n\n\n <label for=\"term_meta[imbaf_property_prefix]\"><?php _e('Präfix','imb_affiliate'); ?></label>\n <input type=\"text\" name=\"term_meta[imbaf_property_prefix]\">\n\n <p class=\"description\"><?php _e('Vorgestellter Wert (ca.)','imb_affiliate'); ?></p>\n\n <label for=\"term_meta[imbaf_property_suffix]\"><?php _e('Suffix','imb_affiliate'); ?></label>\n <input type=\"text\" name=\"term_meta[imbaf_property_suffix]\">\n <p class=\"description\"><?php _e('Nachgestellter Wert (z.B. kg, MhZ etc.)','imb_affiliate'); ?></p>\n\n\n\n </div>\n <?php\n\n\n }", "function gwAddTerm($arPre, $id_dict, $arStop, $in_term, $is_specialchars, $is_overwrite, $intLine = 0, $isDelete = 0)\r\n{\r\n\tglobal $oDom, $oFunc, $oDb, $oSqlQ, $oCase, $oL, $oHtml, $oSess;\r\n\tglobal $arFields, $arDictParam, $arTermParam, $cnt, $tid, $sys;\r\n\tglobal $gw_this, $qT;\r\n\r\n#\t@header(\"content-type: text/html; charset=utf-8\");\r\n\r\n\t$id_w = $oDb->MaxId($arDictParam['tablename']);\r\n\t$isQ = 1;\r\n\t$isCleanMap = 0;\r\n\t$id_old = isset($tid) ? $tid : 0;\r\n\t$queryA = $qT = array();\r\n\t$isTermExist = 0;\r\n\t/* Used for keywords */\r\n\t$str_term_filtered = $oDom->get_content($arPre['term']);\r\n\t/* remove {TEMPLATES}, {%TEMPLATES%} */\r\n\t$str_term_filtered = preg_replace(\"/{(%)?([A-Za-z0-9:\\-_]+)(%)?}/\", '', $str_term_filtered);\r\n\t$str_term_filtered = trim($str_term_filtered);\r\n\t/* Used in database */\r\n\t$str_term_src = gw_fix_input_to_db($str_term_filtered);\r\n\t\r\n\t$str_term_filtered = gw_unhtmlspecialamp($str_term_filtered);\r\n\t/* 22 jul 2003: Custom Term ID */\r\n\t$qT['id'] = $oDom->get_attribute('id', 'term', $arPre['term'] );\r\n\t$qT['id'] = preg_replace(\"/[^0-9]/\", '', trim($qT['id']));\r\n\t/* */\r\n\tif (!$isDelete)\r\n\t{\r\n\t\t/* -- Check for an existed term -- */\r\n\t\t/* prepare keywords for a term */\r\n\t\tif ($is_specialchars)\r\n\t\t{\r\n\t\t\t/* Keep specials */\r\n\t\t\t$str_term_filtered = $oCase->nc($str_term_filtered);\r\n\t\t\t$str_term_filtered = gw_text_wildcars($str_term_filtered);\r\n\t\t\t$arKeywordsT = text2keywords($oCase->rm_($str_term_filtered), 1);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/* Remove specials */\r\n\t\t\t$str_term_filtered = text_normalize($str_term_filtered);\r\n\t\t\t$arKeywordsT = text2keywords($str_term_filtered, $arDictParam['min_srch_length']);\r\n\t\t}\r\n\t\t/* Are there any keywords? */\r\n\t\t$isTermEmpty = (empty($arKeywordsT) && (strlen(trim( $str_term_filtered )) == 0)) ? 1 : 0;\r\n\t\tif (!$isTermEmpty)\r\n\t\t{\r\n\t\t\t/* no empty keywords for a term */\r\n\t\t\t/* SQL-query */\r\n\t\t\t/* Get existent keywords, standard mode */\r\n\t\t\t$word_srch_sql = ($qT['id'] != '') ? 't.id = \"' . $qT['id'] . '\"' : '';\r\n\t\t\tif ($word_srch_sql == '')\r\n\t\t\t{\r\n\t\t\t\t$word_srch_sql = \"k.word_text IN ('\" . implode(\"', '\", $arKeywordsT) . \"')\";\r\n\t\t\t}\r\n\t\t\t$sql = $oSqlQ->getQ('get-term-exists', TBL_WORDLIST, $arDictParam['tablename'], $id_dict,\r\n\t\t\t\t\t\t$in_term, $word_srch_sql\r\n\t\t\t\t\t);\r\n\t\t\t/* Get existent keywords, keep specialchars mode */\r\n\t\t\tif (($is_specialchars) || empty($arKeywordsT))\r\n\t\t\t{\r\n\t\t\t\t$ar_chars_sql = array('\\\\' => '\\\\\\\\', '\\\\%' => '\\\\\\\\\\\\\\%', '\\\\_' => '\\\\\\\\\\\\\\_', '\\\\\"' => '\\\\\\\\\\\\\\\"', \"\\\\'\" => \"\\\\\\\\\\\\\\'\");\r\n\t\t\t\t$sql = $oSqlQ->getQ('get-term-exists-spec', $arDictParam['tablename'],\r\n\t\t\t\t\t\tstr_replace(array_keys($ar_chars_sql), array_values($ar_chars_sql), gw_addslashes( $str_term_src ))\r\n\t\t\t\t\t);\r\n\t\t\t}\r\n\t\t\t$arSql = $oDb->sqlExec($sql);\r\n#\t\t\tprn_r($arSql, __LINE__ . '<br />' . $sql);\r\n\t\t\t$isTermNotMatched = 1; // `No term found' by default\r\n\r\n\t\t\tfor (; list($arK, $arV) = each($arSql);) // compare founded values (Q) with imported (T)\r\n\t\t\t{\r\n\t\t\t\t$id_old = $arV['id']; // get ID for existent keywords.\r\n\t\t\t\tif ($id_old == $qT['id'])\r\n\t\t\t\t{\r\n\t\t\t\t\t$isTermNotMatched = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif ($is_specialchars)\r\n\t\t\t\t{\r\n\t\t\t\t\t/* 1 - is the minimum length */\r\n\t\t\t\t\t$arKeywordsQ = text2keywords( text_normalize($arV['term']), 1);\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/* $arDictParam['min_srch_length'] - is the minimum length */\r\n\t\t\t\t\t$arKeywordsQ = text2keywords( text_normalize($arV['term']), $arDictParam['min_srch_length']);\r\n\t\t\t\t}\r\n#\t\t\t\tprn_r($arKeywordsQ);\r\n\t\t\t\t$div1 = sizeof(gw_array_exclude($arKeywordsT, $arKeywordsQ));\r\n\t\t\t\t$div2 = sizeof(gw_array_exclude($arKeywordsQ, $arKeywordsT));\r\n\t\t\t\t$isTermNotMatched = ($div1 + $div2);\r\n\t\t\t\t// if the sum of excluded arrays is 0, this term already exists\r\n\t\t\t\tif (!$isTermNotMatched) // in english, double negative means positive... yeah\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t} // end of for each founded terms\r\n\t\t\tif ($isTermNotMatched > 0)\r\n\t\t\t{\r\n\t\t\t\t$isQ = 1;\r\n\t\t\t\t$isTermExist = 0;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$isTermExist = 1;\r\n\t\t\t}\r\n\t\t} // !$isTermEmpty\r\n\t}\r\n\t/* */\r\n\tif (!isset($str_term_filtered))\r\n\t{\r\n\t\t$str_term_filtered = gw_text_wildcars($str_term_filtered);\r\n\t\t$str_term_filtered = text_normalize($str_term_filtered);\r\n\t}\r\n\t/* 21 jan 2006: new `date_created' for new terms */\r\n\t/* 23 apr 2008: subtract 61 second */\r\n\t$qT['date_created'] = isset($arPre['date_created']) ? $arPre['date_created'] : $sys['time_now_gmt_unix'];\r\n\t$qT['date_modified'] = $sys['time_now_gmt_unix'] - 61;\r\n\t$qT['date_created'] -= 61;\r\n\t/* 21 jul 2003: Better protection by adding random Next ID number */\r\n\t$arTermParam['tid'] = $qT['id'] = ($qT['id'] == '') ? mt_rand($id_w, ($sys['leech_factor'] * 2) + $id_w) : $qT['id'];\r\n\t$qT['term'] = $str_term_src;\r\n\t/* 15 sep 2007: Term URI */\r\n\t/* 08 apr 2008: Make link to added term */\r\n\t/* 11 apr 2008: Better URI */\r\n\t/* 23 apr 2008: Even better URI. Added transliteration. */\r\n\t$qT['term_uri'] = $oDom->get_attribute('uri', 'term', $arPre['term'] );\r\n\t$qT['term_uri'] = ($qT['term_uri'] == '') ? $qT['id'].'-'.$oCase->translit( $oCase->lc($str_term_filtered)) : $qT['term_uri'];\r\n\t$qT['term_uri'] = $oCase->rm_entity($qT['term_uri']);\r\n\t$qT['term_uri'] = preg_replace('/[^0-9A-Za-z_-]/', '-', $qT['term_uri']);\r\n\t$qT['term_uri'] = preg_replace('/-{2,}/', '-', $qT['term_uri']);\r\n\tif ($qT['term_uri'] == '-')\r\n\t{\r\n\t\t$qT['term_uri'] = $qT['id'].'-';\r\n\t}\r\n\t$arTermParam['term_uri'] = $qT['term_uri'];\r\n\r\n\t$qT['defn'] =& $arPre['parameters']['xml'];\r\n\t/* Alphabetic orders 1,2,3 */\r\n\t$qT['term_1'] = $oDom->get_attribute('t1', 'term', $arPre['term'] );\r\n\t$qT['term_2'] = $oDom->get_attribute('t2', 'term', $arPre['term'] );\r\n\t$qT['term_3'] = $oDom->get_attribute('t3', 'term', $arPre['term'] );\r\n\t/* -- Custom Alphabetic Toolbar -- */\r\n\t/* Select custom rules for uppercasing */\r\n\t$sql = 'SELECT az_value, az_value_lc FROM `'.$sys['tbl_prefix'].'custom_az` WHERE `id_profile` = \"'.$arDictParam['id_custom_az'].'\"';\r\n\t$arSqlAz = $oDb->sqlRun($sql, 'st');\r\n\tfor (; list($arK, $arV) = each($arSqlAz);)\r\n\t{\r\n\t\t$str_term_src = str_replace($arV['az_value_lc'], $arV['az_value'], $str_term_src);\r\n\t}\r\n\t/* Unicode uppercase */\r\n\t$str_term_src_uc = $oCase->uc( $str_term_src );\r\n\t/* 1.8.7: Custom sorting order */\r\n\t$qT['term_order'] = $oDom->get_attribute('term_order', 'term', $arPre['term'] );\r\n\t$qT['term_order'] = ($qT['term_order'] == '') ? $str_term_src_uc : $qT['term_order'];\r\n\t$qT['term_a'] = $qT['term_b'] = $qT['term_c'] = $qT['term_d'] = $qT['term_e'] = $qT['term_f'] = 0;\r\n\t/* Prepare A, AAZZ, AAAZZZ */\r\n\t$qT['term_3'] = ($qT['term_3'] == '') ? $oFunc->mb_substr($str_term_filtered, 2, 1, $sys['internal_encoding']) : $qT['term_3'];\r\n\t$qT['term_2'] = ($qT['term_2'] == '') ? $oFunc->mb_substr($str_term_filtered, 1, 1, $sys['internal_encoding']) : $qT['term_2'];\r\n\t$qT['term_1'] = ($qT['term_1'] == '') ? $oFunc->mb_substr($str_term_filtered, 0, 1, $sys['internal_encoding']) : $qT['term_1'];\r\n\t/* */\r\n\t$ar_field_names = array('a','b','c','d','e','f');\r\n\tpreg_match_all(\"/./u\", $qT['term_order'], $ar_letters);\r\n\tfor (; list($cnt_letter, $letter) = each($ar_letters[0]);)\r\n\t{\r\n\t\tif (isset($ar_field_names[$cnt_letter]))\r\n\t\t{\r\n\t\t\t$qT['term_'.$ar_field_names[$cnt_letter]] = text_str2ord($letter);\r\n\t\t}\r\n\t}\r\n\t/* Fix htmlspecial characters */\r\n\t$qT['term_3'] = gw_htmlspecialamp(gw_unhtmlspecialamp($qT['term_3']));\r\n\t$qT['term_2'] = gw_htmlspecialamp(gw_unhtmlspecialamp($qT['term_2']));\r\n\t$qT['term_1'] = gw_htmlspecialamp(gw_unhtmlspecialamp($qT['term_1']));\r\n\t/* */\r\n\t$qT['is_active'] = $oDom->get_attribute('is_active', 'term', $arPre['term']);\r\n\t$qT['is_complete'] = $oDom->get_attribute('is_complete', 'term', $arPre['term']);\r\n#prn_r($qT, __LINE__.__FILE__);\r\n#exit;\r\n\tif ($isDelete || $isTermExist)\r\n\t{\r\n\t\t/* Assign Term ID from previously added term */\r\n\t\t$arTermParam['tid'] = $id_old;\r\n\t\tif ($is_overwrite)\r\n\t\t{\r\n\t\t\t$qT['id'] = $id_old;\r\n\t\t\t$isCleanMap = 1;\r\n\t\t\t$isTermExist = 0;\r\n#\t\t\t$queryA[] = $oSqlQ->getQ('del-term_id', $arDictParam['tablename'], $id_old, $id_dict);\r\n\t\t}\r\n\t}\r\n\tif (!$isDelete && $isTermExist)\r\n\t{\r\n\t\t/* Term already exists */\r\n\t\t$ar_matched_terms = array();\r\n\t\tfor (reset($arSql); list($arK, $arV) = each($arSql);)\r\n\t\t{\r\n\t\t\t$ar_matched_terms[] = $oHtml->a($sys['page_admin'].'?'.GW_ACTION.'='.GW_A_EDIT.'&'.GW_TARGET.'='.GW_T_TERMS.'&id='.$id_dict.'&tid=' . $arV['id'],\r\n\t\t\t\t\t\t $arV['term'], '', '', $oL->m('3_edit'));\r\n\t\t}\r\n\t\t$str_line = implode(' | ', $ar_matched_terms);\r\n\t\t$queryA = '<dl style=\"margin:0\">';\r\n\t\t$queryA .= '<dt class=\"xu red\">'.$oL->m('reason_25').' - <strong>'. $str_term_src . '</strong></dt>';\r\n\t\t$queryA .= '<dd class=\"termpreview\">' .$str_line. '</dd>';\r\n\t\t$queryA .= '</dl>';\r\n\t\t$isQ = 0;\r\n\t}\r\n\t/* Allow query */\r\n\tif ($isQ)\r\n\t{\r\n\t\t/* Prepare keywords per field */\r\n#\t\t$ot = new gw_timer('addterm');\r\n\t\tfor (reset($arFields); list($fK, $fV) = each($arFields);)\r\n\t\t{\r\n\t\t\t// Init\r\n\t\t\t$arKeywords[$fK] = array();\r\n\t\t\t//\r\n#\t\t\t$int_min_length = (isset($fV[2]) && ($fV[2] != 'auto') && ($fV[2] != '')) ? $fV[2] : $arDictParam['min_srch_length'];\r\n#\t\t\t$int_min_length = (!isset($fV[2]) || ($fV[2] == 'auto') ) ? $int_min_length : $fV[2];\r\n\t\t\t//\r\n\t\t\t// Make keywords from array\r\n\t\t\t// space is required, otherwise `...word</defn><defn>word...' will become `wordword'\r\n\t\t\t$tmpStr = '';\r\n\t\t\tif (isset($arPre[$fV[0]]))\r\n\t\t\t{\r\n\t\t\t\t$tmpStr = $oDom->get_content( $arPre[$fV[0]] );\r\n\t\t\t}\r\n\t\t\tif ($tmpStr != '') // do not parse empty strings\r\n\t\t\t{\r\n\t\t\t\t// Get maximum search length per field\r\n\t\t\t\t$int_min_length = $fV[2];\r\n\t\t\t\tif ( is_string($int_min_length) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$int_min_length = $arDictParam['min_srch_length'];\r\n\t\t\t\t}\r\n#\t\t\t\t$isStrip = ($srchLength == 1) ? 0 : 1;\r\n# prn_r( text_normalize( $tmpStr ) . ' ' . $fV[0] . '; len=' . $int_min_length);\r\n\t\t\t\t/* Fix wildcars, 1.6.1 */\r\n\t\t\t\t$tmpStr = str_replace('<![CDATA[', '', $tmpStr);\r\n\t\t\t\t$tmpStr = str_replace(']]>', '', $tmpStr);\r\n\t\t\t\t$tmpStr = gw_text_wildcars($tmpStr);\r\n\t\t\t\t/* */\r\n#\t\t\t\tprn_r( $fV );\r\n\t\t\t\t$arKeywords[$fK] = text2keywords( gw_text_sql(text_normalize($tmpStr)), $int_min_length, 25, $sys['internal_encoding'] );\r\n\t\t\t\t/* Remove stopwords from parsed strings only (others are empty) */\r\n\t\t\t\t$arKeywords[$fK] = gw_array_exclude( $arKeywords[$fK], $arStop);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* keywords convertion time */\r\n#\t\tprn_r( $arKeywords );\r\n#\t\tprint $ot->endp(__LINE__, __FILE__);\r\n#\t\texit;\r\n\t\t/* Remove double keywords from definition */\r\n\t\tfor (reset($arFields); list($fK, $fV) = each($arFields);)\r\n\t\t{\r\n\t\t\tif ($fK != 0)\r\n\t\t\t{\r\n\t\t\t\t$arKeywords[0] = gw_array_exclude( $arKeywords[0], $arKeywords[$fK]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/** Keywords were prepared */\r\n\t\t/** Add keywords to database! */\r\n# prn_r($arStop);\r\n# prn_r($arKeywords);\r\n# prn_r($arPre);\r\n\t\tgwAddNewKeywords($id_dict, $qT['id'], $arKeywords, $id_old, $isCleanMap, $qT['date_created']);\r\n\t\t$qT['int_bytes'] = strlen($qT['defn']);\r\n\t\t/* Checksum */\r\n\t\t$qT['crc32u'] = crc32($str_term_src_uc);\r\n\t\t/* Add User ID to term */\r\n\t\tif ($gw_this['vars'][GW_ACTION] == GW_A_ADD)\r\n\t\t{\r\n\t\t\t$qT['id_user'] = $oSess->id_user;\r\n\t\t}\r\n\t\t/* Add relation `user to term' */\r\n\t\t$q2['user_id'] = $oSess->id_user;\r\n\t\t$q2['term_id'] = $qT['id'];\r\n\t\t$q2['dict_id'] = $id_dict;\r\n\t\t// -------------------------------------------------\r\n\t\t// Turn on text parsers\r\n\t\t// -------------------------------------------------\r\n\t\t// Process automatic functions\r\n\t\tfor (; list($k, $v) = each($gw_this['vars']['funcnames'][GW_A_UPDATE . GW_T_TERM]);)\r\n\t\t{\r\n\t\t\tif (function_exists($v))\r\n\t\t\t{\r\n\t\t\t\t$v();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/* REPLACE or UPDATE */\r\n\t\tif ($isDelete || $isTermExist)\r\n\t\t{\r\n\t\t\tif ($is_overwrite)\r\n\t\t\t{\r\n\t\t\t\tunset($qT['id']);\r\n\t\t\t\t$queryA[] = gw_sql_update($qT, $arDictParam['tablename'], 'id = \"'.$id_old.'\"');\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$id_old = $qT['id'];\r\n\t\t\t$queryA[] = gw_sql_insert($qT, $arDictParam['tablename'], 1);\r\n\t\t}\r\n\r\n\t\t/* 23 Nov 2007: history of changes */\r\n\t\t$qT['id_term'] = $id_old;\r\n\t\t$qT['id_dict'] = $arDictParam['id'];\r\n\t\t$qT['id_user'] = $oSess->id_user;\r\n\t\t$qT['keywords'] = serialize($arKeywords);\r\n\t\tunset($qT['id']);\r\n\t\t\r\n\t\t$queryA[] = gw_sql_insert($qT, $sys['tbl_prefix'].'history_terms', 1);\r\n\t\t/* Assign edited term to user */\r\n\t\t$queryA[] = gw_sql_replace($q2, TBL_MAP_USER_TERM, 1);\r\n\t\t/* Check table to keep indexes */\r\n\t\t$arQuery[] = 'CHECK TABLE `'.$arDictParam['tablename'].'`';\r\n\t} /* is_query allowed */\r\n\treturn $queryA;\r\n}", "public function createnewproduct()\n {\n Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);\n $product = Mage::getModel('catalog/product');\n $websiteId = Mage::app()->getWebsite('base')->getId();\n $storeId = Mage::app()->getStore('default')->getId();\n\n //Set SKU dynamically over here\n $collection = Mage::getModel('catalog/product')\n ->getCollection()\n ->addAttributeToSort('created_at', 'desc');\n $collection->getSelect()->limit(1);\n $latestItemId = $collection->getLastItem()->getId();\n if($latestItemId) {\n $nextProid = $latestItemId + 1;\n } else {\n $nextProid = 1;\n }\n $SampleSKU = 'titechPro'.$nextProid;\n\n try {\n $product\n ->setStoreId($storeId) //you can set data in store scope\n ->setWebsiteIds(array($websiteId)) //website ID the product is assigned to, as an array\n ->setAttributeSetId(4) //ID of a attribute set named 'default'\n ->setTypeId('simple') //product type\n ->setCreatedAt(strtotime('now')) //product creation time\n ->setUpdatedAt(strtotime('now')) //product update time\n ->setSku($SampleSKU) //SKU\n ->setName('Titech sample product') //product name\n ->setWeight(4.0000)\n ->setStatus(1) //product status (1 - enabled, 2 - disabled)\n ->setTaxClassId(4) //tax class (0 - none, 1 - default, 2 - taxable, 4 - shipping)\n ->setVisibility(Mage_Catalog_Model_Product_Visibility::VISIBILITY_BOTH) //catalog and search visibility\n //->setManufacturer(28) //manufacturer id\n //->setColor(24)\n //->setNewsFromDate('06/26/2014') //product set as new from\n //->setNewsToDate('06/30/2014') //product set as new to\n ->setCountryOfManufacture('IN') //country of manufacture (2-letter country code)\n ->setPrice(11.22) //price in form 11.22\n ->setCost(22.33) //price in form 11.22\n //->setSpecialPrice(00.44) //special price in form 11.22\n //->setSpecialFromDate('06/1/2014') //special price from (MM-DD-YYYY)\n //->setSpecialToDate('06/30/2014') //special price to (MM-DD-YYYY)\n ->setMsrpEnabled(1) //enable MAP\n ->setMsrpDisplayActualPriceType(1) //display actual price (1 - on gesture, 2 - in cart, 3 - before order confirmation, 4 - use config)\n ->setMsrp(99.99) //Manufacturer's Suggested Retail Price\n ->setMetaTitle('Sample meta title 2')\n ->setMetaKeyword('Sample meta keyword 2')\n ->setMetaDescription('Sample meta description 2')\n ->setDescription('This is a long description for sample product')\n ->setShortDescription('This is a short description for sample product')\n ->setMediaGallery (array('images'=>array (), 'values'=>array ())) //media gallery initialization\n ->addImageToMediaGallery('media/catalog/product/ti/ti_logo.png', array('image','thumbnail','small_image'), false, false) //assigning image, thumb and small image to media gallery\n ->setStockData(array(\n 'use_config_manage_stock' => 0, //'Use config settings' checkbox\n 'manage_stock'=>1, //manage stock\n 'min_sale_qty'=>1, //Minimum Qty Allowed in Shopping Cart\n 'max_sale_qty'=>2, //Maximum Qty Allowed in Shopping Cart\n 'is_in_stock' => 1, //Stock Availability\n 'qty' => 999 //qty\n )\n )\n ->setCategoryIds(array(2)); //assign product to categories - Set to Default\n\n $product->save();\n return $product->getIdBySku($SampleSKU);\n } catch(Exception $e) {\n Mage::log($e->getMessage());\n }\n }", "public function __construct()\n {\n $defaultAttributeSetId = \\Mage::getSingleton('eav/config')\n ->getEntityType(\\Mage_Catalog_Model_Product::ENTITY)\n ->getDefaultAttributeSetId();\n $set = \\Mage::getModel('eav/entity_attribute_set')->load(4);\n $gid = $set->getDefaultGroupId();\n\n $that = $this;\n $this->setDefaultParameters(array(\n 'type'=> 'text',\n 'input'=> 'text',\n 'label'=> 'Test Attribute',\n 'global'=> \\Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,\n 'is_required'=> '0',\n 'is_comparable'=> '0',\n 'is_searchable'=> '0',\n 'is_unique'=> '1',\n 'is_configurable'=> '1',\n 'user_defined'=> '1',\n 'attribute_code' => function() use($that) { return $that->nextValue('attribute_code', function($i){return 'attribute_fixture_code_' . $i; }); },\n 'frontend_label' => function() use($that) { return $that->nextValue('frontend_label', function($i){return 'Attribute Fixture ' . $i; }); },\n 'attribute_set_id' => $defaultAttributeSetId,\n 'attribute_group_id' => $gid\n ));\n }", "function specialities_taxonomy_custom_fields($tag) {\n // Check for existing taxonomy meta for the term you're editing\n $t_id = $tag->term_id; // Get the ID of the term you're editing\n $term_meta = get_option( \"taxonomy_term_$t_id\" ); // Do the check\n\t?>\n\n\t<tr class=\"form-field\">\n\t\t<th scope=\"row\" valign=\"top\">\n\t\t\t<label for=\"s_keyword\"><?php _e('Search Keyword'); ?></label>\n\t\t</th>\n\t\t<td>\n\t\t\t<input type=\"text\" name=\"term_meta[s_keyword]\" id=\"term_meta[s_keyword]\" size=\"25\" style=\"width:60%;\" value=\"<?php echo $term_meta['s_keyword'] ? $term_meta['s_keyword'] : ''; ?>\" data-role=\"tagsinput\"><br />\n\t\t\t<span class=\"description\"><?php _e('Search Keyword description'); ?></span>\n\t\t</td>\n\t</tr>\n\n\t<?php\n}", "function add_wp_taxonomy_to_recipe() {\n\t// Replace post_type with actual CPT slug.\n\tregister_taxonomy_for_object_type( 'category', 'recipe' );\n\tregister_taxonomy_for_object_type( 'post_tag', 'recipe' );\n}", "public static function get_attribution_product_fields($product)\n {\n $list = array();\n if ($product['type'] == \"variable\" and count($product['variations']) > 0) {\n foreach ($product['attributes'] as $attribute) {\n\n // If Attribute Not User For Variation\n if ($attribute['variation'] === false) {\n continue;\n }\n\n // Get Basic Detail\n $list[wc_attribute_taxonomy_name($attribute['slug'])] = array(\n 'name' => $attribute['name'],\n 'options' => array()\n );\n $options = array();\n foreach ($attribute['terms'] as $term_key => $term) {\n\n // Check Term in Variables Product\n $exist = false;\n foreach ($product['variations'] as $variations_product) {\n $in_stock = $variations_product['in_stock'];\n $stock_quantity = $variations_product['stock_quantity'];\n if ($in_stock === true) {\n foreach ($variations_product['attributes'] as $variations_product_attribute) {\n if ($term['slug'] == $variations_product_attribute['option']) {\n $exist = true;\n break;\n }\n }\n }\n }\n if ($exist === true) {\n $options[$term['slug']] = $term['name'];\n }\n }\n $list[wc_attribute_taxonomy_name($attribute['slug'])]['options'] = $options;\n }\n }\n\n /**\n * [pa_color] => Array\n * (\n * [name] => رنگ\n * [options] => Array\n * (\n * [blue] => آبی\n * [red] => قرمز\n * )\n * )\n * [pa_size] => Array\n * (\n * [name] => سایز\n * [options] => Array\n * (\n * [l] => L\n */\n return $list;\n }" ]
[ "0.7286133", "0.68785053", "0.6746745", "0.6532485", "0.6441605", "0.63342774", "0.6166157", "0.6045318", "0.6007315", "0.5970067", "0.59154606", "0.58829457", "0.5861523", "0.57939136", "0.57737756", "0.57733655", "0.57715124", "0.5742632", "0.57414484", "0.57058066", "0.5673334", "0.5663049", "0.5651251", "0.5592064", "0.55871093", "0.5556962", "0.55246186", "0.55159384", "0.5506569", "0.5505047", "0.5489091", "0.5488188", "0.5484558", "0.5454194", "0.5425449", "0.541421", "0.54068184", "0.5398928", "0.5397923", "0.53797424", "0.5374605", "0.53388566", "0.5334309", "0.5324379", "0.53232867", "0.53091776", "0.53088665", "0.5306374", "0.53061277", "0.5301781", "0.5300772", "0.5286105", "0.52777076", "0.52747065", "0.5268169", "0.52679276", "0.5250115", "0.5249961", "0.52396953", "0.5232694", "0.52135104", "0.52102304", "0.5209341", "0.5206511", "0.5197637", "0.5197212", "0.5186489", "0.5184826", "0.51756114", "0.51735115", "0.5135974", "0.5128679", "0.51284564", "0.51274437", "0.5127128", "0.5108101", "0.51077807", "0.51075196", "0.510735", "0.5106452", "0.51003724", "0.5098398", "0.5096912", "0.5095696", "0.50872695", "0.50869995", "0.50802606", "0.50721914", "0.5067512", "0.5057283", "0.50516963", "0.5050414", "0.5044955", "0.5040526", "0.5034133", "0.5034045", "0.5029486", "0.5028203", "0.50230926", "0.5021505" ]
0.80773044
0
For Testing Purposes Only
public static function dump() { echo nl2br(print_r(self::$data)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "public function preTesting() {}", "protected function test9() {\n\n }", "private function setup()\r\n\t{ }", "public function testWebinars()\n {\n }", "public function setup() {}", "public function helper()\n\t{\n\t\n\t}", "protected function testObject() {\n }", "public function test() {\n\n\t}", "protected function testObjects() {\n }", "public function test_method()\n\t{\n\n\t}", "public function preTest() {}", "protected function setup(){\n }" ]
[ "0.67516124", "0.67516124", "0.67516124", "0.67516124", "0.67516124", "0.67516124", "0.67516124", "0.67516124", "0.67516124", "0.67516124", "0.67516124", "0.67516124", "0.67516124", "0.67516124", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.6749346", "0.67484653", "0.67484653", "0.67484653", "0.67484653", "0.67484653", "0.67484653", "0.67484653", "0.67484653", "0.67484653", "0.67484653", "0.67484653", "0.67484653", "0.67484653", "0.67484653", "0.67484653", "0.6748434", "0.6748434", "0.67335546", "0.6631655", "0.65529364", "0.65466917", "0.64722115", "0.64482874", "0.6428312", "0.64275944", "0.63604003", "0.6351764", "0.6338446", "0.6330661" ]
0.0
-1
Get receiver of the payout
public function getReceiver() { return $this->user; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getReceiver()\n {\n return $this->receiver;\n }", "public function getReceiver()\n {\n return $this->receiver;\n }", "public function getReceiver(){\n return $this->receiver;\n }", "public function getReceiver() {\n return $this->_receiver;\n }", "protected function getReceiverValue()\n\t{\n\t\t$payment = $this->request->getPayment();\n\n\t\treturn $this->request->get('receiver.'.$payment->id);\n\t}", "public function receiver()\n {\n return User::where('id', $this->receiver_id)->first();\n }", "public function getReceiverId();", "public function getReceiverName()\n {\n return $this->get(self::_RECEIVER_NAME);\n }", "public function payee()\n {\n return $this->getSubject()->user;\n }", "public function getReceivedBy()\n {\n return $this->get(self::RECEIVEDBY);\n }", "public function getPayee()\r\n {\r\n return $this->payee;\r\n }", "public function getPayee()\n {\n return $this->payee;\n }", "public function getPayer()\r\n {\r\n return $this->payer;\r\n }", "protected function getPayableTo()\n {\n return $this->method->getPayableTo();\n }", "protected function getPayableTo()\n {\n return $this->method->getPayableTo();\n }", "public function getRecipient() {\n\t\treturn $this -> data['recipient'];\n\t}", "public function receiver() {\n return $this->belongsTo(User::class, 'receiver_id');\n }", "public function getRecipient()\n {\n return $this->recipient;\n }", "public function receiver()\n {\n return $this->belongsTo(User::class, 'receiver_id');\n }", "public function getPayer()\n {\n return $this->user;\n }", "public function getReceivers($gateway_name ='paypal',$method_payment = 'directly',$request = false)\n {\n $request = false;\n if ( $request == false)\n {\n $fee = 0;\n $total_pay = Mp3music_Api_Shop::updateTotalAmount($fee,true);\n $coupon = Mp3music_Api_Shop::getCouponCodeCart();\n $total_pay = $total_pay - $coupon['value'] ;\n }\n else\n {\n $fee = 0;\n $total_pay =Mp3music_Api_Shop::updateTotalAmount($fee,true);\n $settings = Mp3music_Api_Cart::getSettingsSelling(Engine_Api::_()->user()->getViewer()->level_id);\n if ( !isset($settings['comission_fee']))\n {\n $fee = 0;\n }\n else\n {\n $fee = $settings['comission_fee'];\n }\n $fee = $fee*$total_pay; \n $total_pay = Mp3music_Api_Shop::updateTotalAmount($fee,true); \n \n }\n \n \n $settings = @Mp3music_Api_Gateway::getSettingGateway($gateway_name);\n \n switch($gateway_name)\n {\n case 'paypal':\n default:\n $settings['params'] = unserialize($settings['params']);\n $receivers = array(\n array('email' => @$settings['admin_account'],'amount' => $total_pay,'invoice' => Mp3music_Api_Cart::getSecurityCode()),\n );\n break; \n }\n return $receivers;\n }", "public function getRecipient() {\n return $this->recipient;\n }", "public function getPayeeParty()\n {\n return $this->payeeParty;\n }", "public function getRefundToPayer()\n {\n return $this->refund_to_payer;\n }", "public function getSellerNoteToBuyer()\n {\n return $this->sellerNoteToBuyer;\n }", "public function receiver()\n\t{\n\t\treturn $this->belongsTo('\\User');\n\t}", "public function getPayer()\n {\n $payer = $this->data['address_name'] . '/' . $this->data['payer_email'];\n $charset = strtoupper(str_replace(\"_\", \"-\", $this->data['charset']));\n if ($charset !== 'UTF-8') {\n $payer = iconv($charset, 'UTF-8//IGNORE', $payer);\n }\n\n return $payer;\n }", "public function receiver()\n {\n return $this->belongsTo('App\\User');\n }", "public function getPaymentReceived()\n {\n return $this->payment_received;\n }", "public function getBillIssuer()\n {\n return $this->getParameter('bill:issuer');\n }", "public function wasReceiver() {\n return $this->friend['uuidReceiver'] == $this->uuid;\n }", "public static function get_reminder_recipient() {\n $recipient = get_option( 'sb_domain_reminder_recipient' );\n if( empty( $recipient ) ) {\n $recipient = get_bloginfo( 'admin_email' );\n }\n return $recipient;\n }", "private function getPayum()\n {\n return $this->get('payum');\n }", "public function get_resend_to()\n\t{\n\t\treturn $this->resend_to_array;\n\t}", "public function getGiftcardRecipientEmail();", "public function getReceivableAmount()\n {\n return $this->receivable_amount;\n }", "public function getSendToMerchant()\n {\n return $this->send_to_merchant;\n }", "public function getPayment()\n {\n return $this->payment;\n }", "public function getPayment()\n {\n return $this->payment;\n }", "public function getPayment()\n {\n return $this->payment;\n }", "public function getAmountOtherReceivers()\n {\n return $this->getIfSet('otherReceivers', $this->data->amount);\n }", "public function receiver()\n {\n $account = Session::getAccount();\n $customer = Session::getCustomer();\n $transaction = Session::getTransaction();\n\n $transaction->setAccountId($account->getAccountId());\n $transaction->setCompanyId($account->getCompanyId());\n $transaction->setTransactionTypeId(Transaction::TYPE_RECEIVER);\n $transaction->setTransactionStatusId(Transaction::STATUS_REQUESTED);\n\n //transaction request\n $amount = $this->wsRequest->requireNumericAndPositive('amount');\n $username = trim($this->wsRequest->requireNotNullOrEmpty('uid'));\n $agencyTypeId = $this->wsRequest->requireNumericAndPositive('type');\n $merchantTransId = trim($this->wsRequest->getParam('merchantTransId'));\n\n $transaction->setFee(0);\n $transaction->setAmount($amount);\n $transaction->setUsername($username);\n $transaction->setAgencyTypeId($agencyTypeId);\n $transaction->setMerchantTransId($merchantTransId);\n\n //validate if need to create the customer\n $customer->validateFromRequest($account, $this->wsRequest);\n $transaction->setCustomerId($customer->getCustomerId());\n\n //get name\n $person = new Person();\n $provider = new Provider();\n $providerException = null;\n foreach($this->providers as $providerData){\n $providerException = null;\n $providerId = $providerData['Provider_Id'];\n $providerClassName = $providerData['Name'];\n if(class_exists($providerClassName)){\n try{\n $provider = Session::getProvider($providerId);\n $person = $provider->receiver();\n if($person && $person->getPersonId()){\n break;\n }\n }catch(PersonException $exception){\n $providerException = $exception;\n continue;\n }catch(CustomerBlackListException $exception){\n $providerException = $exception;\n continue;\n }catch(LimitException $exception){\n $providerException = $exception;\n continue;\n }catch(P2PException $exception){\n $providerException = $exception;\n continue;\n }catch(P2PLimitException $exception){\n $providerException = $exception;\n continue;\n }catch(APIBlackListException $exception){\n $providerException = $exception;\n continue;\n }catch(APIPersonException $exception){\n $providerException = $exception;\n continue;\n }catch(APILimitException $exception){\n $providerException = $exception;\n continue;\n }catch(APIException $exception){\n $providerException = $exception;\n continue;\n }catch(P2PAgencyException $exception){\n $providerException = $exception;\n continue;\n }catch(P2PRelationCustomerException $exception){\n $providerException = $exception;\n continue;\n }catch(P2PRelationPersonException $exception){\n $providerException = $exception;\n continue;\n }catch(Exception $exception){\n throw $exception;\n }\n }\n }\n\n if(!$person || !$person->getPersonId()){\n if($providerException){\n throw $providerException;\n }elseif($provider->getApiMessage()){\n throw new APIException($provider->getApiMessage());\n }else{\n throw new TransactionException('We cannot give a Receiver for this Customer (Sender)');\n }\n }\n\n //block person\n $person->block();\n //sets personId\n $transaction->setPersonId($person->getPersonId());\n //create transaction after the validation of the data\n $transaction->create();\n if($transaction->getTransactionId()){\n $provider->stickiness();\n\n //extra information\n if($transaction->getAgencyTypeId() == Transaction::AGENCY_TYPE_RIA){\n $transaction->setInformation('EasyPay-Phillgus');\n if($transaction->getProviderId() != Dinero::PROVIDER_ID){\n $transaction->setInformation('TeleDolar');\n }\n }\n\n $wsResponse = new WSResponseOk();\n $wsResponse->addElement('transaction', $transaction);\n $wsResponse->addElement('sender', $customer);\n $wsResponse->addElement('receiver', $person);\n\n }else{\n throw new TransactionException(\"The Transaction not has been created. Please, try later!\");\n }\n\n return $wsResponse;\n }", "public function getTo() {\n\t\treturn $this->to;\n\t}", "public function getTo() {\n\t\treturn $this->to;\n\t}", "public function getTel_partner()\n {\n return $this->tel_partner;\n }", "public function getBuyerEmail() {\n return $this->params[\"original\"][\"buyer_email\"];\n }", "public function getSender();", "function getTo(){\n\t\t\treturn $this->to;\n\t\t}", "public function getTo()\n {\n return $this->to;\n }", "public function getTo()\n {\n return $this->to;\n }", "public function getTo()\n {\n return $this->to;\n }", "public function getTo()\n {\n return $this->to;\n }", "public function getTo()\n {\n return $this->to;\n }", "public function getTo()\n {\n return $this->to;\n }", "private function getRX()\n {\n return $this->getRemote($this->RemoteQuery['ip'], \".1.3.6.1.2.1.10.127.1.1.1.1.6.3\", $this->RemoteQuery['community']);\n }", "public function getMessAccount ()\n {\n return $this->mess_account;\n }", "public function receiver(){\n return $this->belongsTo('App\\Models\\User','receiver_id_fk');\n }", "public function setReceiver($receiver){\n $this->receiver = $receiver;\n }", "public function getTo()\n {\n return $this->_to;\n }", "public function getTo()\n {\n return $this->_to;\n }", "public function getPaySn()\n {\n return $this->pay_sn;\n }", "public function getBuyer()\n {\n return $this->getParameter('buyer');\n }", "public function getPayerId(): ?string\n {\n return $this->{self::PAYER_ID};\n }", "public function get_orderer_mail()\n\t{\n\t\t$orderer = $this->prop(\"purchaser\");\n\t\tif(is_oid($orderer))\n\t\t{\n\t\t\t$o = obj($orderer);\n\t\t\treturn $o->get_mail();\n\t\t}\n\t\treturn null;\n\t}", "public function getOutbound()\n {\n return $this->outbound;\n }", "public function getReminderEmail()\n\t{\n\t\treturn $this->mobileNumber;\n\t}", "public function receiver()\n {\n return $this->hasMany(\n Message::class,\n 'receiver_id');\n\n }", "public function getReseller(): string {\n return $this->context->reseller;\n }", "public function getReceiver(TwitterOAuth $twitter)\n {\n if (is_int($this->to)) {\n return $this->to;\n }\n\n $user = $twitter->get('users/show', [\n 'screen_name' => $this->to,\n 'include_user_entities' => false,\n 'skip_status' => true,\n ]);\n\n if ($twitter->getLastHttpCode() === 404) {\n throw CouldNotSendNotification::userWasNotFound($twitter->getLastBody());\n }\n\n return $user->id;\n }", "public function createReceiver() {\n return ModelFactory::getReceiver();\n }", "public function getPayerInfo()\n {\n return $this->payer_info;\n }", "function dokan_get_seller_withdraw_mail( $seller_id, $type = 'paypal' ) {\n $info = dokan_get_store_info( $seller_id );\n\n return $info['payment'][$type]['email'];\n}", "public function getInvoicerTradeParty()\n {\n return $this->invoicerTradeParty;\n }", "public function getIssuer()\n {\n if (array_key_exists(\"issuer\", $this->_propDict)) {\n return $this->_propDict[\"issuer\"];\n } else {\n return null;\n }\n }", "public function getIssuer()\n {\n if (array_key_exists(\"issuer\", $this->_propDict)) {\n return $this->_propDict[\"issuer\"];\n } else {\n return null;\n }\n }", "public function getTo() {\n return $this->to;\n }", "public function getRefundFromSeller()\n {\n return $this->refundFromSeller;\n }", "public function getLogisticsProviderShipmentToBuyer()\n {\n return $this->logisticsProviderShipmentToBuyer;\n }", "public function getTo() {\n return $this->user_to;\n }", "public function getTelefone2()\n {\n return $this->telefone2;\n }", "public function getRECEPCIONISTA()\n {\n return $this->RECEPCIONISTA;\n }", "public function getSender() {\n\t\treturn $this -> data['sender'];\n\t}", "public function getReceipt()\n {\n return $this->receipt;\n }", "public function getIssuer()\n {\n return $this->issuer;\n }", "public function getIssuer()\n {\n return $this->issuer;\n }", "public function getSender(){\n return $this->sender;\n }", "public function getEndorserParty()\n {\n return $this->endorserParty;\n }", "public function getGiftcardRecipientName();", "public function getToUser()\n {\n return $this->toUser;\n }", "public function getPayerEmail() {\n\t\treturn $this->_getField(self::$PAYER_EMAIL);\n\t}", "public function getToMember()\n {\n if (!$this->to_member && $this->to) {\n $email = self::get_email_from_rfc_email($this->to);\n $member = Member::get()->filter(array('Email' => $email))->first();\n if ($member) {\n $this->setToMember($member);\n }\n }\n return $this->to_member;\n }", "public function getCorreo_partner()\n {\n return $this->correo_partner;\n }", "public function getBuyerPhone() {\n return $this->params[\"original\"][\"buyer_phone_number\"];\n }", "public function getTo();", "public function setReceiver($receiver)\n {\n $this->receiver = $receiver;\n\n return $this;\n }", "public function setReceiver($receiver)\n {\n $this->receiver = $receiver;\n\n return $this;\n }", "public function getPayerType() {\n return $this->_payerType;\n }", "public function getPaymentRequest()\n {\n return $this->payment_request;\n }", "public function getBuyerCustomerParty()\n {\n return $this->buyerCustomerParty;\n }", "public function getMailTo ()\n {\n return $this->mail_to;\n }" ]
[ "0.746594", "0.746594", "0.7423434", "0.73091054", "0.72246873", "0.6711723", "0.6598828", "0.63563067", "0.61652064", "0.61579615", "0.61413425", "0.6121394", "0.6080608", "0.6058505", "0.6058505", "0.6046958", "0.5917615", "0.5866003", "0.5860953", "0.5823475", "0.5808931", "0.5773465", "0.57570684", "0.5751599", "0.57159424", "0.5684703", "0.5629849", "0.559851", "0.5586138", "0.55765265", "0.5574347", "0.5520662", "0.5499523", "0.5478671", "0.54676044", "0.5455963", "0.5428102", "0.54188687", "0.54188687", "0.54188687", "0.5407876", "0.53596866", "0.5358958", "0.5358958", "0.53553104", "0.534726", "0.53442144", "0.53407425", "0.5336993", "0.5336993", "0.5336993", "0.5336993", "0.5336993", "0.5336993", "0.5320226", "0.5316872", "0.5312996", "0.5312416", "0.53098524", "0.53098524", "0.53073144", "0.5306431", "0.53057384", "0.52997094", "0.52983886", "0.5297661", "0.52967966", "0.52872694", "0.52830106", "0.52723026", "0.5268812", "0.52671015", "0.52603275", "0.52588886", "0.52588886", "0.5247603", "0.524094", "0.52400047", "0.5239875", "0.5239237", "0.52313155", "0.52265", "0.521638", "0.5199754", "0.5199754", "0.5197965", "0.519457", "0.5185839", "0.51826835", "0.5172361", "0.51649594", "0.51624393", "0.51603353", "0.5159256", "0.51540536", "0.51540536", "0.5131246", "0.51290476", "0.51287377", "0.51171106" ]
0.7327429
3
Set receiver of the payout
public function setReceiver(User $receiver) { $this->user = $receiver; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setReceiver($receiver){\n $this->receiver = $receiver;\n }", "public function setReceiver($receiver) {\n $this->_receiver = $receiver;\n }", "public function setReceiver($receiver)\n {\n $this->receiver = $receiver;\n\n return $this;\n }", "public function setReceiver($receiver)\n {\n $this->receiver = $receiver;\n\n return $this;\n }", "public function getReceiver(){\n return $this->receiver;\n }", "protected function setTo() {}", "public function setSender($sender);", "public function getReceiver()\n {\n return $this->receiver;\n }", "public function getReceiver()\n {\n return $this->receiver;\n }", "public function setSender($sender ){\n $this->sender = $sender;\n }", "function setTo($to_set){\n\t\t\t$this->to=$to_set;\n\t\t}", "public static function setSender($val) \n { \n emailSettings::$sender = $val; \n }", "public function getReceiver() {\n return $this->_receiver;\n }", "function setReceived($received) \n {\n if ($received == true) \n\t { \n \t$this->setValueByFieldName('cashtransaction_recd','1');\n \t }\n \t else \n \t {\n\t \t$this->setValueByFieldName('cashtransaction_recd','0');\n \t } \n \t\t\t\n }", "public function setTo($to) {\r\n $this->to = $to;\r\n }", "public function setTo($to) {\r\n\t\t$this->to = $to;\r\n\t}", "public function setSender($sender) {\n $this->_sender = $sender;\n }", "function set_reply($reply)\n\t{\n\t\t$this->reply_to = $reply;\n\t}", "public function setSender($address);", "function setBlacklistedEmail($val) {\n\t\tif($val && $this->owner->Email) {\n\t\t\t$blacklisting = new NewsletterEmailBlacklist();\n\t \t\t$blacklisting->BlockedEmail = $this->owner->Email;\n\t \t\t$blacklisting->MemberID = $this->owner->ID;\n\t \t\t$blacklisting->write();\n\t\t}\n\n\t\t$this->owner->setField(\"BlacklistedEmail\", $val);\n\t\t// Save the BlacklistedEmail field to the Member table\n\t\t$this->owner->write();\n\t}", "public function set_to($to)\n\t{\n\t\tif($this->validate_email($to))\n\t\t{\n\t\t\tif(is_array($to))\n\t\t\t\t$this->send_to = $to;\n\t\t\telse\n\t\t\t\t$this->send_to[] = $to;\t\t\n\t\t}\n\t}", "public function getReceiver()\n {\n return $this->user;\n }", "public function receiver() {\n return $this->belongsTo(User::class, 'receiver_id');\n }", "public function setReceivers($receivers)\n {\n $this->receivers = Type::forceAndReturn($receivers, ArrayAccess::class);\n return $this;\n }", "public function set_sender($sender)\n {\n clearos_profile(__METHOD__, __LINE__);\n\n Validation_Exception::is_valid($this->validate_email($sender));\n\n try {\n $file = new File(self::SMARTD_CONFIG, TRUE);\n if (!$file->exists())\n $file->create('root', 'root', '0644');\n //TODO: permit users to specify their own parameters for scheduling tests\n $newline = \"DEVICESCAN -H -m $sender\\n\";\n $retval = $file->replace_one_line_by_pattern('/^DEVICESCAN/i', $newline);\n $this->restart();\n } catch (File_No_Match_Exception $e) {\n $retval = $file->add_lines($newline);\n $this->restart();\n }\n }", "public function receiver()\n {\n return $this->belongsTo(User::class, 'receiver_id');\n }", "function setFromName($to_set=\"noreply\"){\n\t\t\t$this->from_name = $to_set;\n\t\t}", "function setPartnerTarget($account)\n {\n $this->target=$account;\n }", "public function setGiftcardRecipientEmail($value);", "public function setCancelbyseller($id){\n $rma = Mage::getModel(\"mprmasystem/rmarequest\")->load($id);\n $rma->setStatus(\"Cancelled\")->save();\n Mage::getModel(\"mprmasystem/rmamail\")->CancelRMAMailbyseller($id);\n }", "function setFrom($to_set=\"noreply\"){\n\t\t\t$this->from_mail = $to_set;\n\t\t}", "public function receiver(){\n return $this->belongsTo('App\\Models\\User','receiver_id_fk');\n }", "public function setRecipient($recipient)\n {\n $this->recipient = (string) $recipient;\n }", "public function setRetThirdPartyPayer($retThirdPartyPayer) {\n \t$this->_retThirdPartyPayer = $retThirdPartyPayer;\n }", "protected function getReceiverValue()\n\t{\n\t\t$payment = $this->request->getPayment();\n\n\t\treturn $this->request->get('receiver.'.$payment->id);\n\t}", "public function setReplyTo(?string $replyTo): void {\n\t\tself::checkValidEMail($replyTo);\n\n\t\t$this->replyTo = $replyTo;\n\t}", "public function setReceiverName($value)\n {\n return $this->set(self::_RECEIVER_NAME, $value);\n }", "public function receiver()\n {\n return $this->belongsTo('App\\User');\n }", "public function setGiftcardSenderEmail($value);", "public function setBuyerEmailAddress(?string $buyerEmailAddress): void\n {\n $this->buyerEmailAddress['value'] = $buyerEmailAddress;\n }", "public function setMerchant(?array $merchant): void\n {\n $this->merchant = $merchant;\n }", "protected function setReceivedPaymentFromBuckaroo()\n {\n if (empty($this->postData['brq_transactions'])) {\n return;\n }\n\n $payment = $this->order->getPayment();\n\n if (!$payment->getAdditionalInformation(self::BUCKAROO_RECEIVED_TRANSACTIONS)) {\n $payment->setAdditionalInformation(\n self::BUCKAROO_RECEIVED_TRANSACTIONS,\n [$this->postData['brq_transactions'] => floatval($this->postData['brq_amount'])]\n );\n } else {\n $buckarooTransactionKeysArray = $payment->getAdditionalInformation(self::BUCKAROO_RECEIVED_TRANSACTIONS);\n\n $buckarooTransactionKeysArray[$this->postData['brq_transactions']] =\n floatval($this->postData['brq_amount']);\n\n $payment->setAdditionalInformation(self::BUCKAROO_RECEIVED_TRANSACTIONS, $buckarooTransactionKeysArray);\n }\n }", "public static function setMethod($val) \n { \n emailSettings::$method = $val; \n }", "public function set_sender(EmailAddress $address);", "public function setEmailToAddress($value) { $this->_emailToAddress = $value; }", "function setSender($from){\n $this->From = $from;\n }", "public function setIssuer($val)\n {\n $this->_propDict[\"issuer\"] = $val;\n return $this;\n }", "public function setIssuer($val)\n {\n $this->_propDict[\"issuer\"] = $val;\n return $this;\n }", "private function setMerchantD()\n {\n $this->mid = config('gladepay.mid');\n }", "public function setTo($to) {\n\t\t$this->attributes['to'] = $to;\n\t\t$this->to = $to;\n\t\treturn $this;\n\t}", "public function setIDSender($idSender){\n $this->IDsender = $idSender;\n }", "public function getSellerNoteToBuyer()\n {\n return $this->sellerNoteToBuyer;\n }", "public function wasReceiver() {\n return $this->friend['uuidReceiver'] == $this->uuid;\n }", "public function setMail($_mail)\n {\n $this->mail = $_mail;\n }", "public function set_recipient( $id ) {\n\t\t$this->recipient_id = $id;\n\t\tupdate_comment_meta( $this->id, APP_REPORTS_C_RECIPIENT_KEY, $id );\n\t}", "public function setRequester($user)\r\n {\r\n $this->requester = $user;\r\n }", "protected function setOfferValue ()\n {\n $this->request->coupon_benefits[ $this->offerNature ] = $this->offer->rate;\n }", "public function setPayer(PayerInterface $payer)\n {\n $this->user = $payer;\n }", "public function payrent($from,$to,$rent){\n $to->collect($from->pay($rent));\n }", "public function setMail($mail);", "public function receiver()\n {\n return User::where('id', $this->receiver_id)->first();\n }", "public function setBusNo(string $busNo) : void\n {\n $this->busNo = $busNo; \n }", "public function setReceiverMobile($phone): JawaliAttributes\n {\n $this->attributes['body']['receiverMobile'] = $phone;\n return $this;\n }", "public function sender($sender)\r\n {\r\n $this->sender = $sender;\r\n\r\n return $this;\r\n }", "function setRecipients($recipients) {\n\t\t$this->setData('recipients', $recipients);\n\t}", "public function setPayerType($payerType) {\n $this->_payerType = $payerType;\n }", "public function set_to( $to ) {\n $this->to = $to;\n return $this;\n }", "public function unsetBuyerEmailAddress(): void\n {\n $this->buyerEmailAddress = [];\n }", "public function setSender($sender)\n {\n throw new \\Ovh\\Exceptions\\InvalidParameterException(\"Sender is incompatible with message for response\");\n }", "public function receiver()\n\t{\n\t\treturn $this->belongsTo('\\User');\n\t}", "public function setRecipient($value)\n {\n return $this->set('Recipient', $value);\n }", "public function setRecipient($value)\n {\n return $this->set('Recipient', $value);\n }", "public function receiver()\n {\n return $this->belongsTo('App\\Employee', 'receiver');\n }", "public function setMother($mother)\n {\n $this->mother = $mother;\n }", "public function setWake($wake) {\n $this->wakeNext = $wake;\n }", "public function setDataReceived($rec)\n\t{\n\t\t$this->body()->data_received = $rec;\n\t}", "function change_recipient() {\n\t\treturn \"email@address.com\";\n\t}", "protected function setReplyTo() {}", "public function setPayment($payment);", "public function passwordChange($observer)\n{\n\n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $customer = $observer->getEvent()->getCustomer();\n $fname=$customer->getFirstname();\n $lname=$customer->getLastname();\n $email= $customer->getEmail();\n $telephone= $customer->getAddressesCollection()->getFirstitem()->getTelephone();\n if ($telephone) {\n $text = Mage::getStoreConfig('smsnotifications/customer_notification/change_password');\n $text = str_replace('{{firstname}}', $fname, $text);\n $text = str_replace('{{lastname}}', $lname, $text);\n $text = str_replace('{{emailid}}', $email, $text);\n // $text = str_replace('{{name}}', $customer_name, $text);\n }\n array_push($settings['order_noficication_recipients'], $telephone);\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n return $this;\n}", "function disableReceiver($uid, $bounce_type) {\n\t\treturn false;\n\t}", "public function setPayment($value) {\n $this->payment = $value;\n }", "public function receiver()\n {\n $account = Session::getAccount();\n $customer = Session::getCustomer();\n $transaction = Session::getTransaction();\n\n $transaction->setAccountId($account->getAccountId());\n $transaction->setCompanyId($account->getCompanyId());\n $transaction->setTransactionTypeId(Transaction::TYPE_RECEIVER);\n $transaction->setTransactionStatusId(Transaction::STATUS_REQUESTED);\n\n //transaction request\n $amount = $this->wsRequest->requireNumericAndPositive('amount');\n $username = trim($this->wsRequest->requireNotNullOrEmpty('uid'));\n $agencyTypeId = $this->wsRequest->requireNumericAndPositive('type');\n $merchantTransId = trim($this->wsRequest->getParam('merchantTransId'));\n\n $transaction->setFee(0);\n $transaction->setAmount($amount);\n $transaction->setUsername($username);\n $transaction->setAgencyTypeId($agencyTypeId);\n $transaction->setMerchantTransId($merchantTransId);\n\n //validate if need to create the customer\n $customer->validateFromRequest($account, $this->wsRequest);\n $transaction->setCustomerId($customer->getCustomerId());\n\n //get name\n $person = new Person();\n $provider = new Provider();\n $providerException = null;\n foreach($this->providers as $providerData){\n $providerException = null;\n $providerId = $providerData['Provider_Id'];\n $providerClassName = $providerData['Name'];\n if(class_exists($providerClassName)){\n try{\n $provider = Session::getProvider($providerId);\n $person = $provider->receiver();\n if($person && $person->getPersonId()){\n break;\n }\n }catch(PersonException $exception){\n $providerException = $exception;\n continue;\n }catch(CustomerBlackListException $exception){\n $providerException = $exception;\n continue;\n }catch(LimitException $exception){\n $providerException = $exception;\n continue;\n }catch(P2PException $exception){\n $providerException = $exception;\n continue;\n }catch(P2PLimitException $exception){\n $providerException = $exception;\n continue;\n }catch(APIBlackListException $exception){\n $providerException = $exception;\n continue;\n }catch(APIPersonException $exception){\n $providerException = $exception;\n continue;\n }catch(APILimitException $exception){\n $providerException = $exception;\n continue;\n }catch(APIException $exception){\n $providerException = $exception;\n continue;\n }catch(P2PAgencyException $exception){\n $providerException = $exception;\n continue;\n }catch(P2PRelationCustomerException $exception){\n $providerException = $exception;\n continue;\n }catch(P2PRelationPersonException $exception){\n $providerException = $exception;\n continue;\n }catch(Exception $exception){\n throw $exception;\n }\n }\n }\n\n if(!$person || !$person->getPersonId()){\n if($providerException){\n throw $providerException;\n }elseif($provider->getApiMessage()){\n throw new APIException($provider->getApiMessage());\n }else{\n throw new TransactionException('We cannot give a Receiver for this Customer (Sender)');\n }\n }\n\n //block person\n $person->block();\n //sets personId\n $transaction->setPersonId($person->getPersonId());\n //create transaction after the validation of the data\n $transaction->create();\n if($transaction->getTransactionId()){\n $provider->stickiness();\n\n //extra information\n if($transaction->getAgencyTypeId() == Transaction::AGENCY_TYPE_RIA){\n $transaction->setInformation('EasyPay-Phillgus');\n if($transaction->getProviderId() != Dinero::PROVIDER_ID){\n $transaction->setInformation('TeleDolar');\n }\n }\n\n $wsResponse = new WSResponseOk();\n $wsResponse->addElement('transaction', $transaction);\n $wsResponse->addElement('sender', $customer);\n $wsResponse->addElement('receiver', $person);\n\n }else{\n throw new TransactionException(\"The Transaction not has been created. Please, try later!\");\n }\n\n return $wsResponse;\n }", "function setEmail($newEmail){\n $this->email = $newEmail;\n }", "public function setToEmailAddress($toEmailAddress, $recipientName);", "function addReceiverByUserId($id,$mode,$exclude_myself=true){\n if ($id>0){\n $u=$this->add('Model_User')->getActive();\n\t\t\t$u->load($id);\n // Check if the user wants to get email\n if( ($mode===true) || ($u[$mode]) ) {\n // Check if user is client and status of task not restricted to view by clients\n if((!$u['is_client']) ||\n (($u['is_client']) &&\n (($this->task_status!='started') && ($this->task_status!='finished'))\n )\n ){\n if(!in_array($u['email'],$this->receivers)){\n if ( (!$exclude_myself) || ($u['id']!=$this->app->currentUser()->get('id')) ){\n if($this->isEmail($u['email'])) $this->receivers[]=$u['email'];\n }\n }\n }\n }\n }\n return $this;\n }", "function setTo(& $node)\n {\n $node->setFirstName('Lukas');\n\n $this->to = $node;\n }", "function setToRoleId($toRoleId) {\n\t\t$this->setData('toRoleId', $toRoleId);\n\t}", "public function setToDate($toDate)\n {\n // $this->toDate = $newDate->format('c');\n $this->toDate = $toDate;\n }", "function setBankReceiptNumber($num)\n {\n $this->bank_receipt = $num;\n }", "public function setMailPort($mailPort) {\n \t$this->mailPort = $mailPort;\n }", "function setSwimMeet($swimmeet)\r\n {\r\n $this->_swimmeet = $swimmeet ;\r\n }", "public function set_subscriber($email, $data = NULL);", "function setUserPeer($peer) {\n $this->userPeer = $peer;\n }", "public function setAutoResponderBCC($value) { $this->_autoResponderBCC = $value; }", "public function setRecipient(User $User = NULL) {\r\n if ($User instanceof User) {\r\n $this->Recipient = $User;\r\n \r\n $this->to_user_id = $this->Recipient->id;\r\n $this->to_username = $this->Recipient->username;\r\n $this->to_user_viewonline = $this->Recipient->hide;\r\n $this->to_user_avatar = $this->Recipient->avatar;\r\n }\r\n \r\n return $this;\r\n }", "private function setBotProvider(): void\n {\n $this->providers[Bot::class] = new MessengerProviderDTO(Bot::class);\n }", "public static function setPassword($val) \n { \n emailSettings::$password = $val; \n }", "function receipt ($bool=true) {\n $this->receipt = ($bool);\n }", "public function setIssuer(string $issuer): self\n {\n $this->issuer = $issuer;\n\n return $this;\n }" ]
[ "0.7700908", "0.7649846", "0.6419407", "0.6419407", "0.5890629", "0.5567358", "0.5561879", "0.5523533", "0.5523533", "0.5468228", "0.5445413", "0.5420824", "0.53771716", "0.5359352", "0.52897376", "0.5288955", "0.52343017", "0.5214945", "0.51783353", "0.5148469", "0.51213396", "0.5114469", "0.5105821", "0.50888056", "0.5063844", "0.50577635", "0.5018733", "0.501802", "0.49978068", "0.49844566", "0.4961509", "0.49326196", "0.49249154", "0.49058178", "0.4883737", "0.48275876", "0.4815131", "0.48049596", "0.4804918", "0.4800916", "0.47881925", "0.47779343", "0.47745165", "0.47592762", "0.47583625", "0.47523865", "0.4744254", "0.4744254", "0.4743371", "0.47338128", "0.4732883", "0.4705931", "0.46987575", "0.46956122", "0.46948817", "0.469049", "0.4683978", "0.4670118", "0.46598518", "0.4643174", "0.4637796", "0.46299458", "0.46284965", "0.46233907", "0.46191162", "0.4617912", "0.46160185", "0.46148685", "0.4607466", "0.46015096", "0.46001107", "0.46001107", "0.45782048", "0.45749944", "0.45743197", "0.4570353", "0.45681688", "0.45669207", "0.45668954", "0.45634454", "0.45628998", "0.45623705", "0.45550495", "0.45542824", "0.4542215", "0.4541813", "0.45356774", "0.45321247", "0.45315197", "0.4524629", "0.45194572", "0.4519119", "0.45158142", "0.451077", "0.44958773", "0.44768706", "0.44726515", "0.44673333", "0.44672272", "0.44641307" ]
0.67002964
2
Get original money of the payout
public function getOriginalMoney() { return new Money( $this->getOriginalAmount(), new Currency($this->getOriginalCurrency()) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getOriginalMoney()\n {\n $money = new Money($this->originalAmount, $this->originalCurrency);\n return $money;\n }", "public function getMoney()\n {\n return $this->money;\n }", "public function getMoney()\n {\n return $this->money;\n }", "public function getMoney()\n {\n return $this->money;\n }", "public function getMoney()\n {\n return $this->money;\n }", "public function getMoney()\n {\n return $this->Money;\n }", "public function getOriginalAmount()\n {\n return $this->originalAmount;\n }", "public function OriginalAmount() {\n\t\t// TODO: Multi currency\n\t\t$shopConfig = ShopConfig::current_shop_config();\n\n\t\t$amount = Price::create();\n\t\t$price = $this->Price;\n\t\t$amount->setAmount($price);\n\t\t$amount->setCurrency($shopConfig->BaseCurrency);\n\t\t$amount->setSymbol($shopConfig->BaseCurrencySymbol);\n\n\t\t// Transform amount for applying discounts etc.\n\t\t$this->extend('updateOriginalAmount', $amount);\n\n\t\treturn $amount;\n\t}", "public function getMoney()\n {\n return $this->get(self::_MONEY);\n }", "public function getMoney()\n {\n return $this->get(self::_MONEY);\n }", "public function getMoney()\n {\n return $this->get(self::_MONEY);\n }", "public function getMoney()\n {\n return $this->get(self::_MONEY);\n }", "public function getMoney()\n {\n return $this->get(self::_MONEY);\n }", "public function getMoney()\n {\n return $this->get(self::_MONEY);\n }", "public function toMoney();", "public function money_saved()\n\t{\n\t\t$total_value = self::$_ci->db->where('status', 'pg-success')->select_sum('amount_original')->get('cart_items')->row();\n\t\t$total_value = (float) $total_value->amount_original;\n\t\t$total_spent = self::$_ci->db->where('status', 'pg-success')->select_sum('amount')->get('cart_items')->row();\n\t\t$total_spent = (float) $total_spent->amount;\n\t\t\n\t\t// Calculate saved ammount\n\t\t$total_saved = $total_value - $total_spent;\n\t\t\n\t\treturn $total_saved;\n\t\t\n\t}", "public function OriginalPrice() {\n\t\t$amount = $this->OriginalAmount();\n\n\t\t//Transform price here for display in different currencies etc.\n\t\t$this->extend('updateOriginalPrice', $amount);\n\n\t\treturn $amount;\n\t}", "public function getMoney() {\n\t\t// $this: con tro nội tại của lớp - chính là tên lớp\n\t\treturn $this->money;\n\t}", "public function getAmountMoney(): Money\n {\n return $this->amountMoney;\n }", "public function toMoney()\n {\n return $this->rate;\n }", "public function getOriginalCurrency()\n {\n return $this->originalCurrency;\n }", "public function getCapturedAmount();", "public function getAmount(): Money\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->MoneyAmount;\n }", "public function getCurrentBalance(): Money\n {\n return $this->getBalanceOn(Carbon::now());\n }", "public function getPaymentAmount()\n {\n return $this->bonus + parent::getSalary();\n }", "public function getBaseOriginalAmount()\n {\n return $this->baseOriginalAmount;\n }", "public function difference(Money $money): Money;", "function calculateNetAmount()\n {\n return $this->sellingPrice - 10;\n }", "public function getConvertedAmount() {\n\t\t$money = new Money($this->getAmount(), new Currency($this->getCurrency()));\n\t\treturn $money->getConvertedAmount();\n\t}", "public function getDollarPriceChange(): float;", "public function getCostMoney()\n {\n return $this->get(self::_COST_MONEY);\n }", "public function getCurrentBalanceInDollars()\n {\n return $this->getCurrentBalance()->getAmount() / 100;\n }", "public function getInsuranceAmount();", "public function clone(): Money;", "public function getAmount();", "public function getAmount();", "public function getAmount();", "public function getAmount();", "public function getCashPaidOutMoney(): ?Money\n {\n return $this->cashPaidOutMoney;\n }", "public function getOutstandingAmountInvoice(tx_ptgsaaccounting_erpDocument $invoice) {\n trace($this->precision,0,'this->precision');\n trace($invoice,0,'$invoice');\n $outstandingAmount = bcsub($invoice->get_amountGross(),\n bcadd($invoice->get_credit(),\n bcadd($invoice->get_payment(),$invoice->get_discount(),$this->precision),\n $this->precision),\n $this->precision);\n trace($outstandingAmount,0,'$outstandingAmount');\n return $outstandingAmount;\n }", "public function getOriginalPrice() {\n return $this->item->getOriginalPrice();\n }", "public function getBaseTotalPaid();", "public function getPaidMoney()\n {\n $money = new Money($this->paidAmount, $this->paidCurrency);\n return $money;\n }", "public function getPaymentPrice() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->paymentPrice;\r\n\t}", "function getSystemMoneyValue()\n\t\t{\n\t\t\t$system_value = $this->_BLL_obj->manage_content->getLastValue('system_money_info', '*', 1, 1, 'id');\n\t\t\treturn $system_value[0]['system_balance'];\n\t\t}", "function update_money($account,$total_money,$input_money){\n\t\t$total_money -= $input_money;\n\t\tglobal $connection;\n\t\t$query_mn = mysqli_query($connection,\"UPDATE khachhang SET `money`=$total_money WHERE account='$account'\" );\n\t\treturn $total_money;\n\t}", "public function getBaseOriginalPrice() {\n return $this->item->getBaseOriginalPrice();\n }", "public function getCredit(){\n return $this->priceCurrency->convert($this->getBaseCredit());\n }", "public function getAmountPaid()\n {\n return $this->amountPaid instanceof TypedMoneyBuilder ? $this->amountPaid->build() : $this->amountPaid;\n }", "public function get_total_debit(){\n return $this->get_storage_cost() + $this->get_services_cost();\n }", "private function getOldDeposit()\n {\n return $this->collection->items[$this->cart_hash]->deposit;\n }", "public static function getMoneyObject()\n {\n $money = new FakeMoney();\n $money->setMicroAmount(50000000);\n\n return $money;\n }", "public function get_unpaid_previous_bill_amount( $context = 'view' ) {\n\t\t$unpaid_previous_bill_amount = $this->get_prop( 'unpaid_previous_bill_amount', $context ) ;\n\n\t\tif ( 'view' === $context ) {\n\t\t\treturn wc_price( $unpaid_previous_bill_amount ) ;\n\t\t}\n\n\t\treturn $unpaid_previous_bill_amount ;\n\t}", "public function getamount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getBaseAmount() {\r\n return $this->baseAmount;\r\n }", "private function getPayum()\n {\n return $this->get('payum');\n }", "public function getCashPaidInMoney(): ?Money\n {\n return $this->cashPaidInMoney;\n }", "public function getBalance()\n {\n return (float)$this->client->requestExecute(\"credit\");\n }", "public function presentPrice(){\n \t\n \treturn money_format('$%i', $this->price / 100);\n }", "static function getPrice($procent , $price){\n return $price - ( $price / 100 * $procent);\n }", "public function getAmtPaid()\n {\n return $this->amt_paid;\n }", "function money()\n\t\t{\n\t\t$info = $this->infoarray();\n\t\t$currency = (isset($info['mc_currency']) && Currency::is_valid($info['mc_currency'])) ? $info['mc_currency'] : 'USD';\t# TODO: reject if wrong, not just switch to USD!\n $float = (isset($info['mc_gross'])) ? floatval($info['mc_gross']) : 0; # TODO: ditto\n $c = new Currency($currency);\n $millicents = intval($float * $c->exponent); # convert $5.25 into 52500 millicents\n\t\treturn new Money($millicents, $currency);\n\t\t}", "public function Price() {\n\t\t$amount = $this->Amount();\n\n\t\t//Transform price here for display in different currencies etc.\n\t\t$this->extend('updatePrice', $amount);\n\n\t\treturn $amount;\n\t}", "public function getCoin()\n {\n return $this->coin;\n }", "public function getCoin()\n {\n return $this->coin;\n }", "public function getLastpaymentamount()\n {\n return $this->lastpaymentamount;\n }", "public function getAmount()\r\n {\r\n return $this->amount;\r\n }", "public function getAmount()\r\n {\r\n return $this->amount;\r\n }", "public function getAmount()\r\n {\r\n return $this->amount;\r\n }", "public function getAmount()\r\n {\r\n return $this->amount;\r\n }", "public function getCurrenty()\n {\n return $this->getIfSet('currency', $this->data->amount);\n }", "public function getAmount(): string;", "public function getBaseAmountRefunded() {\n return $this->item->getBaseAmountRefunded();\n }", "public function getAmount() \n {\n return $this->_fields['Amount']['FieldValue'];\n }", "public function getPrice()\n {\n return $this->amount;\n }", "function CurrentBalance($depamount, $prevamount) {\r\n $total = $prevamount + $depamount;\r\n return $total;\r\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\r\n\t{\r\n\t\treturn $this->getTransaction()->getAmount();\r\n\t}", "public function amount(): string\n {\n $amount = 0;\n if ($this->tier === Patreon::PLEDGE_OWLBEAR) {\n $amount = 5;\n } elseif ($this->tier === Patreon::PLEDGE_ELEMENTAL) {\n $amount = 25;\n }\n\n // Offer a free month for those who sub for a year\n if ($this->period === 'yearly') {\n $amount *= 11;\n }\n\n return $this->user->currencySymbol() . ' ' . $amount . '.00';\n }", "public function getAmount(): string\n {\n return $this->amount;\n }", "public function getBaseTotalRefunded();", "public function getCashPaymentMoney(): ?Money\n {\n return $this->cashPaymentMoney;\n }", "public function getBaseAmount()\n {\n return $this->amount;\n }" ]
[ "0.73249215", "0.7073188", "0.7073188", "0.7073188", "0.7073188", "0.696372", "0.6938438", "0.69334996", "0.6856122", "0.6856122", "0.6856122", "0.6856122", "0.6856122", "0.6856122", "0.68265694", "0.68217975", "0.67541957", "0.6698914", "0.6643444", "0.6571189", "0.6544693", "0.65152967", "0.6470024", "0.6447665", "0.6417701", "0.63990235", "0.6396386", "0.6349648", "0.63463306", "0.6305461", "0.62702143", "0.6252004", "0.62445915", "0.6235833", "0.6235535", "0.6213619", "0.6213619", "0.6213619", "0.6213619", "0.6209017", "0.6208733", "0.6193365", "0.61911845", "0.61767554", "0.61482084", "0.6142661", "0.6129267", "0.6127537", "0.6112973", "0.609171", "0.60790896", "0.6073612", "0.60593045", "0.6054719", "0.6052365", "0.60305613", "0.6028215", "0.602439", "0.60073036", "0.60024166", "0.5996802", "0.5992836", "0.5989051", "0.5979923", "0.59779453", "0.59530073", "0.59530073", "0.59486204", "0.5939977", "0.5939977", "0.5939977", "0.5939977", "0.5929791", "0.5920972", "0.59191805", "0.59140927", "0.59096307", "0.59093803", "0.5904142", "0.5904142", "0.5904142", "0.5904142", "0.5904142", "0.5904142", "0.5904142", "0.5904142", "0.5904142", "0.5904142", "0.5904142", "0.5904142", "0.5904142", "0.5904142", "0.5904142", "0.5904142", "0.5901496", "0.59011817", "0.5899536", "0.58974683", "0.58974", "0.5894264" ]
0.7065991
5
Set original money of the payout
public function setOriginalMoney(Money $originalMoney) { $this->setOriginalAmount($originalMoney->getAmount()); $this->setOriginalCurrency($originalMoney->getCurrency()->getCode()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setOriginalMoney(Money $money)\n {\n $this->originalCurrency = $money->getCurrency();\n $this->originalAmount = $money->getAmount();\n }", "public function paid()\n {\n $this->paidAmount = $this->price;\n }", "public function setPrice()\n {\n $price = $this->price;\n $outFix = $this->outFix;\n $outPer = $this->outPer;\n $inPer = $this->inPer;\n $inFix = $this->inFix;\n $flag = $this->flagInOut;\n if ($price < 1) {\n $sumIn = $outFix > 0 ? 1 + $outFix : 1; //outFix\n $sumIn = $outPer > 0 ? $sumIn + ($sumIn * $outPer / 100) : $sumIn; //outPer\n $sumIn = $sumIn / $price; // price\n $sumIn = $inFix > 0 ? $sumIn + $inFix : $sumIn;// inFix\n $ss = $sumIn * $inPer / 100;\n $sumIn = $inPer > 0 ? $sumIn + $ss : $sumIn;\n $this->in = $this->format_amount($sumIn);\n $this->out = $flag ? 1 : 0;\n } else {\n $val = $inFix > 0 ? 1 - $inFix : 1;\n $val = $inPer > 0 ? $val - $val * ($inPer / 100) : $val;\n $sumOut = $price * $val;\n $sumOut = $outFix > 0 ? $sumOut - $outFix : $sumOut;\n $sumOut = $outPer > 0 ? $sumOut - $outPer / 100 * $sumOut : $sumOut;\n $this->out = $this->format_amount($sumOut);\n $this->in = $flag ? 1 : 0;\n }\n $this->price = (float)$price;\n }", "function setPay( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Pay = $value;\n }", "function SetAmountSoldOutside ($amount = 0) {\n\t\n}", "public function OriginalAmount() {\n\t\t// TODO: Multi currency\n\t\t$shopConfig = ShopConfig::current_shop_config();\n\n\t\t$amount = Price::create();\n\t\t$price = $this->Price;\n\t\t$amount->setAmount($price);\n\t\t$amount->setCurrency($shopConfig->BaseCurrency);\n\t\t$amount->setSymbol($shopConfig->BaseCurrencySymbol);\n\n\t\t// Transform amount for applying discounts etc.\n\t\t$this->extend('updateOriginalAmount', $amount);\n\n\t\treturn $amount;\n\t}", "public function asPayout()\n {\n $this->amount = $this->amount * config('foria.tokens.payout');\n\n return $this;\n }", "public function getOriginalMoney()\n {\n return new Money(\n $this->getOriginalAmount(),\n new Currency($this->getOriginalCurrency())\n );\n }", "public function rebase(Money $money): self;", "public function getOriginalMoney()\n {\n $money = new Money($this->originalAmount, $this->originalCurrency);\n return $money;\n }", "function update_money($account,$total_money,$input_money){\n\t\t$total_money -= $input_money;\n\t\tglobal $connection;\n\t\t$query_mn = mysqli_query($connection,\"UPDATE khachhang SET `money`=$total_money WHERE account='$account'\" );\n\t\treturn $total_money;\n\t}", "public function editPriceMoney(){\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "function toPay()\r\n {\r\n try {\r\n $this->mKart->setPaidKart();\r\n }catch(Exception $e){\r\n $this->error->throwException('310', 'No s`ha pogut realitzar el pagament.', $e);\r\n }\r\n }", "public function setMoney(Money $money) : void\n {\n $this->setObject($money);\n $this->initialiseElements();\n $this->populateValues($this->extract());\n }", "public function clone(): Money;", "public function setMoney(Money $money): self\n {\n if ($money->getPrize() !== $this) {\n $money->setPrize($this);\n }\n\n $this->money = $money;\n\n return $this;\n }", "private function sellTrasactionAddsMoney(){\n\n }", "public function asProfit()\n {\n $this->amount = $this->amount * (1 - config('foria.tokens.payout'));\n\n return $this;\n }", "public function setMoney($money)\n {\n $this->money = $money;\n\n return $this;\n }", "public function setMoney($money)\n {\n $this->money = $money;\n\n return $this;\n }", "public function setMoney($money)\n {\n $this->money = $money;\n\n return $this;\n }", "public function setCashPaidOutMoney(?Money $cashPaidOutMoney): void\n {\n $this->cashPaidOutMoney = $cashPaidOutMoney;\n }", "public function toMoney();", "protected function setAmount()\n {\n if ( ! isset( $_POST['amount'] ) ) {\n $this->error = true;\n $this->data['error']['amount'] = 'Please enter a donation amount.';\n return;\n }\n \n $amount = trim( $_POST['amount'] );\n\n // Remove illegal characters\n $regex = '/[[^0-9.]]/';\n $value = preg_replace( $regex, '', $amount );\n \n \tif ( $value && is_numeric( $value ) && $value > 0 ) {\n $value = floor( $value * 100 ); // Set the amount in cents.\n \t\t$this->data['amount'] = $value;\n \t} else {\n \t\t$this->data['amount'] = 0;\n \t}\n }", "protected function setSettlementAmount(array $data)\n {\n $this->settlementAmount = CurrencyAndAmount::fromArray($data);\n }", "public function getOriginalAmount()\n {\n return $this->originalAmount;\n }", "public function payout()\n\t{\n\t}", "public function setAmount()\n {\n $exact = $this->getOriginalPurgeValue('amount_exact');\n $percentage = $this->getOriginalPurgeValue('amount_percentage');\n\n $this->amount = $this->is_percentage\n ? $percentage\n : $exact;\n }", "public function money_saved()\n\t{\n\t\t$total_value = self::$_ci->db->where('status', 'pg-success')->select_sum('amount_original')->get('cart_items')->row();\n\t\t$total_value = (float) $total_value->amount_original;\n\t\t$total_spent = self::$_ci->db->where('status', 'pg-success')->select_sum('amount')->get('cart_items')->row();\n\t\t$total_spent = (float) $total_spent->amount;\n\t\t\n\t\t// Calculate saved ammount\n\t\t$total_saved = $total_value - $total_spent;\n\t\t\n\t\treturn $total_saved;\n\t\t\n\t}", "function setPrice($new_price)\n {\n $this->price = $new_price;\n }", "function set_values() {\n\t\tparent::set_values();\n\t\t$currency = new currency($this->_currency_id);\n\t\t\n\t\t$this->order_id->value = $this->_order_id;\n\t\t$this->timestamp->value = date(\"j M Y\");\n\t\t$this->total_amount->value = $currency->format_money($this->_total_amount);\n\t}", "public function OriginalPrice() {\n\t\t$amount = $this->OriginalAmount();\n\n\t\t//Transform price here for display in different currencies etc.\n\t\t$this->extend('updateOriginalPrice', $amount);\n\n\t\treturn $amount;\n\t}", "private function setDepositFromData()\n {\n if ($this->dataHasDeposit()) {\n $this->collection->items[$this->cart_hash]->deposit = $this->data['deposit'];\n $this->collection->deposit += $this->data['deposit'];\n }\n }", "public function setPaid()\n {\n $this->update([\n 'status' => self::STATUS_PAID,\n 'paid_date' => Carbon::now(),\n ]);\n }", "public function setAppliedMoney(?Money $appliedMoney): void\n {\n $this->appliedMoney = $appliedMoney;\n }", "protected function setInstructedAmount(array $data)\n {\n $this->instructedAmount = CurrencyAndAmount::fromArray($data);\n }", "function deposit($amount) {\n $this->balance += $amount;\n }", "public function setAmount($amount);", "private function sellTrasactionPendingAddsMoney(){\n\n }", "function setBalanceOwing($owed) \n {\n $this->setValueByFieldName('balance_owing',$owed);\n }", "public function setPaidMoney(Money $money)\n {\n $this->paidAmount = $money->getAmount();\n $this->paidCurrency = $money->getCurrency();\n }", "public function setMoney($value)\n {\n return $this->set(self::_MONEY, $value);\n }", "private function recalcCurrentAmount()\n\t{\n\t\t$currentAmount = $this->balanceSheet->getBalanceAmounts()->\n\t\t\t//joinWith('account')->\n\t\t\tleftJoin('balance_item', 'balance_item.id = account.balance_item_id')->\n\t\t\twhere(['balance_item.ref_balance_item_id'=>9])->one();\n\t\tif (!$currentAmount) {\n\t\t\tYii::warning(\"Current Amount not found\");\n\t\t\treturn;\n\t\t}\n\t\tif ($currentAmount->id == $this->id) return;\n\t\t//count diff assets-liabilities+current for selected balance sheet\n\t\t$newAmount = $this->balanceSheet->getTotal(1) - $this->balanceSheet->getTotal(2) + $currentAmount->amount;\n\t\t//set current value to that diff for selected balance sheet\n\t\t$currentAmount->amount = $newAmount;\n\t\t$currentAmount->save();\n\t}", "public function setMoney($value)\n {\n return $this->set(self::_MONEY, $value);\n }", "public function setMoney($value)\n {\n return $this->set(self::_MONEY, $value);\n }", "public function setMoney($value)\n {\n return $this->set(self::_MONEY, $value);\n }", "public function setMoney($value)\n {\n return $this->set(self::_MONEY, $value);\n }", "public function setMoney($value)\n {\n return $this->set(self::_MONEY, $value);\n }", "public function setAmountMoney(Money $amountMoney): void\n {\n $this->amountMoney = $amountMoney;\n }", "public function setMoney($var)\n {\n GPBUtil::checkInt64($var);\n $this->Money = $var;\n\n return $this;\n }", "protected function setMoney($money)\n {\n \tif ($money < 0) {\n \t\tthrow new Exception(\"Money cannot be negative\");\n \t}\n $this->money = $money;\n\n return $this;\n }", "public function updateSellIn() {\n $this->sellIn -= 1;\n }", "public function updateSellIn() {\n $this->sellIn -= 1;\n }", "public function setAmount($amount = 0, $wholeAmt) {\n $amt = array(\n 'x_amount'=>$this->cleanAmt($amount, $wholeAmt),\n );\n $this->NVP = array_merge($this->NVP, $amt); \n }", "private function setCurrency()\n {\n $currency = $this->em->getRepository('ClubUserBundle:LocationConfig')->getObjectByKey('default_currency',$this->order->getLocation());\n\n $this->order->setCurrency($currency);\n $this->order->setCurrencyValue(1);\n }", "public function decreaseAmount(): void;", "public function setAmount($amount){\n\n $this->amount = $amount;\n\n }", "private function updateBalance()\n {\n if (!auth()->user()->hasRole('admin')) {\n auth()->user()->update([\n 'credit' => auth()->user()->credit - $this->totalCost()\n ]);\n }\n }", "public function subtract(Money $money): self;", "public function set_unpaid_previous_bill_amount( $value ) {\n\t\tif ( ! is_numeric( $value ) ) {\n\t\t\tthrow new Exception( esc_html__( 'Invalid unpaid previous bill amount.', 'credits-for-woocommerce' ) ) ;\n\t\t}\n\n\t\t$this->set_prop( 'unpaid_previous_bill_amount', wc_format_decimal( $value ) ) ;\n\t}", "function add_money($account,$total_money,$input_money){\n\t\t$total_money += $input_money;\n\t\tglobal $connection;\n\t\t$query_mn = mysqli_query($connection,\"UPDATE khachhang SET `money`=$total_money WHERE account='$account'\" );\n\t\treturn $total_money;\n\t}", "public function setInvoiceAmountAttribute($input)\n {\n $this->attributes['invoice_amount'] = $input ? $input : null;\n }", "public function setAmountAttribute($input)\n {\n $this->attributes['amount'] = $input ? $input : null;\n }", "public function updatePay(): int {\n if ($this->amtDue === $this->amtPayed) {\n $this->state = State::PAYED;\n $this->appt->state = State::DONE;\n $this->appt->updateTime = new \\DateTime();\n $this->appt->update();\n }\n if ($this->amtDue < $this->amtPayed) {\n $this->amtPayed = $this->amtDue;\n $this->state = State::PAYED;\n $this->appt->state = State::DONE;\n $this->appt->updateTime = new \\DateTime();\n $this->appt->update();\n }\n $this->updateTime = new \\DateTime();\n return self::update();\n }", "public function reset()\n {\n foreach (self::AvailableCoins as $aCoin) {\n \t $sProperty = $aCoin['name'];\n $this->$sProperty = 0;\n }\n }", "public function setDefaultPaxPrice()\n {\n if (!$this->additionalprice) {\n $this->additionalprice = $this->transport ? 25 : $this->price;\n }\n return $this;\n }", "public function setPaymentInfoToQuote()\n {\n $expercashCode = Mage::getModel('expercash/expercashmpf')->getCode();\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n\n if ($quote->isVirtual()) {\n $quote->getBillingAddress()->setPaymentMethod($expercashCode);\n } else {\n $quote->getShippingAddress()->setPaymentMethod($expercashCode);\n }\n\n // shipping totals may be affected by payment method\n if (!$quote->isVirtual() && $quote->getShippingAddress()) {\n $quote->getShippingAddress()->setCollectShippingRates(true);\n }\n\n $payment = $quote->getPayment();\n $payment->importData(array('method' => $expercashCode));\n $quote->save();\n }", "function charge_deposit($acc_number,$sum)\n\t{\n\t $this->db->query(\"UPDATE pamm_summaries SET deposit = deposit+$sum WHERE acc_number=$acc_number\");\n\t}", "function setPrice( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->Price = $value;\n setType( $this->Price, \"double\" );\n }", "public function set_amountInvoice($amountInvoice) {\n $this->amountInvoice = (double)$amountInvoice;\n }", "public function setCustomGiftcardAmount($value);", "public function setAmountAttribute($input)\n { \n $this->attributes['amount'] = $input ? $input : null;\n }", "public function getMoney()\n {\n return $this->Money;\n }", "public function setCoin(string $cryptoCoin);", "public function getMoney()\n {\n return $this->money;\n }", "public function getMoney()\n {\n return $this->money;\n }", "public function getMoney()\n {\n return $this->money;\n }", "public function getMoney()\n {\n return $this->money;\n }", "public function setCashPaidInMoney(?Money $cashPaidInMoney): void\n {\n $this->cashPaidInMoney = $cashPaidInMoney;\n }", "public function setClickPayout($value)\n\t{\n\t\t$this->clickPayout = $value;\n\t}", "public function getOriginalCurrency()\n {\n return $this->originalCurrency;\n }", "public function setShippingPrice() {\n if ($this->price > 200) {\n $this->shippingPrice = 0;\n }\n }", "public function toMoney()\n {\n return $this->rate;\n }", "function setCurrencyCode(){\n switch($this->Currency){\n case \"USD\": $this->CurrencyCode = 840;\n break;\n case \"EUR\": $this->CurrencyCode = 978;\n break;\n case \"AUD\": $this->CurrencyCode = 036;\n break;\n case \"CAD\": $this->CurrencyCode = 124;\n break;\n case \"GBP\": $this->CurrencyCode = 826;\n break;\n case \"JPY\": $this->CurrencyCode = 392;\n break;\n }// end switch\n }", "public function setCashPaymentMoney(?Money $cashPaymentMoney): void\n {\n $this->cashPaymentMoney = $cashPaymentMoney;\n }", "function change_total_price_cdek()\n{\n $price = $_POST['price'];\n $name = $_POST['name'];\n $shipping_cost = $price;\n setcookie('shipping_city_cost', $shipping_cost, time() + (86400 * 30), '/');\n setcookie('shipping_name', $name, time() + (86400 * 30), '/');\n echo 'Shipping cost updated : ' . $shipping_cost;\n wp_die();\n}", "protected function setOfferValue ()\n {\n $this->request->coupon_benefits[ $this->offerNature ] = $this->offer->rate;\n }", "function moneyDistribution($money, $source_id, $destin_id, $payment_type, $pdo_bank, $pdo) {\n $credit_card=$source_id;\n\t\t//buying item\n if($payment_type==0) {\n //debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n }\n //advertising\n elseif ($payment_type==1){\n //debt seller\n //get seller's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from seller account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n \n //cerdit shola\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola account the money debted from seller account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n }\n //auction entrance\n elseif ($payment_type==2){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //auction victory\n elseif ($payment_type==3){\n //debt bidder\n //subtracting entrance fee from total item price\n $entrance_fee=100;\n $money=$money-$entrance_fee;\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n }\n //automatic auction entrance\n elseif ($payment_type==4){\n //debt bidder\n //get bidder's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from bidder account using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n\n //cerdit shola\n //get shola account number\n $shola_temporary_account_number=1000548726;\n //add into shola account the money debted from bidder account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_temporary_account_number]);\n }\n //refund(return item)\n elseif($payment_type==5){\n //credit buyer\n //get buyer's account number using credit_card from given parameter\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $buyer_account = $stmt->fetchAll();\n //add money into buyer's account using account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$buyer_account[0][\"account_number\"]]);\n\n //debt seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //subtract from seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"], \"account_number\"=>$account_number[0][\"account_number\"]]);\n $money=$money-$price;\n //debt shola\n //get shola account number\n $shola_account_number=1000548726;\n //subtract from shola account the money credited for buyer account\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$shola_account_number]);\n\t\t}\n\t\t//if it is split payment\n\t\telseif($payment_type==6){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n $shola_cut=$money*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $price[0][\"price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n //credit shipper\n\t\t\t //get shipper user_id, and shipping price\n $stmt = $pdo->prepare(\"SELECT shipping_price, user_id from shipping where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $ship = $stmt->fetchAll();\n //get credit_card_number for shipper using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$ship[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for shipper using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to shipper's balance an amount of money using price from above as amount of money and account_number from above\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $ship[0][\"shipping_price\"]*0.1, \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t\t//if resolveing debt\n\t\telseif($payment_type==7){\n\t\t\t//debt buyer\n //get buyer's account_number using credit_card_number in the input\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card]);\n $data = $stmt->fetchAll();\n //subtract money from buyer using money as a given parameter and account_number from above \n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance-:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $money, \"account_number\"=>$data[0][\"account_number\"]]);\n //credit shola\n //calculate shola's cut from given money, shola cut is 2%\n\t\t\t\t$interest=interestRate($destin_id);\n $shola_cut=($money+($money*$interest))*0.02;\n $money=$money-$shola_cut;\n //get shola account number\n $shola_account_number=1000548726;\n //add into shola's account an amount of money that is shola_cut from above and using shola_account_number\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" => $shola_cut,\"account_number\"=>$shola_account_number]);\n //credit seller\n //get seller user_id, and item's price\n $stmt = $pdo->prepare(\"SELECT price, user_id from items where item_id=:item_id\");\n $stmt->execute([\"item_id\"=>$destin_id]);\n $price = $stmt->fetchAll();\n //get credit_card_number for seller using user_id from above\n $stmt = $pdo->prepare(\"SELECT credit_card_number from credit_card_history where user_id=:user_id\");\n $stmt->execute([\"user_id\"=>$price[0][\"user_id\"]]);\n $credit_card_number = $stmt->fetchAll();\n //get account_number for seller using credit_card_number from above\n $stmt = $pdo_bank->prepare(\"SELECT account_number from credit_card where credit_card_number=:cred\");\n $stmt->execute([\"cred\"=>$credit_card_number[0][\"credit_card_number\"]]);\n $account_number = $stmt->fetchAll();\n //add to seller's balance an amount of money using price from above as amount of money and account_number from above\t\t\t\t\n $stmt = $pdo_bank->prepare(\"UPDATE bank_account SET balance=balance+:money WHERE account_number=:account_number\");\n $stmt->execute([\"money\" =>$money , \"account_number\"=>$account_number[0][\"account_number\"]]);\n\n\t\t}\n\t}", "public function setAmount($amount)\n {\n $this->amount = $amount;\n }", "public function setAmount($amount)\n {\n $this->amount = $amount;\n }", "public function setSpent($value)\n\t{\n\t\t$this->spent = $value;\n\t}", "private function OldMarginRateInitialSet(&$symbol, $obj)\n {\n $symbol->MarginLong = $symbol->MarginRateInitial[MTEnMarginRateTypes::MARGIN_RATE_BUY];\n $symbol->MarginShort = $symbol->MarginRateInitial[MTEnMarginRateTypes::MARGIN_RATE_SELL];\n\n $marginLimitLong = 0;\n $marginStopLong = 0;\n $marginStopLimitLong = 0;\n\n $marginLimitShort = 0;\n $marginStopShort = 0;\n $marginStopLimitShort = 0;\n\n if($symbol->MarginLong!=0)\n {\n $marginLimitLong = $symbol->MarginRateInitial[MTEnMarginRateTypes::MARGIN_RATE_BUY_LIMIT] / $symbol->MarginLong;\n $marginStopLong = $symbol->MarginRateInitial[MTEnMarginRateTypes::MARGIN_RATE_BUY_STOP] / $symbol->MarginLong;\n $marginStopLimitLong = $symbol->MarginRateInitial[MTEnMarginRateTypes::MARGIN_RATE_BUY_STOP_LIMIT] / $symbol->MarginLong;\n }\n\n if($symbol->MarginShort!=0)\n {\n $marginLimitShort = $symbol->MarginRateInitial[MTEnMarginRateTypes::MARGIN_RATE_SELL_LIMIT] / $symbol->MarginShort;\n $marginStopShort = $symbol->MarginRateInitial[MTEnMarginRateTypes::MARGIN_RATE_SELL_STOP] / $symbol->MarginShort;\n $marginStopLimitShort = $symbol->MarginRateInitial[MTEnMarginRateTypes::MARGIN_RATE_SELL_STOP_LIMIT] / $symbol->MarginShort;\n }\n\n $symbol->MarginLimit = max($marginLimitLong, $marginLimitShort);\n $symbol->MarginStop = max($marginStopLong, $marginStopShort);\n $symbol->MarginStopLimit = max($marginStopLimitLong, $marginStopLimitShort);\n }", "public static function setPrice($intime,$outtime){\n\n $config = json_decode(file_get_contents(dirname(__FILE__).\"/../config.json\"));\n\n $parkedPrice = 0;\n $PriceHour = $config->price->hour;\n $PriceHalfStay = $config->price->halfStay;\n $PriceStay = $config->price->stay;\n\n $parkedTime = $outtime - $intime;\n $timeHour = $config->time->hour;\n $timeHalfStay = $config->time->halfStay;\n $timeStay = $config->time->stay;\n\n while($parkedTime >= $timeStay){\n $parkedPrice += $PriceStay;\n $parkedTime -= $timeStay;\n }\n while($parkedTime >= $timeHalfStay){\n $parkedPrice += $PriceHalfStay;\n $parkedTime -= $timeHalfStay;\n }\n while($parkedTime >= $timeHour){\n $parkedPrice += $PriceHour;\n $parkedTime -= $timeHour;\n }\n if($parkedTime < $timeHour/4){\n $parkedPrice += 0;\n }else{\n $parkedPrice += $PriceHour;\n }\n\n return $parkedPrice;\n }", "public function setAmountCapAttribute($amount)\n {\n $this->attributes['amount_cap'] = formatAmount($amount);\n }", "function NewTaxAmount($amount ,$tax=0.06)\n{\n $amount += $amount * $tax;\n echo \"Total amount: $amount\";\n}", "public function setBaseGrandTotal($amount);", "public function setAmount(Money $amount) {\n\t\t$this->amount = $amount;\n\t\treturn $this;\n\t}", "public function update() {\n $this->connection->update(\n \"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), array(\"idchangemoney\" => $this->observer->idchangemoney), $this->user->iduser\n );\n }", "public function getCashPaidOutMoney(): ?Money\n {\n return $this->cashPaidOutMoney;\n }", "public function choMuonTien() {\n\t\treturn $this->getMoney();\n\t}" ]
[ "0.6551834", "0.64085066", "0.61901927", "0.61463493", "0.6111137", "0.6037891", "0.5994229", "0.5917557", "0.5914871", "0.59041554", "0.5870713", "0.5864051", "0.5851149", "0.5801709", "0.57682943", "0.5655322", "0.5639337", "0.5620461", "0.56163216", "0.56163216", "0.56163216", "0.5600868", "0.55960226", "0.5594686", "0.5592593", "0.558345", "0.5582039", "0.5564495", "0.55402553", "0.5511347", "0.5504243", "0.54951626", "0.54914284", "0.547053", "0.5462905", "0.5446811", "0.544371", "0.54424053", "0.54367596", "0.5425474", "0.5407029", "0.5403144", "0.54026896", "0.5402662", "0.5402662", "0.5402662", "0.5402662", "0.5402662", "0.5401698", "0.5393856", "0.5382607", "0.53514487", "0.53514487", "0.53506786", "0.533829", "0.53111196", "0.5263042", "0.5238469", "0.5233264", "0.5223665", "0.5217169", "0.5215882", "0.5208281", "0.52079624", "0.5196068", "0.51959634", "0.5192006", "0.5187718", "0.51875424", "0.5186976", "0.5179264", "0.5177772", "0.5155817", "0.51537216", "0.5142525", "0.5142525", "0.5142525", "0.5142525", "0.514249", "0.51285225", "0.512061", "0.51178306", "0.51068574", "0.5099096", "0.5092024", "0.50894713", "0.5082726", "0.5080187", "0.5072442", "0.5072442", "0.50687075", "0.50634724", "0.5059806", "0.50523764", "0.5044788", "0.5042115", "0.50356317", "0.50180453", "0.5007928", "0.50073904" ]
0.6264819
2
This returns all merchant analysis and a specific merchant analysis when mc_id is passed
public function get_mc_analysis($mc_id=null) { try { //get global settings if(!$global = DB::table('global')->first()) return; //add constraint for a given mc_id else use foreign key $extra = $mc_id ? "AND ss.user_id = $mc_id" : "AND ss.user_id = u.id"; //merchant analysis query $mca = DB::select(" SELECT u.id as mc_id, CONCAT(u.first_name, ' ', u.last_name) as name, ss.status, ss.created_at as since, m.company_name as merchant, m.osmall_commission, m.mc_sales_staff_commission, c.name as country, sum(p.receivable) as sales_since, count(m.id) as merchant, #revenue_since ( sum(p.receivable) * m.osmall_commission ) as revenue_since, #earn_since case when m.mc_sales_staff_commission > 0 then (m.mc_sales_staff_commission / 100) * sum(p.receivable) else $global->mc_sales_staff_commission * sum(p.receivable) end as earn_since, #outstanding case when m.mc_sales_staff_commission > 0 then sum(p.receivable) * m.mc_sales_staff_commission else sum(p.receivable) * $global->mc_sales_staff_commission end as outstanding, #mp case when (m.mcp1_sales_staff_id <> 0 && m.mcp1_sales_staff_id <> 0) then count(m.id) else 0 end as mp, #sales_ytd ( SELECT SUM(p.receivable) FROM sales_staff ss, merchant m, users u, merchantproduct mp, orderproduct op, porder po, payment p WHERE po.created_at >= concat(year(curdate()),'-01-01') AND ss.id = m.mc_sales_staff_id AND u.id = ss.user_id AND m.id = mp.merchant_id AND op.product_id = mp.product_id AND po.id = op.porder_id AND p.id = po.payment_id AND ss.type = 'mct' AND ss.user_id = u.id ) as sales_ytd, #revenue_ytd ( SELECT SUM(p.receivable) * m.osmall_commission FROM sales_staff ss, merchant m, users u, merchantproduct mp, orderproduct op, porder po, payment p WHERE po.created_at >= concat(year(curdate()),'-01-01') AND ss.id = m.mc_sales_staff_id AND u.id = ss.user_id AND m.id = mp.merchant_id AND op.product_id = mp.product_id AND po.id = op.porder_id AND p.id = po.payment_id AND ss.type = 'mct' AND ss.user_id = u.id ) as revenue_ytd, #earn_ytd ( SELECT ( case when m.mc_sales_staff_commission > 0 then m.mc_sales_staff_commission * sum(p.receivable) else $global->mc_sales_staff_commission * sum(p.receivable) end ) as earn_ytd FROM sales_staff ss, merchant m, users u, merchantproduct mp, orderproduct op, porder po, payment p WHERE po.created_at >= concat(year(curdate()),'-01-01') AND ss.id = m.mc_sales_staff_id AND u.id = ss.user_id AND m.id = mp.merchant_id AND op.product_id = mp.product_id AND po.id = op.porder_id AND p.id = po.payment_id AND ss.type = 'mct' AND ss.user_id = u.id ) as earn_ytd FROM sales_staff ss LEFT JOIN merchant m ON ss.id = m.mc_sales_staff_id LEFT JOIN users u ON u.id = ss.user_id LEFT JOIN country c ON u.nationality_country_id = c.id LEFT JOIN merchantproduct mp ON m.id = mp.merchant_id LEFT JOIN orderproduct op ON op.product_id = mp.product_id LEFT JOIN porder po ON po.id = op.porder_id LEFT JOIN payment p ON p.id = po.payment_id WHERE ss.type = 'mct' $extra "); } catch(QueryException $e){ throw new CustomException($e->getMessage()); } $mca = is_array($mca) && !empty($mca) ? $mca : null; return $mca; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_merchant_sale_groupby_ccode($currentdate,$merchant_id) {\n\tglobal $db;\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.total_fee) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND transaction_alipay.transaction_type IN ('1','s1') AND transaction_alipay.merchant_id ='$merchant_id' AND transaction_alipay.result_code='SUCCESS' AND transaction_alipay.trade_status='TRADE_SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$currentdate') GROUP BY year, month, merchants.currency_code\";\n\t$transactionsDetails = $db->rawQuery($M_R_query);\n\treturn $transactionsDetails;\t\n}", "public function merchant($id = null) {\n\n if ($id == null) {\n $id = $this->account_details['merchant_id'];\n }\n\n if (!isset($this->account_details['access_token'])) {\n throw new GoCardless_ClientException('Access token missing');\n }\n\n return GoCardless_Merchant::find_with_client($this, $id);\n\n }", "public function actionGetMerchantList(){\n $post = Yii::$app->getRequest()->post();\n /*$merchant_ids = explode(','$post['merchant_ids']);*/\n $table = Data::EMAIL_REPORT;\n $table1 = Data::SHOP_DETAILS;\n $query = \"select jet.shop_url,jet.email,er.* from`{$table1}` jet INNER JOIN `{$table}` er ON er.merchant_id=jet.merchant_id where er.email_template_path ='\".$post['template_name'].\"' and er.merchant_id IN (\".$post['merchant_ids'].\") GROUP BY er.merchant_id \";\n $sql1 = Yii::$app->db->createCommand($query);\n $merchantList = $sql1->queryAll();\n if($merchantList){\n echo '<span><b>Email Already sent to these Merchant</b><table class=\"table table-striped table-bordered\"><thead>\n <tr><th>#</th><th>Merchant_Id</th><th>Shop Url</th><th>Email</th><th>Send Date</th><th>Read At</th></tr>\n </thead>\n <tbody>';\n foreach ($merchantList as $key => $value) {\n echo '<tr data-key=\"'.$value['merchant_id'].'\" id =\"'.$value['merchant_id'].'\"><td><input type=\"checkbox\" id=\"'.$value['merchant_id'].'\" class=\"checkbox\" name=\"'.$value['merchant_id'].'\" value=\"'.$value['tracking_id'].'\" checked></td><td>'.$value['merchant_id'].'</td><td>'.$value['shop_url'].'</td><td>'.$value['email'].'</td><td>'.$value['send_at'].'</td><td>'.$value['read_at'].'</td></tr>\n ';\n }\n echo '</tbody></table></span>';\n }\n \n }", "public static function getConfiguration($merchant_id)\n {\n $query = \"SELECT `wsd`.`currency`,`wc`.`consumer_id`,`wc`.`secret_key` FROM `tophatter_configuration` wc INNER JOIN `tophatter_shop_details` wsd ON `wsd`.`merchant_id`=`wc`.`merchant_id` WHERE `wc`.`merchant_id`='\".$merchant_id.\"'\";\n $getConfiguration = self::sqlRecords($query,'one','select');\n return $getConfiguration;\n }", "function getRelatedSamples($id){\n\t\n\t\t$query = 'SELECT * FROM samples As Sample \n\t\t\t\t LEFT JOIN minerals AS Mineral ON Sample.mineral_id=Mineral.id\n\t\t\t\t LEFT JOIN crystal_systems as CrystalSystem ON Mineral.crystal_system_id=CrystalSystem.id\n\t\t\t\t WHERE CrystalSystem.id = '.$id;\n\t\t\n\t\treturn $this->query($query);\n\t\n\t}", "public function getMerchantList(){\r\n\t\t$result = array();\r\n\t\treturn $result;\r\n\t}", "function reviewMilkMachineCleaning($mmc_id)\n\t\t{\n\t\t\t$this->db->select(\"a.*,b.*\");\n\t\t\t$this->db->from(\"da_milking_machine_cleaning as a\");\n\t\t\t$this->db->join(\"da_milking_machine_cleaning_days as b\",\"a.id=b.mmc_id\");\n\t\t\t$this->db->where(\"a.id\",$mmc_id);\n\t\t\t\n\t\t\t$query = $this->db->get();\n\t\t\tif($query->num_rows()>0)\n\t\t\t{\n\t\t\t\t$result = $query->result();\n\t\t\t\t$response = array(\"data_get\"=>\"1\",\"data\"=>$result);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$response = array(\"data_get\"=>\"0\");\n\t\t\t}\n\t\t\t\t\n\t\t\treturn $response;\n\t\t}", "public function get_merchant_shop_data($storeid = \"\")\n\t{\n\t\t$result = $this->db->from(\"stores\")->join(\"city\",\"city.city_id\",\"stores.city_id\")->where(array(\"store_id\" => $storeid))->limit(1)->get();\n\t\treturn $result;\n\t}", "public function getSummaryData()\n\t{\n\t\t\n\t\t$this->load->model('Customer');\n\t\t$return = array();\n\t\t\n\t\t$customer_ids_for_report = array();\n\t\t$customer_id = $this->params['customer_id'];\n\t\t\n\t\tif (!$customer_id)\n\t\t{\n\t\t\t$this->db->select('person_id');\n\t\t\t$this->db->from('customers');\n\t\t\t$this->db->where('balance !=', 0);\n\t\t\t$this->db->where('deleted',0);\n\t\t\t\n\t\t\t$result = $this->db->get()->result_array();\n\t\t\t\n\t\t\tforeach($result as $row)\n\t\t\t{\n\t\t\t\t$customer_ids_for_report[] = $row['person_id'];\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->db->select('person_id');\n\t\t\t$this->db->from('customers');\n\t\t\t$this->db->where('person_id', $customer_id);\n\t\t\t$this->db->where('deleted',0);\n\t\t\t\n\t\t\t$result = $this->db->get()->row_array();\n\t\t\t\n\t\t\tif (!empty($result))\n\t\t\t{\n\t\t\t\t$customer_ids_for_report[] = $result['person_id'];\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\tforeach($customer_ids_for_report as $customer_id)\n\t\t{\n\t\t\t$this->db->select(\"store_accounts.*,sales.sale_time,locations.name as location\");\n\t\t\t$this->db->from('store_accounts');\n\t\t\t$this->db->where('store_accounts.customer_id', $customer_id);\n\t\t\t$this->db->join('sales', 'sales.sale_id = store_accounts.sale_id', 'left');\n\t\t\t$this->db->join('locations', 'sales.location_id = locations.location_id', 'left');\n\t\t\t\n\t\t\t$location_ids = self::get_selected_location_ids();\n\t\t\t$this->db->where_in('sales.location_id',$location_ids);\n\t\t\t\n\t\t\tif ($this->params['pull_payments_by'] == 'payment_date')\n\t\t\t{\n\t\t\t\t$this->db->where('date >=', $this->params['start_date']);\n\t\t\t\t$this->db->where('date <=', $this->params['end_date']. ' 23:59:59');\t\t\t\t\n\t\t\t\t$this->db->order_by('date');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->db->where('sale_time >=', $this->params['start_date']);\n\t\t\t\t$this->db->where('sale_time <=', $this->params['end_date']. ' 23:59:59');\n\t\t\t\t$this->db->order_by('sale_time');\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$result = $this->db->get()->result_array();\n\t\t\t\n\t\t\t//If we don't have results from this month, pull the last store account entry we have\n\t\t\tif (count($result) == 0)\n\t\t\t{\n\t\t\t\t$this->db->select(\"store_accounts.*,sales.sale_time,locations.name as location\");\n\t\t\t\t$this->db->from('store_accounts');\n\t\t\t\t$this->db->where('store_accounts.customer_id', $customer_id);\n\t\t\t\t$this->db->join('sales', 'sales.sale_id = store_accounts.sale_id', 'left');\n\t\t\t\t$this->db->join('locations', 'sales.location_id = locations.location_id', 'left');\n\t\t\t\t$this->db->order_by('sno', 'DESC');\t\t\n\t\t\t\t\n\t\t\t\t$location_ids = self::get_selected_location_ids();\n\t\t\t\t$this->db->where_in('sales.location_id',$location_ids);\n\t\t\t\tif ($this->params['pull_payments_by'] == 'payment_date')\n\t\t\t\t{\n\t\t\t\t\t$this->db->where('store_accounts.date <=', $this->params['end_date']. ' 23:59:59');\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->db->where('sale_time <=', $this->params['end_date']. ' 23:59:59');\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$this->db->limit(1); \t\n\t\t\t\t$result = $this->db->get()->result_array();\n\t\t\t}\n\t\t\t\n\t\t\tfor ($k=0;$k<count($result);$k++)\n\t\t\t{\n\t\t\t\t$item_names = array();\n\t\t\t\t$sale_id = $result[$k]['sale_id'];\n\t\t\t\t\n\t\t\t\t$this->db->select('name, sales_items.description');\n\t\t\t\t$this->db->from('items');\n\t\t\t\t$this->db->join('sales_items', 'sales_items.item_id = items.item_id');\n\t\t\t\t\n\t\t\t\t$this->db->where('sale_id', $sale_id);\n\t\t\t\t\n\t\t\t\tforeach($this->db->get()->result_array() as $row)\n\t\t\t\t{\n\t\t\t\t\t$item_name_and_desc = $row['name'];\n\t\t\t\t\n\t\t\t\t\tif ($row['description'])\n\t\t\t\t\t{\n\t\t\t\t\t\t$item_name_and_desc .= ' - '.$row['description'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$item_names[] = $item_name_and_desc;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->db->select('name');\n\t\t\t\t$this->db->from('item_kits');\n\t\t\t\t$this->db->join('sales_item_kits', 'sales_item_kits.item_kit_id = item_kits.item_kit_id');\n\t\t\t\t$this->db->where('sale_id', $sale_id);\n\t\t\t\t\n\t\t\t\tforeach($this->db->get()->result_array() as $row)\n\t\t\t\t{\n\t\t\t\t\t$item_names[] = $row['name'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$result[$k]['items'] = implode(', ', $item_names);\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($result))\n\t\t\t{\n\t\t\t\t$return[]= array('customer_info' => $this->Customer->get_info($customer_id),'store_account_transactions' => $result);\n\t\t\t}\n\t\t}\n\t\t\t\t\n\t\t\n\t\t$total_amount_due = 0;\n\n\t\tforeach($return as $data) \n\t\t{\n\t\t\t$amount_due = 0;\n\t\t\tforeach($data['store_account_transactions'] as $transaction)\n\t\t\t{\n\t\t\n\t\t\t\t$amount_due = $transaction['balance'];\n\t\t\t}\n\t\t\t$total_amount_due+=$amount_due;\n\t\t}\n\t\t\n\t\treturn $total_amount_due;\n\t}", "public function get_claims(Request $request)\n{\n\n if (!Auth::guard('merchant')->check()) {\n return response([\"status\" => \"fail\", \"message\" => \"Permission Denied. Please log out and login again\"]);\n }\n\n if (auth()->user()->merchant_flagged) {\n $request->user()->token()->revoke();\n return response([\"status\" => \"fail\", \"message\" => \"Account access restricted\"]);\n }\n\n $where_array = array(\n ['merchant_id', '=', auth()->user()->merchant_id],\n ['paid_status', '=', 0],\n ); \n\n $unpaid_redemptions = DB::table('claims')\n ->selectRaw('count(*)')\n ->where($where_array)\n ->get();\n\n $unpaid_redemptions = (array) $unpaid_redemptions[0];\n $unpaid_redemptions = (array) $unpaid_redemptions[\"count(*)\"];\n\n\n $where_array = array(\n ['merchant_id', '=', auth()->user()->merchant_id],\n ); \n\n $claims = DB::table('claims')\n ->select('claims.*')\n ->where($where_array)\n ->get();\n\n\n for ($i=0; $i < count($claims); $i++) { \n\n if($claims[$i]->merchant_id > 0 && $claims[$i]->merchant_id != null){\n $this_merchant = DB::table('merchants')\n ->where(\"merchant_id\", \"=\", $claims[$i]->merchant_id)\n ->get();\n \n if(isset($this_merchant[0])){\n $claims[$i]->merchant_fullname = $this_merchant[0]->merchant_name;\n $claims[$i]->merchant_phone_number = $this_merchant[0]->merchant_phone_number;\n } else {\n $claims[$i]->merchant_fullname = \"[NA]\";\n $claims[$i]->merchant_phone_number = \"[NA]\";\n }\n } else {\n $claims[$i]->merchant_fullname = \"[NA]\";\n $claims[$i]->merchant_phone_number = \"[NA]\";\n }\n\n if($claims[$i]->payer_admin_id > 0 && $claims[$i]->payer_admin_id != null){\n $this_admin = DB::table('administrators')\n ->where(\"admin_id\", \"=\", $claims[$i]->payer_admin_id)\n ->get();\n \n if(isset($this_admin[0])){\n $claims[$i]->admin_fullname = $this_admin[0]->admin_firstname . \" \" . $this_admin[0]->admin_surname;\n } else {\n $claims[$i]->admin_fullname = \"[NA]\";\n }\n } else {\n $claims[$i]->admin_fullname = \"[NA]\";\n }\n }\n\n return response([\n \"status\" => \"success\", \n \"message\" => \"Operation successful\", \n \"unpaid\" => $unpaid_redemptions[0], \n \"merchant_balance\" => auth()->user()->merchant_balance, \n \"claims\" => $claims\n ]);\n }", "public function get_dashboard(Request $request)\n{\n\n if (!Auth::guard('merchant')->check()) {\n return response([\"status\" => \"fail\", \"message\" => \"Permission Denied. Please log out and login again\"]);\n }\n\n if (auth()->user()->merchant_flagged) {\n $request->user()->token()->revoke();\n return response([\"status\" => \"fail\", \"message\" => \"Account access restricted\"]);\n }\n\n $where_array = array(\n ['merchant_id', '=', auth()->user()->merchant_id],\n ); \n\n $unpaid_redemptions = DB::table('redemptions')\n ->selectRaw('count(*)')\n ->where($where_array)\n ->get();\n\n $unpaid_redemptions = (array) $unpaid_redemptions[0];\n $unpaid_redemptions = (array) $unpaid_redemptions[\"count(*)\"];\n\n /*\n $cedis_sum_unpaid_redemptions = DB::table('redemptions')\n ->where($where_array)\n ->sum('redemptions.claim_amount');\n */\n\n\n\n $points_to_one_cedi = DB::table('settings')\n ->where(\"settings_id\", \"=\", \"points_to_one_cedi\")\n ->first();\n\n if($points_to_one_cedi != null){\n $points_to_one_cedi = $points_to_one_cedi->settings_info_1;\n } else {\n $points_to_one_cedi = \"[NA]\";\n }\n \n\n\n $redemptions = DB::table('redemptions')\n ->select('redemptions.*')\n ->where($where_array)\n ->get();\n\n\n\n $where_array = array(\n ['merchant_id', '=', auth()->user()->merchant_id],\n ); \n\n $merchants = DB::table('merchants')\n ->where($where_array)\n ->first();\n\n \n return response([\n \"status\" => \"success\", \n \"message\" => \"Operation successful\", \n \"unpaid\" => $unpaid_redemptions[0], \n \"points_to_one_cedi\" => $points_to_one_cedi, \n \"merchant_balance\" => auth()->user()->merchant_balance, \n \"merchant_vcode\" => auth()->user()->merchant_vcode_link, \n \"redemptions\" => $redemptions, \n \"merchants\" => $merchants\n ]);\n }", "protected function getMerchantId()\r\n {\r\n return $this->processor_data['processor_params']['merchant_id'];\r\n }", "public function merchant()\n {\n return $this->belongsTo(Merchant::class);\n }", "public function actionGetpromotion()\n {\n $sku = false;\n $productdata = \"add sku on url like ?sku=product_sku\";\n if (isset($_GET['sku'])) {\n $sku = $_GET['sku'];\n }\n $merchant_id = '323';\n //$config = Data::getConfiguration($merchant_id);\n $walmartHelper = new Walmartapi('899c9675-6302-43f2-9420-e8f55b176671', 'MIICdQIBADANBgkqhkiG9w0BAQEFAASCAl8wggJbAgEAAoGBAJf0uSx+vD19j4ROQnXj+3nSnwIsSnoRB5VAhDuaiLLDWKQvFbwWB4cAaZNX9fgdyT5KEuiW5QpXNV6ui8B6Ex/lgdlaXaaANnEd8FPjcct4WuGM3JaurUyQj24b7S1eCAPwoJqPyJPjpCQ5OYGgGvi4mHFmawq4rOhgsVT9upIdAgMBAAECgYAxGWob7nd0hvWwknj3Dsta+atXUGhgONBycX5IpA43dNdXdb9YHuYfwQpcCbf4i+dSsSya6ubnCHa+OTf+4XL8A4DnQojj3sfXx6B/N8k4eNHZ8wpbDQAceA+gdw2n466iKfW76cdXiL+2DUhS6qNtvaQ72r5/2KBRgidr7NR7AQJBANdXMA7oOjZ0lOPJCQsSn9nzQqYJMSqN1EvpFMlNX63VnUDlj1kV1MbWbo+sN9AZylrtjcg0YcZenI3bHCvF1QkCQQC0pb5u81zqKOCV7leboWp1LUTmMYWJNeO26lT8knhGN42O2W/+qXI5cJbY3USN32xxX4gK/MtKUBuhZ7Ow+M11AkAUkoLH2c296BNVU55mjWfyFXhXjmdBDn2qpuDSfm7Wl6LHUWcJdrl2KYQ0e5p1ahFX8HvsFX0Fy4IfV0BwuhypAkBQbqvHwtvP9rtohmLDjK9V1P4kcFBAs5ncS6Hjg2PB/+IrhGz1OoT9RkAj9wEbGiuynxJ3se7h+6ER0JaVaXIxAkBNi7N5cfePcyPfXS89NpTtByi+Yg4QQthv9RvCM/TH6yLpMWBWprRq6ufAMl4NHrFXWZRsA7wUqMYHj8+vB18I', '7b2c8dab-c79c-4cee-97fb-0ac399e17ade');\n if ($sku) {\n $productdata = $walmartHelper->getRequest('v3/promo/sku/CE-0000-0149');\n }\n print_r($productdata);\n die;\n }", "public function getMerchantData()\n {\n return $this->merchantData;\n }", "public function getMerchants()\n {\n $obj = new stdClass();\n\n // Must be in specific order for checksum --\n $obj->Timestamp = $this->getTimeStamp();\n $obj->SessionID = $this->getSessionID();\n $obj->PinCode = $this->getPinCode();\n $obj->UserAgent = $this->getUserAgent();\n // -----------------------------------------\n // Generate Checksum\n $obj->Checksum = $this->generateChecksum($obj);\n\n // Ask for getMerchants and get response\n $result = $this->client->getMerChants($obj);\n $result = $result->GetMerchantsResult;\n $merchants = isset($result->Merchants->Merchant) ? $result->Merchants->Merchant : null;\n\n $obj->Timestamp = $result->Timestamp;\n\n if (!is_null($merchants)) {\n // Assign all properties of the Merchants object as property of mainObject\n $obj = $this->parseForChecksum($obj, $merchants, true, array(\"MerchantID\", \"Description\", \"TestMode\"));\n }\n\n // Unset properties for new Checksum\n unset($obj->Checksum);\n\n // Verify response data by making a new Checksum\n $Checksum = $this->generateChecksum($obj);\n\n // Compare Checksums\n if ($result->Checksum != $Checksum)\n throw new Exception('Data could not be verified');\n\n return (array) $merchants;\n }", "public function get_merchant($merchant_reference = \"\"){\r\n $query = $this->db->get_where('tbl_merchant', array('merchant_reference' => $merchant_reference));\r\n return $query->row_array();\r\n }", "public function getMerchantId()\n {\n return $this->merchant_id;\n }", "public function getAllJobs($merchant_id) {\n $stmt = $this->conn->prepare(\"SELECT r.service_date , r.service_time , r.cartype , r.status, a.addressline1 , r.id , d.name from service_request r inner join employee d on (r.employee_id = d.id) inner join user_address a on (r.address_id = a.id) where r.service_provider_id = ? && r.status = 1 order by r.service_date DESC\");\n $stmt->bind_param(\"i\", $merchant_id);\n $stmt->execute();\n $result = $stmt->get_result();\n $stmt->close();\n return $result;\n }", "public function show($id)\n\t{\n\t\t$data = DB::table('ims_patmeds')->where('ref_imsid', $id)->whereNull('ipm_deletedon')->get();\n\n\t\tforeach ($data as $item) {\n\t\t\t$med_id = $item->ref_medid;\n\t\t\tunset($item->ref_medid);\n\n\t\t\t$med = DB::table('ims_meds')->where('med_id', $med_id)->first();\n\t\t\t\n\t\t\t$item->ipm_medicine = $med;\n\t\t}\n\n\t\treturn response()->json($data);\n\t}", "public function getAdsPlans()\r\n {\r\n /*$content_type = [];\r\n $objectManager = $this->blockObjectManager();\r\n $customerSession = $objectManager->create('Magento\\Customer\\Model\\Session');\r\n $customerid = $customerSession->getCustomerId();\r\n $model = $objectManager->create('Webkul\\MpAdvertisementManager\\Model\\Block')->getCollection();\r\n $data = $model->addFieldToFilter('seller_id', array('eq'=> $customerid));\r\n foreach ($data as $collections) {\r\n $content_type[] = $collections->getContentType();\r\n }\r\n $dataCollection = $this->_adsHelper->getAdsPlans()->addFieldToFilter('content_type', array('in'=> array_unique($content_type)));*/\r\n return $this->_adsHelper->getAdsPlans();\r\n // return $dataCollection;\r\n }", "public function index($id)\n { \n $accounts = DB::table('tb_mf_client')\n ->join('tb_mf_client_users', 'tb_mf_client_users.client_id', '=', 'tb_mf_client.client_id')\n ->where('tb_mf_client_users.user_id', '=', $id)\n ->get();\n foreach ($accounts as $account) {\n $client_id = $account->client_id;\n $client_name = $account->client_name;\n }\n\n $totalsales = DB::table('tb_tr_jeep_transactions')\n ->join('tb_mf_jeep', 'tb_mf_jeep.plate_number', '=', 'tb_tr_jeep_transactions.jeep_plate_number')\n ->where('tb_mf_jeep.client_id','=', $client_id)\n ->select(DB::RAW(\"SUM(tb_tr_jeep_transactions.fare) as totalsales\"), DB::raw(\"year(tb_tr_jeep_transactions.created_at) as year\"))\n ->orderBy('tb_tr_jeep_transactions.created_at', 'DESC')\n ->groupBy( DB::raw(\"year(tb_tr_jeep_transactions.created_at)\"))\n // ->groupBy('tb_mf_jeep.client_id')\n ->take(1)\n ->get();\n\n $cardusers = DB::table('tb_mf_carduser_records')\n ->select(DB::RAW(\"COUNT(rfid_number) as totalcardusers\"))\n ->get();\n\n $monthlysales = DB::table('tb_tr_jeep_transactions')\n ->join('tb_mf_jeep', 'tb_mf_jeep.plate_number', '=', 'tb_tr_jeep_transactions.jeep_plate_number')\n ->where('tb_mf_jeep.client_id','=', $client_id)\n ->select( DB::RAW(\"SUM(tb_tr_jeep_transactions.fare) as monthlysales\"),\n DB::RAW(\"DATE_FORMAT(tb_tr_jeep_transactions.created_at, '%Y-%M') as monthyear\"))\n ->orderBy('tb_tr_jeep_transactions.created_at','DESC')\n ->groupBy( DB::raw(\"DATE_FORMAT(tb_tr_jeep_transactions.created_at, '%Y-%M')\"))\n ->take(12)\n ->get()->toarray();\n\n $monthlysales = array_reverse($monthlysales);\n $monthyear = array_column($monthlysales, 'monthyear');\n $monthlysale = array_column($monthlysales, 'monthlysales');\n \n $yearlysales = DB::table('tb_tr_jeep_transactions')\n ->join('tb_mf_jeep', 'tb_mf_jeep.plate_number', '=', 'tb_tr_jeep_transactions.jeep_plate_number')\n ->where('tb_mf_jeep.client_id','=', $client_id)\n ->select( DB::RAW(\"SUM(tb_tr_jeep_transactions.fare) as yearlysales\"),\n DB::RAW(\"YEAR(tb_tr_jeep_transactions.created_at) as year\"))\n ->orderBy('tb_tr_jeep_transactions.created_at','DESC')\n ->groupBy( DB::raw(\"YEAR(tb_tr_jeep_transactions.created_at)\"))\n ->take(5)\n ->get()->toarray();\n\n $yearlysales = array_reverse($yearlysales);\n $year = array_column($yearlysales, 'year');\n $yearlysale = array_column($yearlysales, 'yearlysales');\n \n $faresales = DB::table('tb_tr_jeep_transactions')\n ->join('tb_mf_jeep', 'tb_mf_jeep.plate_number', '=', 'tb_tr_jeep_transactions.jeep_plate_number')\n ->join('tb_mf_carduser_records', 'tb_mf_carduser_records.rfid_number', '=', 'tb_tr_jeep_transactions.rfid_number')\n ->join('tb_mf_cardtype', 'tb_mf_cardtype.cardtype_id', '=', 'tb_mf_carduser_records.cardtype_id')\n ->where('tb_mf_jeep.client_id','=', $client_id)\n ->select(DB::RAW(\"SUM(tb_tr_jeep_transactions.fare) as totalsales\"),'tb_mf_cardtype.cardtype')\n ->orderBy('tb_tr_jeep_transactions.created_at','DESC')\n ->groupBy(\"tb_mf_cardtype.cardtype\")\n ->get()->toarray();\n\n $cardtype = array_column($faresales, 'cardtype');\n $faresale = array_column($faresales, 'totalsales');\n\n \n return view('crm/company/clientdashboard')->with('user_id', $id)->with('client_name', $client_name)\n ->with('totalsales', $totalsales)\n ->with('totalcardusers', $cardusers)\n ->with('monthyear', json_encode($monthyear, JSON_NUMERIC_CHECK))\n ->with('monthlysales', json_encode($monthlysale, JSON_NUMERIC_CHECK))\n ->with('faresales', json_encode($faresale, JSON_NUMERIC_CHECK))\n ->with('cardtype', json_encode($cardtype, JSON_NUMERIC_CHECK))\n ->with('year', json_encode($year, JSON_NUMERIC_CHECK))\n ->with('yearlysales', json_encode($yearlysale, JSON_NUMERIC_CHECK));\n\n }", "public function actionBy_report_id($id){\n Yii::$app->controller->enableCsrfValidation = false;\n\\Yii::$app->response->format=\\Yii\\web\\Response::FORMAT_JSON;\n\n$query=new Query;\n$query->select(['tbl_new_oil.*','tbl_customers.Name','tbl_customers.Branch'])\n->from('tbl_new_oil')\n->join('JOIN',\n'tbl_customers','\ntbl_customers.CustomerID=tbl_new_oil.customer_id')\n->where(['tbl_new_oil.analysis_id'=>$id]);\nreturn $query->one();\n}", "public function index()\n {\n // $merchants = User::role('merchant')->get();\n $merchants = Merchant::all();\n\n return new MerchantIndexResponse($merchants);\n }", "public function getCustomerDetails($customer_id)\r\n {\r\n $business_id = request()->session()->get('business.id');\r\n $query = Contact::leftjoin('transactions AS t', 'contacts.id', '=', 't.contact_id')\r\n ->leftjoin('contact_groups AS cg', 'contacts.customer_group_id', '=', 'cg.id')\r\n ->where('contacts.business_id', $business_id)\r\n ->where('contacts.id', $customer_id)\r\n ->onlyCustomers()\r\n ->select([\r\n 'contacts.contact_id', 'contacts.name', 'contacts.created_at', 'total_rp', 'cg.name as customer_group', 'city', 'state', 'country', 'landmark', 'mobile', 'contacts.id', 'is_default',\r\n DB::raw(\"SUM(IF(t.type = 'sell' AND t.status = 'final', final_total, 0)) as total_invoice\"),\r\n DB::raw(\"SUM(IF(t.type = 'sell' AND t.status = 'final', (SELECT SUM(IF(is_return = 1,-1*amount,amount)) FROM transaction_payments WHERE transaction_payments.transaction_id=t.id), 0)) as invoice_received\"),\r\n DB::raw(\"SUM(IF(t.type = 'sell_return', final_total, 0)) as total_sell_return\"),\r\n DB::raw(\"SUM(IF(t.type = 'sell_return', (SELECT SUM(amount) FROM transaction_payments WHERE transaction_payments.transaction_id=t.id), 0)) as sell_return_paid\"),\r\n DB::raw(\"SUM(IF(t.type = 'opening_balance', final_total, 0)) as opening_balance\"),\r\n DB::raw(\"SUM(IF(t.type = 'advance_payment', -1*final_total, 0)) as advance_payment\"),\r\n DB::raw(\"SUM(IF(t.type = 'opening_balance', (SELECT SUM(IF(is_return = 1,-1*amount,amount)) FROM transaction_payments WHERE transaction_payments.transaction_id=t.id), 0)) as opening_balance_paid\"),\r\n 'email', 'tax_number', 'contacts.pay_term_number', 'contacts.pay_term_type', 'contacts.credit_limit', 'contacts.custom_field1', 'contacts.custom_field2', 'contacts.custom_field3', 'contacts.custom_field4', 'contacts.type'\r\n ])\r\n ->groupBy('contacts.id')->first();\r\n $due = $query->total_invoice - $query->invoice_received + $query->advance_payment;\r\n $return_due = $query->total_sell_return - $query->sell_return_paid;\r\n $opening_balance = $query->opening_balance - $query->opening_balance_paid;\r\n\r\n $total_outstanding = $due - $return_due + $opening_balance ;\r\n if (empty($total_outstanding)) {\r\n $total_outstanding = 0.00;\r\n }\r\n if (empty($query->credit_limit)) {\r\n $credit_limit = 'No Limit';\r\n } else {\r\n $credit_limit = $query->credit_limit;\r\n }\r\n $business_details = Business::find($business_id);\r\n $customer_references = CustomerReference::where('contact_id', $customer_id)->where('business_id', $business_id)->select('reference')->get();\r\n\r\n\r\n return ['total_outstanding' => strval($this->productUtil->num_f($total_outstanding, false, $business_details, true)), 'credit_limit' => strval($credit_limit), 'customer_references' => $customer_references];\r\n }", "function _getMerchantId($method) {\r\n\t\treturn $method->hellaspay_merchant_id;\r\n\t}", "function pzdc_answer_merchants() {\n global $PraizedCommunity;\n return $PraizedCommunity->tpt_answer_merchants();\n}", "public function run()\n {\n $merchants = [\n [\n 'category_id' => '8',\n 'user_id' => '1',\n 'name' => 'Bank Mandiri - KCP Mulyosari',\n 'address' => 'Jl. Raya Mulyosari No.360D, Dukuh Sutorejo, Kec. Mulyorejo, Kota SBY, Jawa Timur 60113'\n ],\n [\n 'category_id' => '8',\n 'user_id' => '2',\n 'name' => 'Bank BCA - KCP Mulyosari',\n 'address' => 'Jl. Raya Mulyosari Z No.56, RW.08, Dukuh Sutorejo, Kec. Mulyorejo, Kota SBY, Jawa Timur 60113'\n ],\n ];\n\n foreach ($merchants as $merchant) {\n Merchant::create($merchant);\n }\n }", "public function index_get($mrm_id = 0)\n\t{\n if(!empty($mrm_id)){\n $data = $this->db->get_where(\"mst_raw_material\", ['mrm_id' => $mrm_id])->row_array();\n }else{\n $data = $this->db->get(\"mst_raw_material\")->result();\n }\n \n $this->response($data, REST_Controller::HTTP_OK);\n\t}", "function ubc_di_get_assessment_results() {\n\t\tglobal $wpdb;\n\t\t$response = array();\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\t$ubc_di_sites = get_posts( array(\n\t\t\t\t'post_type' => 'ubc_di_assess_result',\n\t\t\t\t'order' => 'DESC',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t) );\n\t\t} else {\n\t\t\t$ubc_di_sites = get_posts( array(\n\t\t\t\t'post_type' => 'ubc_di_assess_result',\n\t\t\t\t'order' => 'DESC',\n\t\t\t\t'posts_per_page' => -1,\n\t\t\t) );\n\t\t\t$temp_ubc_di_sites = array();\n\t\t\t$user_id = get_current_user_id();\n\t\t\tforeach ( $ubc_di_sites as $ubc_di_site ) {\n\t\t\t\t$ubc_di_asr_group_id = get_post_meta( $ubc_di_site->ID, 'ubc_di_assessment_result_group', true );\n\t\t\t\t$ubc_di_group_people = get_post_meta( $ubc_di_asr_group_id, 'ubc_di_group_people', true );\n\t\t\t\tif ( '' != $ubc_di_group_people ) {\n\t\t\t\t\tforeach ( $ubc_di_group_people as $ubc_di_group_person ) {\n\t\t\t\t\t\tif ( $user_id == $ubc_di_group_person ) {\n\t\t\t\t\t\t\t$temp_ubc_di_sites[] = $ubc_di_site;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$ubc_di_sites = $temp_ubc_di_sites;\n\t\t}\n\t\tforeach ( $ubc_di_sites as $ubc_di_site ) {\n\t\t\t$temp_array = $this->ubc_di_get_site_metadata( $ubc_di_site->ID );\n\t\t\tif ( null != $temp_array ) {\n\t\t\t\tarray_push( $response, $temp_array );\n\t\t\t}\n\t\t}\n\t\treturn $response;\n\t}", "public function run()\n {\n $items = [\n \n ['id' => '1','mcq_id' => '1', 'answer' => '1+1=2', 'status' => '1'],\n ['id' => '2','mcq_id' => '1', 'answer' => '1+3=2', 'status' => '0'],\n ['id' => '3','mcq_id' => '1', 'answer' => '2+2=5', 'status' => '0'],\n ['id' => '4','mcq_id' => '1', 'answer' => 'None of Above.', 'status' => '0' ],\n ['id' => '5','mcq_id' => '2', 'answer' => 'Nikolai Tesla.', 'status' => '0'],\n ['id' => '6','mcq_id' => '2', 'answer' => 'Alexander Graham Bell.', 'status' => '1'],\n ['id' => '7','mcq_id' => '2', 'answer' => 'Adolf Hitler.', 'status' => '0'],\n ['id' => '8','mcq_id' => '2', 'answer' => 'None of Above.', 'status' => '0' ],\n ['id' => '9','mcq_id' => '3', 'answer' => '1*1=1', 'status' => '1'],\n ['id' => '10','mcq_id' => '3', 'answer' => '1/1=0', 'status' => '0'],\n ['id' => '11','mcq_id' => '3', 'answer' => '2+2=3', 'status' => '0'],\n ['id' => '12','mcq_id' => '3', 'answer' => 'None of Above.', 'status' => '0' ],\n ['id' => '13','mcq_id' => '4', 'answer' => 'Everest isthe Highest Mountain in the world.', 'status' => '1'],\n ['id' => '14','mcq_id' => '4', 'answer' => 'Longest river in Sri Lanka is Kelani river.', 'status' => '0'],\n ['id' => '15','mcq_id' => '4', 'answer' => 'Sun is not a star.', 'status' => '0'],\n ['id' => '16','mcq_id' => '4', 'answer' => 'None of Above.', 'status' => '0' ],\n ];\n foreach ($items as $item) {\n \\App\\McqAnswer::create($item);\n }\n }", "public function getMedsReportByMedication($from,$to,$choice,$sparray)\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$m_arr = array();\r\n\t\t\t\tforeach ($sparray as $var ) {\r\n\t\t\t\t\t$query = \" SELECT DISTINCT\r\n\t\t\t\t\t\t\t\tmr.pig_id,\r\n\t\t\t\t\t\t\t\tmr.med_id,\r\n\t\t\t\t\t\t\t\tm.med_name,\r\n\t\t\t\t\t\t\t\tm.med_type\r\n\t\t\t\t\t\t\t\tFROM med_record mr \r\n\t\t\t\t\t\t\t\tINNER JOIN medication m on\r\n\t\t\t\t\t\t\t\t\tmr.med_id = m.med_id\r\n\t\t\t\t\t\t\t\tWHERE mr.med_id = '\" . $var . \"' and\r\n\t\t\t\t\t\t\t\tmr.date_given BETWEEN '\".$from.\"' and '\".$to.\"'\";\r\n\t\t\t\t\t$result = mysqli_query($link, $query);\r\n\t\t\t\t\t$result2 = mysqli_query($link, $query);\r\n\t\t\t\t\t$m = array();\r\n\t\t\t\t\t//echo 'hey2';\r\n\t\t\t\t\t//console.log(\"HEY\");\r\n\t\t\t\t\t$n = array();\r\n\t\t\t\t\t\r\n\t\t\t\t\t/*while($row = mysqli_fetch_row($result)){\r\n\t\t\t\t\t\t$m[]= $row[0];\r\n\t\t\t\t\t}*/\r\n\t\t\t\t\twhile($row = mysqli_fetch_row($result)){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$m['Med_Name'] = $row[2];\r\n\t\t\t\t\t\t//while($row3 = array_values($m)){\r\n\t\t\t\t\t\t$m['Pig_id'] = $row[0];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//}\r\n\t\t\t\t\t\t$m_arr[] = $m;\r\n\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}\r\n\t\t\t\t\r\n\t\t\t\tif($choice == 'med'){\r\n\t\t\t\t\t$fp = fopen(getenv(\"HOMEDRIVE\") . getenv(\"HOMEPATH\").'\\\\Desktop\\\\reports\\\\medication_reports\\\\mtrans_details_permedication.json', 'w');\r\n\t\t\t\t}\r\n\t\t\t\tfwrite($fp, json_encode($m_arr,JSON_PRETTY_PRINT));\r\n\t\t\t\tfclose($fp);\r\n\t\t\t\treturn $m_arr;\r\n\t\t\t\t\r\n\t\t}", "public function meterialShow($cat_id=null){\n $this->viewBuilder()->setLayout('');\n $findDatas = $this->RequestSlips->RequestSlipRows->RowMaterials->find('list')->where(['row_material_category_id'=>$cat_id]);\n $this->set(compact('findDatas'));\n }", "public function merchant()\n {\n $this->setHeader(self::HEADER_TYPE_BEARER);\n $link = Rakuten::BASE_API_URL.'/'.self::API_NAME_ADVERTISER_SEARCH.'/'.self::API_VERSION;\n\n\n $curl = new Curl;\n $response = $curl->get($link, '', $this->getHeader());\n\n $xmlData = new SimpleXMLElement(XMLHelper::tidy($response));\n\n return $xmlData;\n }", "function ubc_di_get_site_metadata( $ubc_di_asr_id ) {\n\t\t$ubc_di_asr = get_post( $ubc_di_asr_id );\n\t\t$ubc_di_asr_assessment_id = get_post_meta( $ubc_di_asr->ID, 'ubc_di_assessment_result_assessment', true );\n\t\t$ubc_di_asr_site_id = get_post_meta( $ubc_di_asr->ID, 'ubc_di_assessment_result_site', true );\n\t\t$ubc_di_site_meta_content = get_post_meta( $ubc_di_asr->ID, 'ubc_di_assessment_', true );\n\t\t$ubc_di_asr_author = get_user_by( 'id', $ubc_di_asr->post_author );\n\t\t$ubc_di_asr_group_id = get_post_meta( $ubc_di_asr->ID, 'ubc_di_assessment_result_group', true );\n\t\t$ubc_di_asr_group = get_post( $ubc_di_asr_group_id );\n\t\t$temp_array = array();\n\t\t$temp_array['id'] = $ubc_di_asr->ID;\n\t\t$temp_array['date'] = $ubc_di_asr->post_date;\n\t\t$temp_array['uploader'] = $ubc_di_asr_author->first_name . ' ' . $ubc_di_asr_author->last_name . ' (' . $ubc_di_asr_author->ID . ')';\n\t\t$temp_array['uploader_group'] = $ubc_di_asr_group->post_title . ' (#' . $ubc_di_asr_group_id . ')';\n\t\t$temp_array['site'] = get_post( $ubc_di_asr_site_id )->post_title . ' (#' . $ubc_di_asr_site_id . ')';\n\t\t$temp_array['assessment'] = get_post( $ubc_di_asr_assessment_id )->post_title . ' (#' . $ubc_di_asr_assessment_id . ')';\n\t\t$temp_array['assessment_result'] = '<div class=\"button asr-result asr-result-view\" assessment_result=\"' . $ubc_di_asr_id . '\">View Result</div>';\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\t$temp_array['assessment_result_evaluation'] = '<div class=\"button asr-result-evaluate\" assessment_result=\"' . $ubc_di_asr_id . '\">Evaluate</div>';\n\t\t}\n\t\tif ( isset( $_GET['ubc_di_group'] ) && $_GET['ubc_di_group'] != $ubc_di_asr_group_id ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( isset( $_GET['ubc_di_assessment'] ) && $_GET['ubc_di_assessment'] != $ubc_di_asr_assessment_id ) {\n\t\t\treturn;\n\t\t}\n\t\tif ( isset( $_GET['ubc_di_site'] ) && $_GET['ubc_di_site'] != $ubc_di_asr_site_id ) {\n\t\t\treturn;\n\t\t}\n\t\treturn $temp_array;\n\t}", "public function get_merchant_data($userid = \"\")\n\t{\n\t\t\n\t\t$result = $this->db->select(\"*\",\"users.address1 as user_address1\",\"users.address2 as user_address2\",\"users.phone_number as user_phone_number\",\"users.city_id as user_city_id\",\"users.country_id as user_country_id\")->from(\"users\")->join(\"stores\",\"stores.merchant_id\",\"users.user_id\")->where(array(\"user_id\" => $userid,\"stores.store_type\"=>1))->limit(1)->get();\n\n\t\treturn $result;\n \n\t}", "public function getMerchantId(): string\n {\n return $this->merchant_id;\n }", "protected function _setMerchantParameters(&$postData) {\n\t\t$connParams = $this->_getConnectionParameters('payment');\n\t\t\n\t\t$postData['merID'] = $connParams['merchantId'];\n\t\treturn $postData;\n\t}", "function get_merchant_refund_by_ccode($ccode,$currentdate,$merchant_id) {\n\tglobal $db;\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.refund_amount) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND merchants.currency_code= '$ccode' AND transaction_alipay.transaction_type IN ('2','s2') AND transaction_alipay.merchant_id = '$merchant_id' AND transaction_alipay.result_code='SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$currentdate') GROUP BY year, month\";\n\t$transactionsDetails = $db->rawQuery($M_R_query);\n\treturn $transactionsDetails;\n}", "function get_sale_grouplastby_ccode($lastmonthdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.total_fee) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND transaction_alipay.transaction_type IN ('1','s1') AND transaction_alipay.result_code='SUCCESS' AND transaction_alipay.trade_status='TRADE_SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$lastmonthdate') GROUP BY year, month, merchants.currency_code\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\t\r\n}", "public function getMerchant(): ?array\n {\n return $this->merchant;\n }", "public function getAssessmentitems($id,$systemgenerated='0'){\r\n \r\n $query = $this->em->createQuery(\"SELECT A FROM \\Application\\Entity\\Assessmentitem A JOIN A.fkAtid I WHERE A.fkCcid = :course AND I.systemGenerated = :systemgenerated\")\r\n ->setParameter('course', $id)\r\n ->setParameter('systemgenerated', $systemgenerated);\r\n //print_r($query->getSQL());\r\n // die();\r\n return $query->getResult();\r\n }", "function getCampaignInfo ($id) {\n\t\treturn $this->gateway->execCommad('getCampaignInfo',array('id' => $id));\n\t}", "function get_transaction_result_set($agent_id){\n $user=new Policy();\n $transaction_result_set=$user->read_selective_transaction(\"WHERE agent_id=\".$agent_id);\n return $transaction_result_set; \n }", "static function adminGetMetricDetails($id)\r\n {\r\n $id = intval($id);\r\n \r\n $res = array();\r\n \r\n if (!$id)\r\n return $res;\r\n \r\n \r\n $sql = \"SELECT * FROM metric WHERE id=:id LIMIT 1\";\r\n $data = Yii::app()->db->createCommand($sql)\r\n ->bindParam(\":id\", $id, PDO::PARAM_INT)\r\n ->queryRow();\r\n \r\n \r\n $sql = \"SELECT * FROM metric_visits WHERE metric_id=:id ORDER BY last_activity DESC\";\r\n $visits = Yii::app()->db->createCommand($sql)\r\n ->bindParam(\":id\", $id, PDO::PARAM_INT)\r\n ->queryAll(); \r\n \r\n if ($visits)\r\n foreach ($visits as $k=>$v)\r\n {\r\n $visits[$k]['location'] = Yii::app()->location->getLocation($v['location_id']);\r\n }\r\n \r\n $data['visits'] = $visits;\r\n \r\n \r\nFB::warn($data);\r\n \r\n \r\n \r\n/* \r\n $sql = \"SELECT user_id FROM metric WHERE id={$id}\";\r\n $userId = Yii::app()->db->createCommand($sql)->queryScalar();\r\n \r\n \r\n \r\n if ($userId)\r\n {\r\n $sql = \"SELECT id FROM metric WHERE user_id={$userId} ORDER BY id DESC\";\r\n $ids = Yii::app()->db->createCommand($sql)->queryColumn();\r\n }\r\n else\r\n {\r\n $ids[] = $id;\r\n }\r\n \r\n $res['user_id'] = $userId;\r\n \r\n if ($ids)\r\n foreach ($ids as $v)\r\n {\r\n //location\r\n\r\n $sql = \"SELECT ip, location_id,\tadded, last_activity FROM metric WHERE id={$v} LIMIT 1\";\r\n \r\n $m['details'] = Yii::app()->db->createCommand($sql)->queryRow(); \r\n $m['details']['location'] = Yii::app()->location->getLocation($m['details']['location_id']);\r\n \r\n //visits\r\n $sql = \"SELECT * FROM metric_visits WHERE metric_id={$v} ORDER BY id DESC\";\r\n \r\n $m['details'] = Yii::app()->db->createCommand($sql)->queryRow(); \r\n \r\n \r\n \r\n //actions\r\n //$sql = \"SELECT viewed_user_id, added FROM metric_video_play WHERE metric_id={$v} ORDER BY id DESC\";\r\n //$m['details']['videos'] = Yii::app()->db->createCommand($sql)->queryAll();\r\n \r\n $res['info'][] = $m;\r\n }\r\n*/ \r\n \r\n return $data;\r\n }", "public function manageCampaign($id)\n {\n\n $campaign = Campaigns::where('user_id', Auth::guard('client')->user()->id)->find($id);\n\n if ($campaign) {\n\n\n if ($campaign->camp_type == 'regular') {\n $queued = CampaignSubscriptionList::where('campaign_id', $campaign->campaign_id)->where('status', 'queued')->count();\n } else {\n $queued = CampaignSubscriptionList::where('campaign_id', $campaign->campaign_id)->where('status', 'scheduled')->count();\n }\n\n $keyword = Keywords::where('user_id', Auth::guard('client')->user()->id)->get();\n $selected_keywords = explode('|', $campaign->keyword);\n\n $campaign_chart = app()->chartjs\n ->name('campaignChart')\n ->type('pie')\n ->size(['width' => 400, 'height' => 200])\n ->labels(['Delivered', 'Failed', 'Queued'])\n ->datasets([\n [\n 'backgroundColor' => ['#5BC0DE', '#D9534F', '#30DDBC'],\n 'hoverBackgroundColor' => ['#5BC0DE', '#D9534F', '#30DDBC'],\n 'data' => [$campaign->total_delivered, $campaign->total_failed, $queued]\n ]\n ])\n ->options([\n 'legend' => ['display' => true]\n ]);\n\n\n return view('client.manage-campaign-reports', compact('campaign', 'campaign_chart', 'queued', 'keyword', 'selected_keywords'));\n }\n\n return redirect('user/sms/campaign-reports')->with([\n 'message' => 'Campaign info not found',\n 'message_important' => true\n ]);\n\n }", "function get_sale_groupby_ccode($currentdate) {\r\n\tglobal $db;\r\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.total_fee) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND transaction_alipay.transaction_type IN ('1','s1') AND transaction_alipay.result_code='SUCCESS' AND transaction_alipay.trade_status='TRADE_SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$currentdate') GROUP BY year, month, merchants.currency_code\";\r\n\t$transactionsDetails = $db->rawQuery($M_R_query);\r\n\treturn $transactionsDetails;\t\r\n}", "public function get_medal() {\r\r\n\r\r\n $qr = query(\"SELECT DISTINCT medal_type,id FROM medal \");\r\r\n\r\r\n\r\r\n\r\r\n $res = $qr->result();\r\r\n\r\r\n header('Content-Type: application/json; charset=utf-8');\r\r\n\r\r\n echo json_encode($res);\r\r\n\r\r\n }", "public function mcstatAction()\n\t{ \n $time = date('Y-m',strtotime(\"-1 day\"));\n $mc=$this->getAllMc();\n // $all_newplan=$all_newstat=$all_oldplan=$all_oldstat=$all_memberplan=$all_memberstat=array();\n foreach ($mc as $key => $value) {\n \t $user_id=$value['id']; \n\t $ret=McNewService::getInstance()->getUserOneMonthStatistics($user_id,$time); \n\t $data=array(\"user_id\"=>$user_id,\"time\"=>$time,\"value\"=>json_encode($ret));\n\t M(\"McPlanArchive\")->data($data)->add();\n }\n \n\t}", "public function assetTrackingSurveyByCustomer($customer_id)\n {\n if (!$this->isAuthorized) {\n return prepareResult(false, [], [], \"User not authenticate\", $this->unauthorized);\n }\n\n $asset_survey = Survey::with(\n 'surveyCustomer',\n 'surveyCustomer.customer:id,firstname,lastname',\n 'surveyQuestion'\n )\n ->where('survey_type_id', 4)\n ->whereDate('start_date', '<=', date('Y-m-d'))\n ->whereDate('end_date', '>=', date('Y-m-d'))\n ->whereHas('surveyCustomer', function ($query) use ($customer_id) {\n $query->where('customer_id', $customer_id);\n })\n ->orderBy('id', 'desc')\n ->get();\n\n return prepareResult(true, $asset_survey, [], \"asset tracking Survey by customer listing\", $this->success);\n }", "public function getMeds()\n {\n return $this->hasMany(Med::className(), ['medchart_id' => 'id']);\n }", "function _payToMerchant($pay_type = '', $itemIds = array())\r\n {\r\n $conditions = array();\r\n if (!empty($itemIds)) {\r\n $conditions['Item.id'] = $itemIds;\r\n } elseif ($pay_type == 'cron') {\r\n $conditions['Item.item_status_id'] = ConstItemStatus::Closed;\r\n }\r\n $items = $this->find('all', array(\r\n 'conditions' => $conditions,\r\n 'contain' => array(\r\n 'Merchant' => array(\r\n 'fields' => array(\r\n 'Merchant.name',\r\n 'Merchant.id',\r\n 'Merchant.user_id',\r\n 'Merchant.url',\r\n 'Merchant.zip',\r\n 'Merchant.address1',\r\n 'Merchant.address2',\r\n 'Merchant.city_id',\r\n 'Merchant.is_online_account'\r\n ) ,\r\n ) ,\r\n ) ,\r\n 'recursive' => 0,\r\n ));\r\n if (!empty($items)) {\r\n foreach($items as $item) {\r\n $user_id = $item['Merchant']['user_id'];\r\n $amount = ($item['Item']['total_purchased_amount']-($item['Item']['total_commission_amount']+$item['Item']['seller_charity_amount']));\r\n $data = array();\r\n //pay item amount to merchant\r\n $data['Transaction']['user_id'] = ConstUserIds::Admin;\r\n $data['Transaction']['foreign_id'] = $item['Item']['id'];\r\n $data['Transaction']['class'] = 'Item';\r\n $data['Transaction']['amount'] = $amount;\r\n $data['Transaction']['transaction_type_id'] = ConstTransactionTypes::PaidItemAmountToMerchant;\r\n $this->User->Transaction->log($data);\r\n $data = array();\r\n //add record to merchant\r\n $data['Transaction']['user_id'] = $user_id;\r\n $data['Transaction']['foreign_id'] = $item['Item']['id'];\r\n $data['Transaction']['class'] = 'Item';\r\n $data['Transaction']['amount'] = $amount;\r\n $data['Transaction']['transaction_type_id'] = ConstTransactionTypes::ReceivedItemPurchasedAmount;\r\n $this->User->Transaction->log($data);\r\n //amount to charity given //\r\n if (!empty($item['Item']['seller_charity_amount']) && $item['Item']['seller_charity_amount'] > 0) {\r\n $data['Transaction']['user_id'] = $user_id;\r\n $data['Transaction']['foreign_id'] = $item['Item']['id'];\r\n $data['Transaction']['class'] = 'Item';\r\n $data['Transaction']['amount'] = $item['Item']['seller_charity_amount'];\r\n $data['Transaction']['transaction_type_id'] = ConstTransactionTypes::AmountTakenForCharity;\r\n $this->User->Transaction->log($data);\r\n }\r\n\t\t\t\tif (!empty($item['Item']['site_charity_amount']) && $item['Item']['site_charity_amount'] != '0.00') {\r\n\t\t\t\t\t$data['Transaction']['user_id'] = ConstUserIds::Admin;\r\n\t\t\t\t\t$data['Transaction']['foreign_id'] = $item['Item']['id'];\r\n\t\t\t\t\t$data['Transaction']['class'] = 'Item';\r\n\t\t\t\t\t$data['Transaction']['amount'] = $item['Item']['site_charity_amount'];\r\n\t\t\t\t\t$data['Transaction']['transaction_type_id'] = ConstTransactionTypes::AmountTakenForCharityFromAdmin;\r\n\t\t\t\t\t$this->User->Transaction->log($data);\r\n\t\t\t\t}\r\n $this->User->updateAll(array(\r\n 'User.available_balance_amount' => 'User.available_balance_amount +' . $amount,\r\n ) , array(\r\n 'User.id' => $user_id\r\n ));\r\n $paidItemIds[] = $item['Item']['id'];\r\n }\r\n $this->updateAll(array(\r\n 'Item.item_status_id' => ConstItemStatus::PaidToMerchant,\r\n 'Item.end_date' => '\"' . date('Y-m-d H:i:s') . '\"'\r\n ) , array(\r\n 'Item.id' => $paidItemIds\r\n ));\r\n }\r\n }", "function tampil_mahasiswa($id_mhs){\n\t\t\tglobal $con;\n\n\t\t\t$query=mysqli_query($con, \"SELECT a.*,b.*\n\t\t\t\t\t\t\t\t\t\tFROM tb_mahasiswa a,tb_prodi b \n\t\t\t\t\t\t\t\t\t\tWHERE a.id_prodi=b.id_prodi\n\t\t\t\t\t\t\t\t\t\tAND a.id_mhs='$id_mhs'\");\n\t\t\twhile($row=mysqli_fetch_array($query))\n\t\t\t\t$data[] = $row;\n\n\t\t\t\treturn $data;\n\t\t}", "public function show(MerchantPayment $merchantPayment)\n {\n //\n }", "private function getMerchantID()\n\t{\n\t\t$sandbox = $this->params->get('sandbox',0);\n\t\tif($sandbox) {\n\t\t\treturn $this->params->get('sandbox_merchant','');\n\t\t} else {\n\t\t\treturn $this->params->get('merchant','');\n\t\t}\n\t}", "public function setMerchantId($merchant_id)\n {\n $this->merchant_id = $merchant_id;\n return $this;\n }", "public function setMerchantId($value)\n {\n return $this->setParameter('merchantId', $value);\n }", "public function getStokSite($id){\n try{\n $m_item_id = $_GET['m_item_id'];\n } catch(Exception $e) {\n $m_item_id = null;\n }\n\n if($m_item_id == null) {\n $datas = DB::select(\"\n select \n (COALESCE(inv_in.site_id, inv_out.site_id)) as site_id, \n (COALESCE(inv_in.m_item_id, inv_out.m_item_id)) as m_item_id,\n (COALESCE(inv_in.m_warehouse_id, inv_out.m_warehouse_id)) as m_warehouse_id, \n (COALESCE(inv_in.amount, 0)) as amount_in,\n (COALESCE(inv_out.amount, 0)) as amount_out,\n (COALESCE(inv_out.amount_ret, 0)) as amount_ret,\n ((COALESCE(inv_in.amount, 0)) - ((COALESCE(inv_out.amount, 0)) - (COALESCE(inv_out.amount_ret, 0)))) as stok,\n inv_in.updated_at as last_update_in,\n inv_out.updated_at as last_update_out\n from (select site_id, m_item_id, sum(amount) as amount, itd.m_warehouse_id as m_warehouse_id, max(it.updated_at) as updated_at from inv_trxes it\n join inv_trx_ds itd on it.id = itd.inv_trx_id\n where is_entry = true and site_id = \".$id.\" and trx_type != 'RET_ITEM'\n group by site_id, m_item_id, itd.m_warehouse_id) inv_in\n full outer join (select site_id, m_item_id, itd.m_warehouse_id, coalesce((SELECT sum(amount) as amount from inv_trxes it1\n join inv_trx_ds itd1 on it1.id = itd1.inv_trx_id\n where trx_type = 'RET_ITEM' and it1.site_id=it.site_id and itd1.m_item_id=itd.m_item_id and itd1.m_warehouse_id=itd.m_warehouse_id), 0) AS amount_ret, sum(amount) as amount, max(it.updated_at) as updated_at from inv_trxes it\n join inv_trx_ds itd on it.id = itd.inv_trx_id\n where is_entry = false and site_id = \".$id.\" \n group by site_id, m_item_id, itd.m_warehouse_id) inv_out on inv_in.m_item_id = inv_out.m_item_id and inv_in.site_id = inv_out.site_id and inv_in.m_warehouse_id = inv_out.m_warehouse_id\n \");\n } else {\n $datas = DB::select(\"\n select \n (COALESCE(inv_in.site_id, inv_out.site_id)) as site_id, \n (COALESCE(inv_in.m_item_id, inv_out.m_item_id)) as m_item_id,\n (COALESCE(inv_in.m_warehouse_id, inv_out.m_warehouse_id)) as m_warehouse_id, \n (COALESCE(inv_in.amount, 0)) as amount_in,\n (COALESCE(inv_out.amount, 0)) as amount_out,\n (COALESCE(inv_out.amount_ret, 0)) as amount_ret,\n ((COALESCE(inv_in.amount, 0)) - ((COALESCE(inv_out.amount, 0)) - (COALESCE(inv_out.amount_ret, 0)))) as stok,\n inv_in.updated_at as last_update_in,\n inv_out.updated_at as last_update_out\n from (select site_id, m_item_id, sum(amount) as amount, itd.m_warehouse_id as m_warehouse_id, max(it.updated_at) as updated_at from inv_trxes it\n join inv_trx_ds itd on it.id = itd.inv_trx_id\n where is_entry = true and site_id = \".$id.\" and m_item_id = \".$m_item_id.\" and trx_type != 'RET_ITEM'\n group by site_id, m_item_id, itd.m_warehouse_id) inv_in\n full outer join (select site_id, m_item_id, itd.m_warehouse_id as m_warehouse_id, coalesce((SELECT sum(amount) as amount from inv_trxes it1\n join inv_trx_ds itd1 on it1.id = itd1.inv_trx_id\n where trx_type = 'RET_ITEM' and it1.site_id=it.site_id and itd1.m_item_id=itd.m_item_id and itd1.m_warehouse_id=itd.m_warehouse_id), 0) AS amount_ret, sum(amount) as amount, max(it.updated_at) as updated_at from inv_trxes it\n join inv_trx_ds itd on it.id = itd.inv_trx_id\n where is_entry = false and site_id = \".$id.\" and m_item_id = \".$m_item_id.\"\n group by site_id, m_item_id, itd.m_warehouse_id) inv_out on inv_in.m_item_id = inv_out.m_item_id and inv_in.site_id = inv_out.site_id\n \");\n }\n\n foreach($datas as $data) {\n $data->sites = Site::find($data->site_id);\n $data->m_items = DB::select('select * from m_items where id = ' . $data->m_item_id)[0];\n $data->m_units = MUnit::find($data->m_items->m_unit_id);\n $data->m_warehouse = DB::table('m_warehouses')->where('id', $data->m_warehouse_id)->first();\n // harga average tiap item\n $get_save_price=DB::table('m_item_prices')->where(['m_item_id' => $data->m_item_id, 'site_id' => $data->site_id])->first();\n \n // harga satuan (dari tanggal terakhir)\n // $last_price = DB::select(\"select pd.base_price from inv_trxes it\n // join purchases p on it.purchase_id = p.id\n // join purchase_ds pd on p.id = pd.purchase_id\n // where it.is_entry = true and it.site_id = ? and pd.m_item_id = ?\n // order by it.created_at desc limit 1\", [$data->site_id, $data->m_item_id]);\n $data->last_price = $get_save_price != null ? $get_save_price->price : 0;\n\n // nilai material\n $value = 0;\n $data_values = DB::select(\"select pd.amount, pd.base_price from inv_trxes it\n join purchases p on it.purchase_id = p.id\n join purchase_ds pd on p.id = pd.purchase_id\n where it.is_entry = true and it.site_id = ? and pd.m_item_id = ?\", [$data->site_id, $data->m_item_id]);\n foreach($data_values as $data_value) {\n $amount = $data_value->amount != null ? $data_value->amount : 0;\n $price = $data_value->base_price != null ? $data_value->base_price : 0;\n $value += $amount * $price; \n }\n $data->value = $value;\n }\n\n return response()->json(['data' => $datas]);\n }", "public function getMedsReport($from,$to,$choice,$sparray)\r\n\t\t{\r\n\t\t\t\t$link = $this->connect();\r\n\t\t\t\t$m_arr = array();\r\n\t\t\t\tforeach ($sparray as $var ) {\r\n\t\t\t\t\t$query = \" SELECT DISTINCT \r\n\t\t\t\t\t\t\t\tmr.date_given,\r\n\t\t\t\t\t\t\t\tmr.time_given,\r\n\t\t\t\t\t\t\t\tmr.quantity,\r\n\t\t\t\t\t\t\t\tmr.unit,\r\n\t\t\t\t\t\t\t\tmr.pig_id,\r\n\t\t\t\t\t\t\t\tmr.med_id,\r\n\t\t\t\t\t\t\t\tm.med_name,\r\n\t\t\t\t\t\t\t\tm.med_type\r\n\t\t\t\t\t\t\t\tFROM med_record mr \r\n\t\t\t\t\t\t\t\tINNER JOIN medication m on\r\n\t\t\t\t\t\t\t\t\tmr.med_id = m.med_id\r\n\t\t\t\t\t\t\t\tWHERE mr.pig_id = '\" . $var . \"' and\r\n\t\t\t\t\t\t\t\tmr.date_given BETWEEN '\".$from.\"' and '\".$to.\"'\";\r\n\t\t\t\t\t$result = mysqli_query($link, $query);\r\n\t\t\t\t\t$m = array();\r\n\t\t\t\t\t\r\n\t\t\t\t\twhile($row = mysqli_fetch_row($result)){\r\n\t\t\t\t\t\t$m['Pig_id'] = $row[4];\r\n\t\t\t\t\t\t$date = date_create($row[0]);\r\n\t\t\t\t\t\t$m['Date_given'] = $date->format('F j,Y');\r\n\t\t\t\t\t\t$m['Time_given'] = $row[1];\r\n\t\t\t\t\t\t$m['Quantity'] = $row[2];\r\n\t\t\t\t\t\t$m['Unit'] = $row[3];\r\n\t\t\t\t\t\t$m['Feed_name'] = $row[6];\r\n\t\t\t\t\t\t$m['Feed_type'] = $row[7];\r\n\t\t\t\t\t\t$m_arr[] = $m;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif($choice == 'batch'){\r\n\t\t\t\t\t$fp = fopen(getenv(\"HOMEDRIVE\") . getenv(\"HOMEPATH\").'\\\\Desktop\\\\reports\\\\medication_reports\\\\mtrans_details_perbatch.json', 'w');\r\n\t\t\t\t}else if($choice == 'house'){\r\n\t\t\t\t\t$fp = fopen(getenv(\"HOMEDRIVE\") . getenv(\"HOMEPATH\").'\\\\Desktop\\\\reports\\\\medication_reports\\\\mtrans_details_perhouse.json', 'w');\r\n\t\t\t\t}else if($choice == 'pen'){\r\n\t\t\t\t\t$fp = fopen(getenv(\"HOMEDRIVE\") . getenv(\"HOMEPATH\").'\\\\Desktop\\\\reports\\\\medication_reports\\\\mtrans_details_perpen.json', 'w');\r\n\t\t\t\t}else if($choice == 'pig'){\r\n\t\t\t\t\t$fp = fopen(getenv(\"HOMEDRIVE\") . getenv(\"HOMEPATH\").'\\\\Desktop\\\\reports\\\\medication_reports\\\\mtrans_details_perpig.json', 'w');\r\n\t\t\t\t}\r\n\t\t\t\tfwrite($fp, json_encode($m_arr,JSON_PRETTY_PRINT));\r\n\t\t\t\tfclose($fp);\r\n\t\t\t\treturn $m_arr;\r\n\t\t\t\t\r\n\t\t}", "public function store_items_report($category_id,$branch_id,$year,$month)\n {\n $query = $this->db->query(\" SELECT CASE WHEN sp.`unit`=0 THEN 'none' WHEN sp.`unit`=1 THEN 'kg' WHEN sp.`unit`=2 THEN 'gm' WHEN sp.`unit`=3 THEN 'l' WHEN sp.`unit`=4 THEN 'ml' END AS unit, sp.`name`, NULL AS open_stock, c.`cat_name`, spi.`price`, (SELECT SUM(ssi.`today_purchase_qty`) FROM store_inward ssi WHERE ssi.`store_product_inward_id` = spi.`store_product_inward_id`) AS purchase, (SELECT SUM(sub_sin.`instock`) FROM store_instock sub_sin WHERE sub_sin.`store_product_inward_id` = spi.`store_product_inward_id`) AS instock, NULL AS cons_amt, NULL AS close_amt\n FROM store_product_inward spi \n LEFT JOIN `store_inward` si ON si.`store_product_inward_id` = spi.`store_product_inward_id` \n LEFT JOIN `store_product` sp ON sp.`store_product_id` = spi.`store_product_id` \n LEFT JOIN `category` c ON c.`category_id` = sp.`category_id` \n LEFT JOIN `store_instock` s_in ON s_in.`store_product_inward_id` = spi.`store_product_inward_id` \n WHERE MONTH(si.`created`) = '\".$month.\"' AND YEAR(si.`created`) = '\".$year.\"' AND c.category_id='\".$category_id.\"' AND spi.branch_id='\".$branch_id.\"'\n GROUP BY sp.`store_product_id` \");\n\n // $str = $this->db->last_query();\n // echo $str;die;\n\n\n $result = $query->result_array();\n return $result;\n\n }", "function get_merchant_cancel_by_ccode($ccode,$currentdate,$merchant_id) {\n\tglobal $db;\n\t$M_R_query=\"SELECT merchants.currency_code, YEAR(transaction_alipay.trans_datetime) AS year, MONTH(transaction_alipay.trans_datetime) AS month, COUNT(DISTINCT transaction_alipay.id_transaction_id) AS transcount, SUM(transaction_alipay.total_fee) AS transamount FROM merchants JOIN transaction_alipay ON transaction_alipay.merchant_id = merchants.mer_map_id AND merchants.currency_code= '$ccode' AND transaction_alipay.transaction_type IN ('4','s4')\n\t\tAND transaction_alipay.merchant_id ='$merchant_id' AND transaction_alipay.result_code='SUCCESS' AND MONTH(transaction_alipay.trans_datetime) = MONTH('$currentdate') GROUP BY year, month\";\n\t$transactionsDetails = $db->rawQuery($M_R_query);\n\treturn $transactionsDetails;\n}", "public function getAllMemberCards()\n {\n \n $query = \"SELECT MID, LoyaltyCardNumber FROM transactionsummary ORDER BY LoyaltyCardNumber ASC\";\n \n return parent::RunQuery($query);\n }", "public function getAttributeGroup($id)\n { \n if (\\Gate::allows('isAdminOrMerchant')) { \n \n return AttributeGroup::latest()->where('merchant_id',Auth::user()->userable_id)->where('id',$id)->first();\n } \n }", "private function getMedication($id) \n {\n // we dont select * as any updates to the table would cause unneccessary data to be loaded such as the GUID\n $this->db->select('Medication_YN, \n Medication_1, medication_dosage_1, medication_frequency_1, \n Medication_2, medication_dosage_2, medication_frequency_2, \n Medication_3, medication_dosage_3, medication_frequency_3');\n $this->db->where('userid', $id);\n $query = $this->db->get('medication');\n\n return $query;\n\n }", "public function show($id)\n {\n return Merchant::where('id', $id)\n ->select('latitude', 'longitude')\n ->get();\n }", "public function get_custmer_all_data()\n\t{\n\t\t\t\n\t\t\t$id = $this->input->post('id');\n\t\t\t$this->load->model('paymentmonthlycustomer_model','my_model');\n\t\t\t$data['monthly'] = $this->my_model->get_addcustomer_monthy_specific_records($id);\n\t\t\t$data['reading'] = $this->my_model->get_monthly_billing($id) ; \n\t\t\t$data['record'] = $this->my_model->get_addcustomer_add_all_records($id);\n\t\t\t$this->load->view($this->addpages_ajax,$data);\n\t\t\t\n\t}", "public function statisticCustomerMoneyBy($customer_id) {\n $q = \"SELECT DATE_FORMAT(created_at,'%Y-%m') as month, SUM(cost) as total_money \n FROM (SELECT * FROM itinerary WHERE customer_id = ?) as i GROUP BY DATE_FORMAT(created_at,'%Y-%m') \";\n \n $stmt = $this->conn->prepare($q);\n if ($stmt->bind_param(\"i\",$customer_id)) {\n $stmt->execute();\n } else {\n var_dump($this->db->error);\n } \n $results = $stmt->get_result();\n\n $stats = array();\n // looping through result and preparing tasks array\n while ($stat = $results->fetch_assoc()) {\n $tmp = array();\n\n $tmp[\"month\"] = $stat[\"month\"];\n $tmp[\"total_money\"] = $stat[\"total_money\"];\n\n array_push($stats, $tmp);\n }\n\n $stmt->close();\n return $stats;\n }", "function filter_mellat_pay_channel_pay_answer($transaction){\n $terminalId\t\t= \"xxxxx\"; //-- شناسه ترمینال\n $userName\t\t= \"xxxxx\"; //-- نام کاربری\n $userPassword\t= \"xxxxx\"; //-- کلمه عبور\n\n $ResCode \t\t= (isset($_POST['ResCode']) && $_POST['ResCode'] != \"\") ? $_POST['ResCode'] : \"\";\n\n if ($ResCode == '0')\n {\n $client \t\t\t\t= new nusoap_client('https://bpm.shaparak.ir/pgwchannel/services/pgw?wsdl');\n $namespace \t\t\t\t='http://interfaces.core.sw.bps.com/';\n $orderId \t\t\t\t= (isset($_POST['SaleOrderId']) && $_POST['SaleOrderId'] != \"\") ? $_POST['SaleOrderId'] : \"\";\n $verifySaleOrderId \t\t= (isset($_POST['SaleOrderId']) && $_POST['SaleOrderId'] != \"\") ? $_POST['SaleOrderId'] : \"\";\n $verifySaleReferenceId \t= (isset($_POST['SaleReferenceId']) && $_POST['SaleReferenceId'] != \"\") ? $_POST['SaleReferenceId'] : \"\";\n\n $parameters = array(\n 'terminalId' \t\t=> $terminalId,\n 'userName' \t\t\t=> $userName,\n 'userPassword' \t\t=> $userPassword,\n 'orderId' \t\t\t=> $orderId,\n 'saleOrderId' \t\t=> $verifySaleOrderId,\n 'saleReferenceId' \t=> $verifySaleReferenceId\n );\n\n $result = $client->call('bpVerifyRequest', $parameters, $namespace);\n\n if($result == 0)\n {\n $result = $client->call('bpSettleRequest', $parameters, $namespace);\n\n if($result == 0)\n {\n $transaction->setStatus(PayChannelTransaction::STATUS_PAID);\n }\n }\n }\n #TODO: handling mellat pay answer error\n return $transaction;\n}", "public function show($chemical_med_feed_inputs_id)\n {\n \n \n $chemical = agriculture_chemical_med_feed_input_model::findOrfail($chemical_med_feed_inputs_id);\n\n \n echo json_encode($chemical); \n }", "private function setMerchantD()\n {\n $this->mid = config('gladepay.mid');\n }", "public function getMedics()\n {\n $search['q'] = request('q');\n $search['clinic'] = request('clinic');\n \n \n $medics = $this->medicRepo->findAllWithoutPaginate($search);\n\n \n \n return $medics;\n \n }", "public function getMyMoudles($where){\n\n\t\t$res = $this->db->get_where(\"transaction_details\", $where);\n\t\tif($res->num_rows()){\n\t\t\t$result = $res->result();\n\t\t\treturn $result;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function show($medical_id)\n {\n return $this->medications->where($medical_id);\n\n }", "public function get_customer(){\n $name = trim($this->input->post('name') , ' ');\n $type = $this->input->post('type');\n if($type == 'buy'){\n $data['cust'] = $this->base_model->run_query(\"SELECT d.customer_id, SUM(d.rest) AS rest, SUM(d.volume) AS volume, max(h.volume_handle) AS handle , c.fullname FROM deal d LEFT JOIN (SELECT buy_id, SUM(volume_handle) AS volume_handle FROM handle GROUP BY buy_id) h ON h.buy_id = d.customer_id inner join customer c on c.id = d.customer_id where d.type = 1 AND c.fullname = '$name' GROUP BY d.customer_id\" , 'row');\n if(!empty($data['cust'])){\n $cust_id = $data['cust']->customer_id;\n $data['bank'] = $this->base_model->get_data('bank' , 'id , rest_handle , rest , explain' , 'result' , array('customer_id'=>$cust_id , 'active'=>1)); \n }else{\n $data['bank'] = array();\n }\n }else{\n $data['cust'] = $this->base_model->run_query(\"SELECT d.customer_id, SUM(d.rest) AS rest, SUM(d.volume) AS volume, max(h.volume_handle) AS handle , c.fullname FROM deal d LEFT JOIN (SELECT sell_id, SUM(volume_handle) AS volume_handle FROM handle GROUP BY sell_id) h ON h.sell_id = d.customer_id inner join customer c on c.id = d.customer_id where d.type = 2 AND c.fullname = '$name' GROUP BY d.customer_id\" , 'row');\n }\n echo json_encode($data);\n }", "public function actionStatistics($id)\n\t{\n include(\"pChart/pData.class\");\n include(\"pChart/pChart.class\");\n\n $model=$this->loadModel($id);\n $omiAudModel = OmiTargetAudience::model()->findAllByAttributes(array('quiz_id'=>$id));\n\n $resStat = array();\n if(count($model->applications) > 0){\n $arrStat = array();\n $audiences = $model->audience;\n $applications = array();\n $arrAudience = array();\n\n foreach ($audiences as $a => $audience) {\n $respondents = $audience->getRespondents();\n $applications = $model->applications(array('condition'=>'respondent_id IN (0'.implode(',',array_keys($respondents)).')'));\n array_push($arrAudience, array('audience'=>$audience, 'respondents'=>$respondents, 'applications'=>$applications));\n }\n\n foreach ($model->groupsQuestions as $g => $group) {\n foreach ($group->questions as $q => $question) {\n if($question['type'] != Question::TYPE_OPEN && $question['type'] != Question::TYPE_ANSWPHOTO) {\n $arrStat = array('question'=>$question);\n //$arrStat['answers'] = array();\n foreach ($arrAudience as $aud => $audience) {\n if($audience['applications']){\n $arrStat['answers'][$aud] = $question->getStatsAnswers('qa.application_id IN ('.implode(',',array_keys($audience['applications'])).')');\n if(array_filter($arrStat['answers'][$aud]) && $question['type'] != Question::TYPE_SCALE_SCORE){\n $arrStat['answers'][$aud]['chart'] = Utils::chart(array_values($arrStat['answers'][$aud]), Answer::legendAnswers(array_keys($arrStat['answers'][$aud])), $question['id'].'_'.$aud);\n $arrStat['answers'][$aud]['pie'] = Utils::chart(array_values($arrStat['answers'][$aud]), Answer::legendAnswers(array_keys($arrStat['answers'][$aud])), $question['id'].'_'.$aud, 1);\n \t// для вывода Google Chart формируем название для div\n \t$arrStat['answers'][$aud]['group'] = Str_Replace(Array(\"{\", \"}\", \"-\"), \"D\", $question['id'].'_'.$aud);\n\n }\n }\n }\n\n if(isset ($_GET['omi_aud_id']))\n $arrStat['answers'][$aud + 1] = $question->getStatsAnswers('', array(),$id,$_GET['omi_aud_id']);\n else\n $arrStat['answers'][$aud + 1] = $question->getStatsAnswers();\n \n if(array_filter($arrStat['answers'][$aud + 1]) && $question['type'] != Question::TYPE_SCALE_SCORE){\n //$arrStat['answers'][$aud + 1]['chart'] = Utils::chart(array_values($arrStat['answers'][$aud + 1]), Answer::legendAnswers(array_keys($arrStat['answers'][$aud + 1])), $question['id'].'_'.($aud + 1));\n //$arrStat['answers'][$aud + 1]['pie'] = Utils::chart(array_values($arrStat['answers'][$aud + 1]), Answer::legendAnswers(array_keys($arrStat['answers'][$aud + 1])), $question['id'].'_'.($aud + 1), 1);\n \t// для вывода Google Chart формируем название для div\n \t$arrStat['answers'][$aud + 1]['group'] = Str_Replace(Array(\"{\", \"}\", \"-\"), \"D\", $question['id'].'_'.($aud + 1));\n }\n\n array_push($resStat, $arrStat);\n }\n else if ($question['type'] == Question::TYPE_ANSWPHOTO) {\n \t$arrStat = array('question'=>$question);\n\n\t\t\t\t $photos = Yii::app()->db->createCommand()\n\t\t\t\t ->select('answer_text')\n\t\t\t\t ->from('{{application_answers}}')\n\t\t\t\t ->where('question_id=:question', array(':question'=>$question->id))\n\t\t\t\t ->queryAll();\n\n\t\t\t\t $answers = array();\n\n\t\t\t\t\t\t\tforeach($photos as $photo) {\n\t\t\t\t\t\t\t\t$answers[] = $photo['answer_text'];\n\t\t\t\t\t\t\t}\n\n \t$arrStat['answers'][0] = $answers;\n\n \tarray_push($resStat, $arrStat);\n }\n }\n }\n }\n $this->render('statistics',array(\n\t\t\t'model'=>$model,\n\t\t\t'questions'=>$resStat,\n 'id'=>$id,\n 'omiAudModel'=>$omiAudModel,\n\t\t));\n }", "public function getReportByCustomer($data, $customer_id) {\n //dd($customer_id);\n\n $response = [];\n\n foreach($data as $i) {\n if($i['customer_id'] == $customer_id) { \n array_push($response, $i);\n }\n }\n\n return $response;\n }", "public function getTransactionDataLastMonth($customerId)\n {\n $to = $this->_date->date('Y-m-d');\n $from = strtotime($to.\"-30days\");\n $from = $this->_date->date('Y-m-d', $from);\n $to .= ' 23:59:59';\n $transactionResource = $this->_transactionFactory->create()->getResource();\n $result = [];\n \n $data = $transactionResource->getReceivedCreditTransactionsByDay($from, $to, $customerId);\n $result = $this->_processReceivedTransactionData($data, $result);\n \n $data = $transactionResource->getSpentCreditTransactionsByDay($from, $to, $customerId);\n $result = $this->_processSpentTransactionData($data, $result);\n \n $result = array_values($result);\n return $result;\n }", "public function getInsightOptionsAction() {\n \n $content = $this->getRequest()->getContent();\n $postJson = \\Zend\\Json\\Json::decode($content);\n $channel = $postJson->channel;\n $selectedTypes = $postJson->insights;\n if ($channel ==\"googleanalytics\") {\n $insightService = $this->getServiceLocator()->get('jimmybase_analytics_insights_service');\n $insightOptions = $insightService->getInsightOptions($selectedTypes);\n }\n return new JsonModel(array(\"success\" => true, \"insightOptions\" => $insightOptions));\n }", "public function get_sub_pm_by_pm($pm_category_id)\n\t{\t$film_id = get_film_id();\n\t\t$this->db->from('packing_material');\n\t\t$this->db->where('pm_group_id',$pm_category_id);\n\t\t$this->db->where('status',1);\n\t\t$this->db->where_not_in('pm_group_id',$film_id);\n\t\t$this->db->order_by('name');\n\t\t$res=$this->db->get();\n\t\treturn $res->result_array();\n\t}", "public static function getOrdersCount($merchantId,$month)\n {\n if(is_numeric($merchantId)) \n {\n $result = [];\n //$response['order'] = 0;\n $response['revenue'] = 0;\n \n $total = 0; \n $revenue = 0.00;\n\n $query = \"SELECT `id`,`order_data` FROM `jet_order_detail` WHERE `merchant_id` ='{$merchantId}' AND `order_real_status`='' AND `status` = 'complete' AND `shipped_at` LIKE '%\".$month.\"%' \"; \n\n $result = Data::sqlRecords($query, 'all','select');\n if (!empty($result)) \n {\n $revenue = self::calculateRevenue($result);\n $response = ['revenue'=>$revenue];\n //$total = count($result);\n //$response = ['order'=>$total,'revenue'=>$revenue];\n }\n return $response; \n } \n }", "public function getExperienceByMerchantId($id, Request $request){\n $limit = $request->has('_limit')? $request->_limit : 20;\n\n // get experiences by merchant id\n $experiences = Experience::where('merchant_id', $id)\n ->orderBy('id', 'DESC')\n ->paginate($limit)\n ->appends($request->query());\n\n // return collection of experiences as a resource\n return ExperienceResource::collection($experiences);\n }", "public static function get_merchant_id()\r\n {\r\n $merchant_id = 'M0001';\r\n \r\n return $merchant_id;\r\n }", "public function show(string $ses_money_id)\n {\n $merchant = Merchant::where('ses_money_id', $ses_money_id)->first();\n if ($merchant) {\n\n }\n return $this->fake();\n }", "public static function get_custom_data($campaign_id, $user_item_id, $user_fb_id){\n\t\t//error_log(\"inside get_custom_data\");\n\t\t//first grabs the custom code associated with the user_item_id's campaign\n\t\t$query = \"select custom_code\n\t\t\t\tfrom customer_supplied_code cs\n\t\t\t\twhere cs.campaign_id = '\" . Database::mysqli_real_escape_string($campaign_id) . \"'\n\t\t\t\tand cs.issued_status = 0\n\t\t\t\torder by RAND()\n\t\t\t\tlimit 1\";\n\t\t//error_log(\"QUERY \" . $query);\n\n\t\t$rs = Database::mysqli_query($query);\n\t\t$code = Database::mysqli_fetch_assoc($rs);\n\t\t//error_log(\"code: \". var_export($code,true));\n\t\t$query = \"update customer_supplied_code set user_item_id = '\" . Database::mysqli_real_escape_string($user_item_id) . \"', facebook_id = '\" . Database::mysqli_real_escape_string($user_fb_id) . \"', issued_status = 1, date_printed = NOW() where campaign_id = '\" . Database::mysqli_real_escape_string($campaign_id) . \"' and custom_code = '\" . Database::mysqli_real_escape_string($code['custom_code']) . \"'\";\n\t\tDatabase::mysqli_query($query);\n\t\treturn $code['custom_code'];\n\t}", "public function getDemand($id) {\n //$id -> idptmaster\n\n $data = array();\n //array(Yii::t('application', 'Propertytax'), 0, 0, 0, 4, 5, 8, 5),\n\n\n $criteria = new CDbCriteria(array(\n 'with' => array(\n 'idptmaster0' => array(\n 'condition' => 'idptmaster0.idptmaster =:idptmaster',\n 'params' => array(':idptmaster' => $id)\n ),\n ),\n 'condition' => 'idccfyear = :idccfyear',\n 'params' => array(':idccfyear' => Yii::app()->session['ccfyear']->idccfyear),\n ));\n\n\n $pttransaction = Pttransaction::model()->find($criteria);\n $status = 'Success';\n $message = '';\n $demandnumber = '';\n $demandinname = '';\n $demandamount = '0';\n $oldfddemandreceipts = array();\n $oldamountpaid = 0;\n\n// $propertytaxpaid = 0;\n// $minsamekittaxpaid = 0;\n//,propertytax,servicetax,minsamekittax,samekittax,waterpttax,educess,subcess1,subcess2,pttaxdiscount,pttaxsurcharge,\n//paid=0;$propertytaxpaid=0;$servicetaxpaid=0;$minsamekittaxpaid=0;$samekittaxpaid=0;$waterpttaxpaid=0;$educesspaid=0;$subcess1paid=0;$subcess2paid=0;$pttaxdiscountpaid=0;$pttaxsurchargepaid=0;$\n\n $propertytaxpaid = 0;\n $servicetaxpaid = 0;\n $minsamekittaxpaid = 0;\n $samekittaxpaid = 0;\n $waterpttaxpaid = 0;\n $educesspaid = 0;\n $subcess1paid = 0;\n $subcess2paid = 0;\n $pttaxdiscountpaid = 0;\n $pttaxsurchargepaid = 0;\n $amountpaid = 0;\n $discountpaid = 0;\n\n\n if (isset($pttransaction)) {\n\n $criteria = new CDbCriteria(array(\n 'condition' => 'demandnumber = :demandnumber',\n 'params' => array(':demandnumber' => $pttransaction->idpttransaction)\n ));\n $fddemandreceipts = Fddemandreceipt::model()->findAll($criteria);\n foreach ($fddemandreceipts as $fddemandreceipt) {\n $oldamountpaid += $fddemandreceipt->amountpaid;\n $oldfddemandreceipts[] = $fddemandreceipt;\n\n if (isset($fddemandreceipt->details)) {\n $jsonss = json_decode($fddemandreceipt->details, true);\n $array = array();\n foreach ($jsonss as $jsons) {\n $array[$jsons['name']] = $jsons['value'];\n }\n $propertytaxpaid += $array[\"details-inputgrid[0][amount]\"] + $array[\"details-inputgrid[0][discount]\"];\n $minsamekittaxpaid += $array[\"details-inputgrid[1][amount]\"] + $array[\"details-inputgrid[1][discount]\"];\n\n $samekittaxpaid += $array[\"details-inputgrid[2][amount]\"] + $array[\"details-inputgrid[2][discount]\"];\n $educesspaid += $array[\"details-inputgrid[3][amount]\"] + $array[\"details-inputgrid[3][discount]\"];\n\n $subcess1paid += $array[\"details-inputgrid[4][amount]\"] + $array[\"details-inputgrid[4][discount]\"];\n $subcess2paid += $array[\"details-inputgrid[5][amount]\"] + $array[\"details-inputgrid[5][discount]\"];\n \n $pttaxdiscountpaid += $array[\"details-inputgrid[6][amount]\"] + $array[\"details-inputgrid[6][discount]\"];\n $pttaxsurchargepaid += $array[\"details-inputgrid[7][amount]\"] + $array[\"details-inputgrid[7][discount]\"];\n $servicetaxpaid += $array[\"details-inputgrid[8][amount]\"] + $array[\"details-inputgrid[8][discount]\"];\n $waterpttaxpaid += $array[\"details-inputgrid[9][amount]\"] + $array[\"details-inputgrid[9][discount]\"];\n \n \n \n \n// for ($i = 0; $i < 10; $i++) {\n// $id = \"details-inputgrid[\" . $i . \"][amount]\";\n// $propertytaxpaid += $array[\"details-inputgrid[\" . $i . \"][amount]\"] + $array[\"details-inputgrid[\" . $i . \"][discount]\"];\n// }\n }\n }\n\n $data[] = array(\n Yii::t('application', 'Propertytax'),\n $pttransaction->oldpropertytax,\n $pttransaction->propertytax,\n $pttransaction->oldpropertytax + $pttransaction->propertytax,\n $propertytaxpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Minsamekittax'),\n $pttransaction->oldminsamekittax,\n $pttransaction->minsamekittax,\n $pttransaction->oldminsamekittax + $pttransaction->minsamekittax,\n $minsamekittaxpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Samekittax'),\n $pttransaction->oldsamekittax,\n $pttransaction->samekittax,\n $pttransaction->oldsamekittax + $pttransaction->samekittax,\n $samekittaxpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Educess'),\n $pttransaction->oldeducess,\n $pttransaction->educess,\n $pttransaction->oldeducess + $pttransaction->educess,\n $educesspaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Subcess1'),\n $pttransaction->oldsubcess1,\n $pttransaction->subcess1,\n $pttransaction->oldsubcess1 + $pttransaction->subcess1,\n $subcess1paid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Subcess2'),\n $pttransaction->oldsubcess2,\n $pttransaction->subcess2,\n $pttransaction->oldsubcess2 + $pttransaction->subcess2,\n $subcess2paid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Pttaxdiscount'),\n $pttransaction->oldpttaxdiscount,\n $pttransaction->pttaxdiscount,\n $pttransaction->oldpttaxdiscount + $pttransaction->pttaxdiscount,\n $pttaxdiscountpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Pttaxsurcharge'),\n $pttransaction->oldpttaxsurcharge,\n $pttransaction->pttaxsurcharge,\n $pttransaction->oldpttaxsurcharge + $pttransaction->pttaxsurcharge,\n $pttaxsurchargepaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Servicetax'),\n $pttransaction->oldservicetax,\n $pttransaction->servicetax,\n $pttransaction->oldservicetax + $pttransaction->servicetax,\n $servicetaxpaid,\n 0,\n 0,\n 0,\n );\n $data[] = array(\n Yii::t('application', 'Waterpttax'),\n $pttransaction->oldwaterpttax,\n $pttransaction->waterpttax,\n $pttransaction->oldwaterpttax + $pttransaction->waterpttax,\n $waterpttaxpaid,\n 0,\n 0,\n 0,\n );\n\n\n\n\n// $status = 'Success';\n// \n// $criteria = new CDbCriteria(array(\n// 'condition' => 'demandnumber = :demandnumber',\n// 'params' => array(':demandnumber' => $pttransaction->idpttransaction)\n// ));\n// $fddemandreceipts = Fddemandreceipt::model()->findAll($criteria);\n// foreach($fddemandreceipts as $fddemandreceipt){\n// $oldamountpaid += $fddemandreceipt->amountpaid;\n// $oldfddemandreceipts[] = $fddemandreceipt;\n// }\n// \n// $grand_propertytax = \n// ($pttransaction->oldpropertytax+$pttransaction->oldservicetax+$pttransaction->oldminsamekittax+$pttransaction->oldsamekittax+$pttransaction->oldwaterpttax+$pttransaction->oldeducess+$pttransaction->oldsubcess1+$pttransaction->oldsubcess2-$pttransaction->oldpttaxdiscount+$pttransaction->oldpttaxsurcharge);\n// + \n// ($pttransaction->propertytax+$pttransaction->servicetax+$pttransaction->minsamekittax+$pttransaction->samekittax+$pttransaction->waterpttax+$pttransaction->educess+$pttransaction->subcess1+$pttransaction->subcess2)\n// ;\n }\n return $data;\n }", "public function run()\n {\n $data[] = [\n 'id' => 1,\n 'user_id' => 1,\n 'scam_start_date' => date(\"Y-m-d\"),\n 'scam_realization_date' => date(\"Y-m-d\"),\n 'severity_id' => 2,\n 'amount_scammed_off' => '50000.00',\n 'fraud_category_id' => 5,\n 'scammer_name' => 'Prince Alabi',\n 'scammer_real_name' => '',\n 'item_type_id' => 1,\n 'item_name' => 'Airport'\n\n ];\n $data[] = [\n 'id' => 2,\n 'user_id' => 2,\n 'scam_start_date' => date(\"Y-m-d\"),\n 'scam_realization_date' => date(\"Y-m-d\"),\n 'severity_id' => 3,\n 'amount_scammed_off' => '900000.00',\n 'fraud_category_id' => 4,\n 'scammer_name' => 'Diamond',\n 'scammer_real_name' => 'Desmond Dennis',\n 'item_type_id' => 1,\n 'item_name' => 'Football field'\n\n ];\n $data[] = [\n 'id' => 3,\n 'user_id' => 3,\n 'scam_start_date' => date(\"Y-m-d\"),\n 'scam_realization_date' => date(\"Y-m-d\"),\n 'severity_id' => 3,\n 'amount_scammed_off' => '1000000.00',\n 'fraud_category_id' => 5,\n 'scammer_name' => 'Unity bank',\n 'scammer_real_name' => 'Alhaji Pablo George',\n 'item_type_id' => 2,\n 'item_name' => 'BVN Re-activation'\n\n ];\n $data[] = [\n 'id' => 4,\n 'user_id' => 4,\n 'scam_start_date' => date(\"Y-m-d\"),\n 'scam_realization_date' => date(\"Y-m-d\"),\n 'severity_id' => 1,\n 'amount_scammed_off' => '1500.00',\n 'fraud_category_id' => 2,\n 'scammer_name' => 'Mark',\n 'scammer_real_name' => 'Dotun James',\n 'item_type_id' => 1,\n 'item_name' => 'Phone Charger'\n\n ];\n $data[] = [\n 'id' => 5,\n 'user_id' => 4,\n 'scam_start_date' => date(\"Y-m-d\"),\n 'scam_realization_date' => date(\"Y-m-d\"),\n 'severity_id' => 1,\n 'amount_scammed_off' => '3500.00',\n 'fraud_category_id' => 2,\n 'scammer_name' => 'Mark',\n 'scammer_real_name' => 'Dotun James',\n 'item_type_id' => 1,\n 'item_name' => 'Laptop Charger'\n\n ];\n $this->truncateAndInsert('fraud_cases', $data);\n }", "public function index()\n {\n \n if (\\Gate::allows('isAdminOrMerchant')) { \n return AttributeGroup::latest()->where('merchant_id',Auth::user()->userable_id)->paginate(10);\n } \n \n }", "function get_detailed_Complaints($treatment_id){\n\t\t$where=\"(tbl_patient_treatments.treatment_status NOT IN (0))\";\n\t\t$this->db->select('tbl_patient_treatments.id as treatment_id, tbl_patient_treatments.datetime, tbl_patients.name as patient_name, tbl_patients.dob, tbl_patients.last_visit, tbl_complaints_general_examinations.description as general, tbl_complaints_history.description as history, tbl_complaints_presenting.description as presenting, tbl_complaints_systemic_examinations.description as systemic');\n\t\t\n $this->db->join('tbl_patients', 'tbl_patients.patient_id = tbl_patient_treatments.patient_id', 'left');\n $this->db->join('tbl_complaints_general_examinations', 'tbl_complaints_general_examinations.treatment_id = tbl_patient_treatments.id', 'left');\n $this->db->join('tbl_complaints_history', 'tbl_complaints_history.treatment_id = tbl_patient_treatments.id', 'left');\n $this->db->join('tbl_complaints_presenting', 'tbl_complaints_presenting.treatment_id = tbl_patient_treatments.id', 'left');\n $this->db->join('tbl_complaints_systemic_examinations', 'tbl_complaints_systemic_examinations.treatment_id = tbl_patient_treatments.id', 'left');\n $this->db->where($where);\n $this->db->where('tbl_patient_treatments.id',$treatment_id);\n\t\treturn $this->db->get('tbl_patient_treatments');\n\t}", "public function SpecificMedicine($mid){\n $sql = \"SELECT * FROM `medicine` WHERE `product_id`='$mid'\";\n $query = $this->db->query($sql);\n $result = $query->row();\n return $result;\n\t}", "function get_tax($merchant_id,$access_token)\r\n{\r\n$curl=curl_init('https://apisandbox.dev.clover.com/v3/merchants/'.$merchant_id.'/tax_rates');\r\n\r\ncurl_setopt($curl, CURLOPT_HTTPHEADER, array(\r\n \r\n \"Authorization:Bearer \".$access_token,\r\n 'Content-Type: application/json',\r\n)\r\n); \r\n\r\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r\n$auth = curl_exec($curl);\r\n$info = curl_getinfo($curl);\r\n$tax_result=json_decode($auth);\r\nreturn $tax_result;\r\n}", "function getCmsMetaData ()\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['cms_manager_url']}/resources/cms/{$this->api['cms_manager_id']}\",array(),'json');\n return $this->createResponse($result,'get My CMS Information');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function getMerchantId() {\n\t\treturn $this->getParameter('merchantId');\n\t}", "public function index(Merchant $merchant)\n {\n $data_user = Auth::user();\n $admin_services = AdminService::orderBy('id')->with('merchant','service_point')->get();\n return view('service_admin.list_admin_service',compact('data_user','admin_services','service_point'));\n }", "public function reportRe()\n{\n print_r($this->requestReport(\n \"campaigns\",\n array(\"reportDate\" => \"20190501\",\n \"campaignType\" => \"sponsoredProducts\",\n \"metrics\" => \"impressions,clicks,cost\")));\n\n // amzn1.clicksAPI.v1.m1.5CD444B4.e3c2f999-14b0-4385-bf71-41f8538f712a\n \n \n}", "function getMediaByCampaignId ( $id )\n {\n try\n {\n $result = $this->apiCall('get',\"{$this->api['syndication_url']}/resources/campaigns/{$id}/media.json\");\n return $this->createResponse($result,'get MetaData','Campaign Id');\n } catch ( Exception $e ) {\n return $this->createResponse($e,'API Call');\n }\n }", "public function logData($merchant_id, $order_id)\n\t{\n\t\t\n\t\t$timetotalstart = microtime(true);\n\t\t$address_delivery = new Address((int)$this->context->cart->id_address_delivery);\n\t\t$address_billing = new Address((int)$this->context->cart->id_address_invoice);\n\t\t$country = Tools::strtoupper($address_delivery->country);\n\t\t$country = new Country((int)$address_delivery->id_country);\n\n\t\t$countryname = BillmateCountry::getContryByNumber(BillmateCountry::fromCode($country->iso_code));\n\t\t$countryname = Tools::strtoupper($countryname);\n\t\t$country_to_currency = array(\n\t\t\t'NOR' => 'NOK',\n\t\t\t'SWE' => 'SEK',\n\t\t\t'FIN' => 'EUR',\n\t\t\t'DNK' => 'DKK',\n\t\t\t'DEU' => 'EUR',\n\t\t\t'NLD' => 'EUR',\n\t\t\t);\n\t\t$country = 209;\n\t\t$language = 138;\n\t\t$encoding = 2;\n\t\t$currency = 0;\n\t\t\n\t\t$country = new Country((int)$address_delivery->id_country);\n\t\t$countryname = BillmateCountry::getContryByNumber(BillmateCountry::fromCode($country->iso_code));\n\t\t$countryname = Tools::strtoupper($countryname);\n\t\t$country = $countryname == 'SWEDEN' ? 209 : $countryname;\n\t\t\n\t\t$ship_address = array(\n\t\t\t'email' => $this->context->customer->email,\n\t\t\t'telno' => $address_delivery->phone,\n\t\t\t'cellno' => $address_delivery->phone_mobile,\n\t\t\t'fname' => $address_delivery->firstname,\n\t\t\t'lname' => $address_delivery->lastname,\n\t\t\t'company' => ($address_delivery->company == 'undefined') ? '' : $address_delivery->company,\n\t\t\t'careof' => '',\n\t\t\t'street' => $address_delivery->address1,\n\t\t\t'zip' => $address_delivery->postcode,\n\t\t\t'city' => $address_delivery->city,\n\t\t\t'country' => (string)$countryname,\n\t\t\t);\n\n\t\t$country = new Country((int)$address_billing->id_country);\n\n\t\t$countryname = BillmateCountry::getContryByNumber(BillmateCountry::fromCode($country->iso_code));\n\t\t$countryname = Tools::strtoupper($countryname);\n\t\t$country = $countryname == 'SWEDEN' ? 209 : $countryname;\n\n\t\t$bill_address = array(\n\t\t\t'email' => $this->context->customer->email,\n\t\t\t'telno' => $address_billing->phone,\n\t\t\t'cellno' => $address_billing->phone_mobile,\n\t\t\t'fname' => $address_billing->firstname,\n\t\t\t'lname' => $address_billing->lastname,\n\t\t\t'company' => ($address_billing->company == 'undefined') ? '' : $address_billing->company,\n\t\t\t'careof' => '',\n\t\t\t'street' => $address_billing->address1,\n\t\t\t'house_number' => '',\n\t\t\t'house_extension' => '',\n\t\t\t'zip' => $address_billing->postcode,\n\t\t\t'city' => $address_billing->city,\n\t\t\t'country' => (string)$countryname,\n\t\t);\n\n\t\tforeach ($ship_address as $key => $col)\n\t\t{\n\t\t\tif (!is_array($col))\n\t\t\t\t$ship_address[$key] = utf8_decode(Encoding::fixUTF8($col));\n\t\t}\n\n\t\tforeach ($bill_address as $key => $col)\n\t\t{\n\t\t\tif (!is_array($col))\n\t\t\t\t$bill_address[$key] = utf8_decode(Encoding::fixUTF8($col));\n\t\t}\n\t\t$products = $this->context->cart->getProducts();\n\t\t$cart_details = $this->context->cart->getSummaryDetails(null, true);\n\n\t\t$vatrate = 0;\n\t\t$goods_list = array();\n\t\tforeach ($products as $product)\n\t\t{\n\t\t\tif (!empty($product['price']))\n\t\t\t{\n\t\t\t\t$taxrate = ($product['price_wt'] == $product['price']) ? 0 : $product['rate'];\n\t\t\t\t$goods_list[] = array(\n\t\t\t\t\t'qty' => (int)$product['cart_quantity'],\n\t\t\t\t\t'goods' => array(\n\t\t\t\t\t\t'artno' => $product['reference'],\n\t\t\t\t\t\t'title' => $product['name'],\n\t\t\t\t\t\t'price' => $product['price'] * 100,\n\t\t\t\t\t\t'vat' => (float)$taxrate,\n\t\t\t\t\t\t'discount' => 0.0,\n\t\t\t\t\t\t'flags' => 0,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t$vatrate = $taxrate;\n\t\t}\n\t\t$carrier = $cart_details['carrier'];\n\t\tif (!empty($cart_details['total_discounts']))\n\t\t{\n\t\t\t$discountamount = $cart_details['total_discounts'] / (($vatrate + 100) / 100);\n\t\t\tif (!empty($discountamount))\n\t\t\t{\n\t\t\t\t$goods_list[] = array(\n\t\t\t\t\t'qty' => 1,\n\t\t\t\t\t'goods' => array(\n\t\t\t\t\t\t'artno' => '',\n\t\t\t\t\t\t'title' => $this->context->controller->module->l('Rabatt'),\n\t\t\t\t\t\t'price' => 0 - abs($discountamount * 100),\n\t\t\t\t\t\t'vat' => $vatrate,\n\t\t\t\t\t\t'discount' => 0.0,\n\t\t\t\t\t\t'flags' => 0,\n\t\t\t\t\t)\n\t\t\t\t\t\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Do we have any gift products in cart\n\t\tif (isset($cart_details['gift_products']) && !empty($cart_details['gift_products']))\n\t\t{\n\t\t\tforeach ($cart_details['gift_products'] as $gift_product)\n\t\t\t{\n\t\t\t\t$discountamount = 0;\n\t\t\t\tforeach ($products as $product){\n\t\t\t\t\tif($gift_product['id_product'] == $product['id_product']){\n\t\t\t\t\t\t$taxrate = ($product['price_wt'] == $product['price']) ? 0 : $product['rate'];\n\t\t\t\t\t\t$discountamount = $product['price'];\n\t\t\t\t\t\t$ref = $product['reference'];\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t\t$goods_list[] = array(\n\t\t\t\t\t'qty' => (int) $gift_product['cart_quantity'],\n\t\t\t\t\t'goods' => array(\n\t\t\t\t\t\t'artno' => $ref,\n\t\t\t\t\t\t'title' => $this->context->controller->module->l('Gift :').' '.$gift_product['name'],\n\t\t\t\t\t\t'price' => $gift_product['price'] - round($discountamount * 100,0),\n\t\t\t\t\t\t'vat' => $taxrate,\n\t\t\t\t\t\t'discount' => 0.0,\n\t\t\t\t\t\t'flags' => 0\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$totals = array('total_shipping','total_handling');\n\t\t$label = array();\n\t\t//array('total_tax' => 'Tax :'. $cart_details['products'][0]['tax_name']);\n\t\tforeach ($totals as $total)\n\t\t{\n\t\t\t$flag = $total == 'total_handling' ? 16 : ( $total == 'total_shipping' ? 8 : 0);\n\t\t\tif (empty($cart_details[$total]) || $cart_details[$total] <= 0) continue;\n\t\t\tif ($total == 'total_shipping' && $cart_details['free_ship'] == 1) continue;\n\t\t\tif (empty($cart_details[$total])) continue;\n\t\t\tif ($total == 'total_shipping')\n\t\t\t{\n\t\t\t\t$carrier = new Carrier($this->context->cart->id_carrier, $this->context->cart->id_lang);\n\t\t\t\t$vatrate = $carrier->getTaxesRate(new Address($this->context->cart->{Configuration::get('PS_TAX_ADDRESS_TYPE')}));\n\t\t\t}\n\t\t\t$flags = ($vatrate > 0) ? $flag | 32 : $flag;\n\t\t\t$goods_list[] = array(\n\t\t\t\t'qty' => 1,\n\t\t\t\t'goods' => array(\n\t\t\t\t\t'artno' => '',\n\t\t\t\t\t'title' => isset($label[$total])? $label[$total] : ucwords(str_replace('_', ' ', str_replace('total_', '', $total))),\n\t\t\t\t\t'price' => $cart_details[$total] * 100,\n\t\t\t\t\t'vat' => (float)$vatrate,\n\t\t\t\t\t'discount' => 0.0,\n\t\t\t\t\t'flags' => $flags,\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\t$pclass = -1;\n\t\t$customer_id = (int)$this->context->cart->id_customer;\n\t\t$customer_id = $customer_id > 0 ? $customer_id: time();\n\n\t\t$transaction = array(\n\t\t\t'order1'=>(string)$order_id,\n\t\t\t'comment'=>'',\n\t\t\t'gender'=>'1',\n\t\t\t'order2' =>'',\n\t\t\t'flags'=>0,\n\t\t\t'reference'=>'',\n\t\t\t'reference_code'=>'',\n\t\t\t'currency'=>$this->context->currency->iso_code,\n\t\t\t'country'=>getCountryID(),\n\t\t\t'language'=>$this->context->language->iso_code,\n\t\t\t'pclass'=>$pclass,\n\t\t\t'shipInfo'=>array('delay_adjust'=>'1'),\n\t\t\t'travelInfo'=>array(),\n\t\t\t'incomeInfo'=>array(),\n\t\t\t'bankInfo'=>array(),\n\t\t\t'sid'=>array('time'=>microtime(true)),\n\t\t\t'extraInfo'=>array(array('cust_no'=>'0' ,'creditcard_data'=> $_REQUEST))\n\t\t);\n\n\t\t$timestart = microtime(true);\n\t\t$measurements = array();\n\t\t$k = $this->getBillmate();\n\t\t$result1 = $k->AddOrder('', $bill_address, $ship_address, $goods_list, $transaction);\n\t\t$measurements['add_order'] = microtime(true) - $timestart;\n\t\t$duration = (microtime(true) - $timetotalstart ) * 1000;\n\t\t$k->stat('client_bank_add_order_measurements', Tools::jsonEncode(array('order_id'=>$order_id, 'measurements'=>$measurements)), '', $duration);\n\n\t}", "public function fetchSocialMediaDetail($storeId=null,$merchantId=null){\n if(!empty($storeId)){\n $condition = array('SocialMedia.store_id'=>$storeId);\n }\n if(!empty($merchantId)){\n $condition = array('SocialMedia.store_id IS NULL','SocialMedia.merchant_id'=>$merchantId);\n }\n $socialResult=$this->find('first',array('conditions'=>$condition));\n if($socialResult){\n return $socialResult;\n }else{\n return false;\n }\n \n }", "function gotprodtforcusts1($mobilenum)\n\t{\n\t\t$customerid=\"SELECT customer_id from customer_contact where mobile = '\".$mobilenum.\"'\";\n\t\t$customeriddata = $this->get_results($customerid);\n\t\t$custid = $customeriddata[0][\"customer_id\"];\n\n\t\t$productlist=\"SELECT * from mapping_table where customer_id = '\".$custid.\"'\";\n\t\t$productlistdata = $this->get_results($productlist);\n\t\treturn $productlistdata;\n\t}", "public function getMerchantId()\n {\n return $this->getParameter('merchantId');\n }", "public function insert_monthly_summary_history($customer_id) {\n $query = $this->db2->query(\"SELECT * FROM `monthly_summary_all` where customer_id='$customer_id'\");\n// $archive_id = 'archieve_1001';\n $archive_id = $this->generate_archieve_monthly_id();\n $updated_on = date('y-m-d h:i:s');\n if ($query->num_rows() > 0) {\n $record = $query->result();\n foreach ($record as $row) {\n $data = array(\n 'customer_id' => $row->customer_id,\n 'insert_id' => $row->insert_id,\n 'archive_id' => $archive_id,\n 'month' => $row->month,\n 'inter_state_supply' => $row->inter_state_supply,\n 'intra_state_supply' => $row->intra_state_supply,\n 'no_gst_paid_supply' => $row->no_gst_paid_supply,\n 'debit_value' => $row->debit_value,\n 'credit_value' => $row->credit_value,\n 'sub_total_non_gst' => $row->sub_total_non_gst,\n 'sub_total_exempt' => $row->sub_total_exempt,\n 'tax_inter_state' => $row->tax_inter_state,\n 'tax_intra_state' => $row->tax_intra_state,\n 'tax_debit' => $row->tax_debit,\n 'tax_credit' => $row->tax_credit,\n 'interstate_b2b' => $row->interstate_b2b,\n 'intrastate_b2b' => $row->intrastate_b2b,\n 'interstate_b2c' => $row->interstate_b2c,\n 'intrastate_b2c' => $row->intrastate_b2c,\n 'credit_b2b' => $row->credit_b2b,\n 'credit_b2c' => $row->credit_b2c,\n 'debit_b2c' => $row->debit_b2c,\n 'total_taxable_advance_no_invoice' => $row->total_taxable_advance_no_invoice,\n 'total_tax_advance_no_invoice' => $row->total_tax_advance_no_invoice,\n 'total_taxable_advance_invoice' => $row->total_taxable_advance_invoice,\n 'total_tax_advance_invoice' => $row->total_tax_advance_invoice,\n 'advance_invoice_not_issue_b2b' => $row->advance_invoice_not_issue_b2b,\n 'advance_invoice_issue_b2b' => $row->advance_invoice_issue_b2b,\n 'total_taxable_data_gst_export' => $row->total_taxable_data_gst_export,\n 'total_tax_data_gst_export' => $row->total_tax_data_gst_export,\n 'total_non_gst_export' => $row->total_non_gst_export,\n 'advance_invoice_not_issue_b2c' => $row->advance_invoice_not_issue_b2c,\n 'advance_invoice_issue_b2c' => $row->advance_invoice_issue_b2c,\n 'sub_total_nil_rated' => $row->sub_total_nil_rated,\n 'updated_on' => $updated_on,\n );\n\n $res = $this->db2->insert('monthly_summary_history_all', $data);\n }\n if ($res == true) {\n\n $this->db2->where('customer_id', $customer_id)\n ->delete('monthly_summary_all');\n return true;\n// $query = $this->db->delete('monthly_summary_all');\n }\n }\n }" ]
[ "0.5454954", "0.5329016", "0.52983326", "0.51234484", "0.502725", "0.4976999", "0.48861444", "0.486548", "0.4827532", "0.48056963", "0.47959393", "0.47866815", "0.4773558", "0.4773143", "0.4771214", "0.47711056", "0.47572458", "0.47407705", "0.47365662", "0.47356978", "0.47184524", "0.4713384", "0.4711203", "0.4704325", "0.47009888", "0.46960595", "0.46890315", "0.46801418", "0.46667218", "0.46353567", "0.46223727", "0.4612835", "0.46127117", "0.45853466", "0.45819923", "0.45766827", "0.4576337", "0.45457414", "0.45391387", "0.45235282", "0.4514437", "0.4507118", "0.4503541", "0.4502335", "0.45018166", "0.45004728", "0.44976604", "0.44896433", "0.44786274", "0.44759274", "0.44756708", "0.4472412", "0.44674927", "0.44610533", "0.4460006", "0.44560754", "0.4454281", "0.44463062", "0.4442242", "0.44411695", "0.44402218", "0.44367027", "0.44306612", "0.44264022", "0.44184715", "0.44095322", "0.44024956", "0.43984354", "0.43977126", "0.43942985", "0.43913248", "0.43864825", "0.43801683", "0.43795043", "0.43738008", "0.43708375", "0.43673643", "0.43648326", "0.43640804", "0.43593448", "0.43573132", "0.43542704", "0.43499702", "0.4348853", "0.43471313", "0.43381962", "0.43373913", "0.43364865", "0.4330425", "0.43279794", "0.43275362", "0.4325254", "0.43251717", "0.43223685", "0.4316679", "0.43089303", "0.4306081", "0.4304525", "0.43029773", "0.4301218" ]
0.7835981
0
This returns all station recruiter analysis and a specific sr analysis when sr_id is passed
public function get_sr_analysis($sr_id=null) { try { //get global settings if(!$global = DB::table('global')->first()) return; //add constraint for a given sr_id else use foreign key $extra = $sr_id ? "AND ss.user_id = $sr_id" : "AND ss.user_id = u.id"; //station recruiter analysis query $str = DB::select(" SELECT s.id as station_id, u.id as sr_id, CONCAT(u.first_name, ' ', u.last_name) as name, ss.status, ss.created_at as since, ss.active_date, s.station_name, s.osmall_commission, s.str_sales_staff_commission, c.name as country, p.receivable, sum(p.receivable) as sales_since, #revenue_since ( sum(p.receivable) * s.osmall_commission ) as revenue_since, #earn_since case when s.str_sales_staff_commission > 0 then (s.str_sales_staff_commission / 100) * sum(p.receivable) else sum(p.receivable) * $global->str_sales_staff_commission end as earn_since, #outstanding case when s.str_sales_staff_commission > 0 then sum(p.receivable) * s.str_sales_staff_commission else sum(p.receivable) * $global->str_sales_staff_commission end as outstanding, #sales_ytd ( SELECT SUM(p.receivable) FROM sales_staff ss LEFT JOIN station s ON ss.id = s.str_sales_staff_id LEFT JOIN users u ON ss.user_id = u.id LEFT JOIN country c ON u.nationality_country_id = c.id LEFT JOIN stationsproduct sp ON s.id = sp.station_id LEFT JOIN orderproduct op ON sp.sproduct_id = op.product_id LEFT JOIN porder po ON po.id = op.porder_id LEFT JOIN sorder so ON s.id = so.station_id AND po.id = so.porder_id LEFT JOIN payment p ON p.id = po.payment_id WHERE ss.type = 'str' AND po.created_at >= concat(year(curdate()),'-01-01') $extra ) as sales_ytd, #revenue_ytd ( SELECT SUM(p.receivable) * s.osmall_commission FROM sales_staff ss LEFT JOIN station s ON ss.id = s.str_sales_staff_id LEFT JOIN users u ON ss.user_id = u.id LEFT JOIN country c ON u.nationality_country_id = c.id LEFT JOIN stationsproduct sp ON s.id = sp.station_id LEFT JOIN orderproduct op ON sp.sproduct_id = op.product_id LEFT JOIN porder po ON po.id = op.porder_id LEFT JOIN sorder so ON s.id = so.station_id AND po.id = so.porder_id LEFT JOIN payment p ON p.id = po.payment_id WHERE ss.type = 'str' AND po.created_at >= concat(year(curdate()),'-01-01') $extra ) as revenue_ytd, #earn_ytd ( SELECT ( case when s.mc_sales_staff_commission > 0 then s.mc_sales_staff_commission * sum(p.receivable) else $global->str_sales_staff_commission * sum(p.receivable) end ) as earn_ytd FROM sales_staff ss LEFT JOIN station s ON ss.id = s.str_sales_staff_id LEFT JOIN users u ON ss.user_id = u.id LEFT JOIN country c ON u.nationality_country_id = c.id LEFT JOIN stationsproduct sp ON s.id = sp.station_id LEFT JOIN orderproduct op ON sp.sproduct_id = op.product_id LEFT JOIN porder po ON po.id = op.porder_id LEFT JOIN sorder so ON s.id = so.station_id AND po.id = so.porder_id LEFT JOIN payment p ON p.id = po.payment_id WHERE ss.type = 'str' AND po.created_at >= concat(year(curdate()),'-01-01') $extra ) as earn_ytd FROM sales_staff ss LEFT JOIN station s ON ss.id = s.str_sales_staff_id LEFT JOIN users u ON ss.user_id = u.id LEFT JOIN country c ON u.nationality_country_id = c.id LEFT JOIN stationsproduct sp ON s.id = sp.station_id LEFT JOIN orderproduct op ON sp.sproduct_id = op.product_id LEFT JOIN porder po ON po.id = op.porder_id LEFT JOIN sorder so ON s.id = so.station_id AND po.id = so.porder_id LEFT JOIN payment p ON p.id = po.payment_id WHERE ss.type = 'str' $extra "); } catch(QueryException $e){ throw new CustomException($e->getMessage()); } return is_array($str) ? $str : null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_loop_RSR($loop_id)\n {\n\n // find all constituent unit IDs of the loop\n $this->db->select('unit_ids')\n ->from('loop_info')\n ->where_in('loop_id',$loop_id);\n $query = $this->db->get();\n if ($query->num_rows() == 0) { return 'Loop id not found'; }\n\n foreach ($query->result() as $row) {\n $total_unit_ids = explode(',', $row->unit_ids);\n }\n\n $this->db->select('unit_id, real_space_r')\n ->from('unit_quality')\n ->where_in('unit_id',$total_unit_ids);\n $query = $this->db->get();\n \n if ($query->num_rows() == 0) {\n return 'No RSR correspondence found';\n } else {\n $RSR = $query->result();\n }\n\n return json_encode($RSR);\n\n }", "function get_loop_RSRZ($loop_id)\n {\n $this->db->select('unit_ids')\n ->from('loop_info')\n ->where_in('loop_id',$loop_id);\n $query = $this->db->get();\n if ($query->num_rows() == 0) { return 'Loop id not found'; }\n\n foreach ($query->result() as $row) {\n $total_unit_ids = explode(',', $row->unit_ids);\n }\n\n $this->db->select('unit_id, real_space_r_z_score')\n ->from('unit_quality')\n ->where_in('unit_id',$total_unit_ids);\n $query = $this->db->get();\n \n if ($query->num_rows() == 0) {\n return 'No RSRZ correspondence is found';\n } else {\n $RSRZ = $query->result();\n }\n\n return json_encode($RSRZ);\n\n }", "function srTracker($access) {\n\t\t$sql= \"SELECT `date`, `sr` FROM `match` WHERE `sr`!=0 GROUP BY `date`;\";\n\t\t$data=$access->query($sql);\n\t\twhile ($row=$data->fetch_assoc()) {\n\t\t\techo \"['\" . $row[\"date\"] . \"', \" . $row[\"sr\"] . \"],\";\n\t\t}\n\t}", "public function getStationWithSchedules($id);", "private function getDataForSiebel($srID) {\r\n if (!$srID) {\r\n return $this->getAjaxJsonResponse(null, 'Unable to find the associated Service Request ID of the Incident.');\r\n }\r\n\r\n // get maxRows attributes\r\n $maxRows = $this->data['attrs']['max_rows'];\r\n\r\n // get interactions\r\n $getThreadResult = $this->CI->model('custom/SiebelServiceRequest')->getCommunicationActions($srID, $maxRows);\r\n if ($getThreadResult->error) {\r\n return $this->getAjaxJsonResponse(null, $getThreadResult->error->externalMessage);\r\n }\r\n\r\n // return json format interaction display data\r\n return $this->getAjaxJsonResponse($this->prepareDisplayDataForSiebel($getThreadResult->result, $maxRows), null);\r\n }", "public function searchCurrentStudent_testRun() {\n\n $this->db->select('110431 as ein,grp.groupId,grp.groupName,sec.sectionName,se.session,pr.programName,stu.studentId,stu_info.applicationId,stu_info.firstName,\n stu_info.lastName,stu_info.dateOfBirth,stu_info.gender,stu_info.religion,stu_info.fatherName,stu_info.motherName,prg.programId,prg.sectionId,prg.sessionId');\n $this->db->from('student stu');\n $this->db->join('programoffer prg', 'prg.programOfferId=stu.programOfferId');\n $this->db->join('program pr', 'pr.programId=prg.programId', \"left join\");\n $this->db->join('session se', 'se.sessionId=prg.sessionId', \"left join\");\n $this->db->join('section sec', 'sec.sectionId=prg.sectionId', \"left join\");\n $this->db->join('group grp', 'grp.groupId=prg.groupId', \"left join\");\n $this->db->join('studentinfo stu_info', 'stu_info.applicationId=stu.applicationId');\n // $this->db->limit(10); \n $query = $this->db->get();\n $result = $query->result_array();\n if (!empty($result)) {\n return $result;\n }\n }", "public function getAllRaitingService($id)\n {\n return $this->rating->where('service_id',$id)->where('service_rating','!=',0)->get();\n }", "function _recast_analysis_api_retrieve($uuid) {\r\n $query = new EntityFieldQuery();\r\n $entity = $query\r\n ->entityCondition('entity_type', 'node', '=')\r\n ->entityCondition('bundle', 'analysis')\r\n ->propertyCondition('status', 1) \r\n ->propertyCondition('uuid', $uuid) \r\n ->execute();\r\n \r\n $nodes = node_load_multiple(array_keys($entity['node']));\r\n foreach($nodes as $n) {\r\n $query = new EntityFieldQuery();\r\n $requests = $query\r\n ->entityCondition('entity_type', 'node', '=')\r\n ->entityCondition('bundle', 'recast_request')\r\n ->fieldCondition('field_request_analysis', 'target_id' , $n->nid)\r\n ->propertyCondition('status', 1) \r\n ->count()->execute();\r\n\r\n $lang = $n->language;\r\n if(isset($uuid) && $uuid != '') {\r\n //create run conditions array\r\n $runc = array();\r\n $rc = entity_load('field_collection_item', array($n->field_run_condition[$lang][0]['value']));\r\n if(isset($rc) && $rc !='') {\r\n foreach($rc as $entity_id => $obj) {\r\n $runc[] = array(\r\n 'run_condition_internal_id' => $entity_id,\r\n 'run_condition' => $obj -> field_run_condition_name[$lang][0]['value'],\r\n 'run_condition_description' => $obj -> field_run_condition_description[$lang][0]['value'],\r\n \r\n );\r\n }\r\n }\r\n $arr[] = array(\r\n 'uuid' => $n->uuid,\r\n 'title' => $n->title,\r\n 'number_of_requests' => $requests,\r\n 'collaboration' => $n->field_analysis_collaboration[$lang][0]['value'],\r\n 'journal' => $n->field_analysis_journal[$lang][0]['value'],\r\n 'doi' => $n->field_analysis_doi[$lang][0]['value'],\r\n 'description' => $n->field_analysis_description[$lang][0]['value'],\r\n 'ownership' => ($n->field_analysis_ownership[$lang][0]['value'] == 0) ? t('Unowned') : t('Owned'),\r\n 'owner' => $n->field_analysis_owner[$lang][0]['value'], \r\n 'inspire' => $n->field_analysis_inspire[$lang][0]['url'], \r\n 'eprint' => $n->field_analysis_eprint[$lang][0]['url'], \r\n 'created_by' => $n->name, \r\n //now the following are the run conditions\r\n 'run_conditions' => $runc\r\n );\r\n }\r\n else { //this condition **probably** should never happen... I like to have a fallback here anyways\r\n $arr[] = array(\r\n 'uuid' => $n->uuid,\r\n 'title' => $n->title,\r\n 'number_of_requests' => $requests,\r\n );\r\n }\r\n }\r\n return $arr;\r\n }", "function getTrains($station) {\n\n\t\t$retval = array();\n\t\t$redis_key = \"station/getTrains-${station}\";\n\t\t//$redis_key .= time(); // Debugging\n\n\t\tif ($retval = $this->redisGet($redis_key)) {\n\t\t\treturn($retval);\n\n\t\t} else {\n\n\t\t\t$query = 'search index=\"septa_analytics\" '\n\t\t\t\t. 'earliest=-24h late != 999 '\n\t\t\t\t. 'nextstop=\"' . $station . '\" '\n\t\t\t\t. '| eval time=strftime(_time,\"%Y-%m-%dT%H:%M:%S\") '\n\t\t\t\t. '| stats max(late) AS \"Minutes Late\", max(time) AS \"time\", max(train_line) AS \"Train Line\" by trainno '\n\t\t\t\t. '| sort time desc';\n\n\t\t\t$retval = $this->query($query);\n\t\t\t$retval[\"metadata\"][\"_comment\"] = \"Most recent trains that have arrived at the station named '$station'\";\n\n\t\t\t$this->redisSet($redis_key, $retval);\n\t\t\treturn($retval);\n\n\t\t}\n\n\n\t}", "public function getSerieData($serieid, $getepisodes = false)\n {\n // get feed\n if ($getepisodes === true) {\n if (function_exists('zip_open')) {\n $url = $this->tvdbapiurl . $this->api_key. '/series/' . $serieid . '/all/' .$this->lang. '.zip';\n } else {\n $url = $this->tvdbapiurl . $this->api_key. '/series/' . $serieid . '/all/' .$this->lang. '.xml';\n }\n } else {\n $url = $this->tvdbapiurl . $this->api_key. '/series/' . $serieid . '/' .$this->lang. '.xml';\n }\n\n $feed = self::downloadUrl($url);\n\n //echo \"download url: \" . $url;\n //echo \"\\n\";\n\n if ($feed) {\n $xml = simplexml_load_string($feed);\n\n\n //echo \"downloaden series name: \". $xml->Series->SeriesName;\n //echo \"\\n\";\n\n $serie['id'] = $serieid;\n $serie['name'] = (string) $xml->Series->SeriesName;\n $serie['description'] = isset($xml->Series->Overview) ? (string) $xml->Series->Overview : '';\n $serie['imdb_id'] = isset($xml->Series->IMDB_ID) ? (string) $xml->Series->IMDB_ID : '';\n $serie['firstaired'] = (string) $xml->Series->FirstAired;\n $serie['lastupdated'] = (int) $xml->Series->lastupdated;\n $serie['poster'] = isset($xml->Series->poster) ? (string) $xml->Series->poster : null;\n $serie['status'] = isset($xml->Series->Status) ? (string) $xml->Series->Status : null;\n $serie['rating'] = isset($xml->Series->Rating) ? (string) $xml->Series->Rating : null;\n $serie['category'] = isset($xml->Series->Genre) ? (string) $xml->Series->Genre : null;\n\n if ($getepisodes === true) {\n $episodes = array();\n foreach ($xml->Episode as $ep) {\n $episode['id'] = (int) $ep->id;\n $episode['season'] = (int) $ep->SeasonNumber;\n $episode['episode'] = (int) $ep->EpisodeNumber;\n $episode['airdate'] = (string) $ep->FirstAired;\n $episode['name'] = (string) $ep->EpisodeName;\n $episode['description'] = (string) $ep->Overview;\n $episodes[] = $episode;\n }\n $serie['episodes'] = $episodes;\n }\n\n return $serie;\n } else {\n return false;\n }\n }", "public function findRouteForSsSr($dp_id, $designation_id=null){\n $routes = '';\n if($dp_id > 0){\n $routes_sql = DB::table('bat_routes')->select('number')->where('stts', 1)\n ->where('dpid', $dp_id)->groupBy('number')->where('number', '!=', 999);\n if($designation_id == 151){\n $routes_sql->where('ssid', 0);\n }elseif($designation_id == 152){\n $routes_sql->where('srid', 0);\n }else{\n $routes_sql->where('ssid', 41414141414);\n }\n\n $routes = $routes_sql->get();\n }\n\n return $routes;\n }", "public function getRoutes() {\r\n \r\n $params = array(\"line\");\r\n \r\n $results = $this->fetch(\"search\", $params);\r\n \r\n $routes = array(); \r\n \r\n foreach ($results as $row) {\r\n if ($row['result']['transport_type'] == \"train\") {\r\n $routes[$row['result']['line_id']] = array(\r\n \"id\" => $row['result']['line_id'],\r\n \"route_id\" => $row['result']['line_id'],\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => $row['result']['line_number'],\r\n \"route_long_name\" => $row['result']['line_name'],\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\",\r\n \"url\" => new Url(sprintf(\"%s/timetables?provider=%s&id=%d\", RP_WEB_ROOT, static::PROVIDER_NAME, $row['result']['line_id']))\r\n );\r\n }\r\n }\r\n \r\n return $routes;\r\n \r\n /*\r\n $routes = array(\r\n array(\r\n \"id\" => 1,\r\n \"route_id\" => 1,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Alamein Line\",\r\n \"route_long_name\" => \"Alamein Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n ),\r\n array(\r\n \"id\" => 2,\r\n \"route_id\" => 2,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Belgrave Line\",\r\n \"route_long_name\" => \"Belgrave Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n ),\r\n array(\r\n \"id\" => 3,\r\n \"route_id\" => 3,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Craigieburn Line\",\r\n \"route_long_name\" => \"Craigieburn Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n ),\r\n array(\r\n \"id\" => 4,\r\n \"route_id\" => 4,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Cranbourne Line\",\r\n \"route_long_name\" => \"Cranbourne Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n ),\r\n array(\r\n \"id\" => 6,\r\n \"route_id\" => 6,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Frankston Line\",\r\n \"route_long_name\" => \"Frankston Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n ),\r\n array(\r\n \"id\" => 7,\r\n \"route_id\" => 7,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Glen Waverley Line\",\r\n \"route_long_name\" => \"Glen Waverley Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n ),\r\n array(\r\n \"id\" => 8,\r\n \"route_id\" => 8,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Hurstbridge Line\",\r\n \"route_long_name\" => \"Hurstbridge Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n ),\r\n array(\r\n \"id\" => 9,\r\n \"route_id\" => 9,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Lilydale Line\",\r\n \"route_long_name\" => \"Lilydale Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n ),\r\n array(\r\n \"id\" => 11,\r\n \"route_id\" => 11,\r\n \"agency_id\" => 1,\r\n \"route_short_name\" => \"Pakenham Line\",\r\n \"route_long_name\" => \"Pakenham Line\",\r\n \"route_desc\" => \"\",\r\n \"route_url\" => \"\",\r\n \"route_color\" => \"\",\r\n \"route_text_color\" => \"\"\r\n )\r\n );\r\n */\r\n \r\n printArray($routes);\r\n }", "public static function getAllSubspectres($deveui, $date_time_first_measure)\n {\n $db = static::getDB();\n\n $sql_subspectres_data = \"\n SELECT r.id as record_id, sensor.deveui, st.id AS structure_id, st.nom as structure_name,\n st.transmision_line_name as transmission_name,\n s.nom as site_name, r.date_time AS date_time,\n `subspectre`,`subspectre_number`,`min_freq`,`max_freq`,`resolution`\n FROM `spectre` AS sp\n JOIN record AS r ON (r.id=sp.record_id)\n JOIN sensor on sensor.id = r.sensor_id\n JOIN structure as st ON (st.id=r.structure_id)\n JOIN site as s ON (s.id=st.site_id)\n WHERE r.date_time >= :date_time\n AND sensor.deveui = :deveui\n ORDER BY r.date_time ASC\n LIMIT 5\";\n\n $stmt = $db->prepare($sql_subspectres_data);\n $stmt->bindValue(':deveui', $deveui, PDO::PARAM_STR);\n $stmt->bindValue(':date_time', $date_time_first_measure, PDO::PARAM_STR);\n $stmt->execute();\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n return $results;\n }", "function getAllVRSRead()\n\t\t {\n\t\t $date = date('Y-m-d');\n $day = date('l',strtotime($date));\n if($day=='Monday')\n {\n $from = date('Y-m-d',strtotime('-1 Monday', time()));\n }\n else{\n $from = date('Y-m-d',strtotime('-2 Monday', time()));\n }\n\t\t\t $to = date('Y-m-d',strtotime('Last Saturday', time()));\n\t\t \t\t \n\t\t$sql =\"SELECT * FROM pof_candidates LEFT JOIN be_users ON pof_candidates.user_id=be_users.id WHERE stage IN (SELECT id FROM segment_name WHERE segment_type_id='5' ) AND (date BETWEEN '\".$from.\"' AND '\".$to.\"') GROUP BY pof_candidates.user_id ORDER BY be_users.username ASC;\";\n\t $q = $this->db->query($sql);\n\t\tif($q->num_rows() > 0)\n\t\t{\n\t\t\tforeach($q->result() as $row)\n\t\t\t{\n\t\t\t\t$data[] = $row;\n\t\t\t}\n\t\t\treturn $data;\n\t\t}\n\t\t\t\n\t}", "public function getTrainDetails(){\n $day = $this->_request['day'];\n $sourceCity = $this->_request['sourceCity'];\n $destinationCity = $this->_request['destinationCity'];\n if ($day=='' && $sourceCity=='' && $destinationCity=='')\n $sql=\"select * from train\";\n else if($day=='' && $sourceCity!='' && $destinationCity=='')\n $sql=\"select * from train where FromStation = '$sourceCity'\";\n else if($day=='' && $sourceCity!='' && $destinationCity!='')\n $sql=\"select * from train where FromStation = '$sourceCity' AND ToStation = '$destinationCity'\";\n else if($day=='' && $sourceCity=='' && $destinationCity!='')\n $sql=\"select * from train where ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity!='' && $destinationCity!='')\n $sql=\"select * from train where $day = 1 AND FromStation = '$sourceCity' AND ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity=='' && $destinationCity!='')\n $sql=\"select * from train where $day = 1 AND ToStation = '$destinationCity' \";\n else if($day!='' && $sourceCity!='' && $destinationCity=='')\n $sql=\"select * from train where FromStation = '$sourceCity' AND $day = 1\";\n else if($day!='' && $sourceCity=='' && $destinationCity=='')\n $sql=\"select * from train where $day = 1\";\n $rows = $this->executeGenericDQLQuery($sql);\n $trainDetails= array();\n for($i=0 ; $i<sizeof($rows);$i++)\n {\n $trainDetails[$i]['TrainID'] = $rows[$i]['TrainID'];\n $trainDetails[$i]['TrainNumber'] = $rows[$i]['TrainNumber'];\n $trainDetails[$i]['TrainName'] = $rows[$i]['TrainName'];\n $trainDetails[$i]['FromStation'] = $rows[$i]['FromStation'];\n $trainDetails[$i]['ToStation'] = $rows[$i]['ToStation'];\n $trainDetails[$i]['StartAt'] = $rows[$i]['StartAt'];\n $trainDetails[$i]['ReachesAt'] = $rows[$i]['ReachesAt'];\n $trainDetails[$i]['Monday'] = $rows[$i]['Monday'];\n $trainDetails[$i]['Tuesday'] = $rows[$i]['Tuesday'];\n $trainDetails[$i]['Wednesday'] = $rows[$i]['Wednesday'];\n $trainDetails[$i]['Thursday'] = $rows[$i]['Thursday'];\n $trainDetails[$i]['Friday'] = $rows[$i]['Friday'];\n $trainDetails[$i]['Saturday'] = $rows[$i]['Saturday'];\n $trainDetails[$i]['Sunday'] = $rows[$i]['Sunday'];\n // $trainDetails[$i]['CityID'] = $rows[$i]['CityID'];\n $trainDetails[$i]['WebLink'] = $rows[$i]['WebLink'];\n }\n $this->response($this->json($trainDetails), 200);\n\n }", "private function getRTSListing(){\n\t\t\t\t\n\t\t// gather movie data\n\t\t$movie_data = json_decode(json_encode((array) simplexml_load_string($this->get_data('http://72352.formovietickets.com:2235/showtimes.xml'))), 1);\n\n\t\treturn $movie_data;\t\t\t\t\t\n\t}", "function get_exemplar_RSR($motif_id)\n {\n $this->db->select('loop_id')\n ->from('ml_loop_order')\n ->where('motif_id',$motif_id)\n ->where('original_order',1);\n $query = $this->db->get();\n if ($query->num_rows() == 0) {\n return 'No motif found';\n }\n $row = $query->row();\n\n return $this->get_loop_RSR($row->loop_id);\n }", "function get_rad_survey_results($conn, $survey_id) {\n\t$query_results = \"SELECT * FROM rad_survey_result WHERE survey_id = \" . $survey_id;\n\treturn exec_query($conn, $query_results);\n}", "public function api()\n {\n return RadioStation::all();\n }", "public function getAllRaiting($id)\n {\n return $this->rating->where('salon_id',$id)->where('salon_rating','!=',0)->get();\n }", "public static function getRatesList($id_service)\n\t{\n\t\t// check if the rates list has been already cached\n\t\tif (!isset(static::$rates[$id_service]))\n\t\t{\n\t\t\t$dbo = JFactory::getDbo();\n\n\t\t\t/**\n\t\t\t * This SELECT is able to retrieve the special rates in these 2 cases:\n\t\t\t * - the given service is assigned to the rate\n\t\t\t * - the rate doesn't own any service (in other words can be applied to any service)\n\t\t\t * \t\t \n\t\t\t *\n\t\t\t * SELECT r.*\n\t\t\t * FROM `#__vikappointments_special_rates` AS `r`\n\t\t\t * LEFT JOIN `#__vikappointments_ser_rates_assoc` AS `a` ON `a`.`id_special_rate` = `r`.`id`\n\t\t\t * WHERE \n\t\t\t * (\n\t\t\t * \t\t`a`.`id_service`=21 OR\n\t\t\t * \t\t(\n\t\t\t *\t\t\tSELECT COUNT(1)\n \t\t *\t\t\tFROM `#__vikappointments_ser_rates_assoc` AS `ai`\n \t\t *\t\t\tWHERE `a`.`id_special_rate` = `r`.`id`\n\t\t\t *\t\t) = 0\n\t\t\t * ) AND `r`.published = 1\n\t\t\t */\n\n\t\t\t// inner query to search for rates with no service assigned\n\t\t\t$no_service_query = $dbo->getQuery(true)\n\t\t\t\t->select('COUNT(1)')\n\t\t\t\t->from($dbo->qn('#__vikappointments_ser_rates_assoc', 'ai'))\n\t\t\t\t->where($dbo->qn('a.id_special_rate') . ' = ' . $dbo->qn('r.id'));\n\n\t\t\t// main query\n\t\t\t$q = $dbo->getQuery(true)\n\t\t\t\t->select('`r`.*')\n\t\t\t\t->from($dbo->qn('#__vikappointments_special_rates', 'r'))\n\t\t\t\t->leftjoin($dbo->qn('#__vikappointments_ser_rates_assoc', 'a') . ' ON ' . $dbo->qn('a.id_special_rate') . ' = ' . $dbo->qn('r.id'))\n\t\t\t\t->where($dbo->qn('a.id_service') . ' = ' . (int) $id_service)\n\t\t\t\t->orWhere(\"(\" . $no_service_query . \") = 0\")\n\t\t\t\t->andWhere($dbo->qn('r.published') . ' = 1');\n\n\t\t\t$dbo->setQuery($q);\n\t\t\t$dbo->execute();\n\n\t\t\tif ($dbo->getNumRows())\n\t\t\t{\n\t\t\t\t$rates = array();\n\n\t\t\t\tforeach ($dbo->loadObjectList() as $rate)\n\t\t\t\t{\n\t\t\t\t\t// convert the week days (separated by a comma) into an array\n\t\t\t\t\t$rate->weekdays = strlen($rate->weekdays) ? explode(',', $rate->weekdays) : array();\n\t\t\t\t\t// convert the usergroups (separated by a comma) into an array\n\t\t\t\t\t$rate->usergroups = strlen($rate->usergroups) ? explode(',', $rate->usergroups) : array();\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Decode rate params.\n\t\t\t\t\t *\n\t\t\t\t\t * @since 1.6.2\n\t\t\t\t\t */\n\t\t\t\t\t$rate->params = $rate->params ? json_decode($rate->params) : new stdClass;\n\n\t\t\t\t\t// push the rate in the list\n\t\t\t\t\t$rates[] = $rate;\n\t\t\t\t}\n\n\t\t\t\tstatic::$rates[$id_service] = $rates;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstatic::$rates[$id_service] = array();\n\t\t\t}\t\n\t\t}\n\n\t\treturn static::$rates[$id_service];\n\t}", "private function _get_survey_by_id($id_arr)\n\t{\n\t\t//create filter query for survey IDs\n\t\t$survey_fq=implode(\" OR \", $id_arr);\n\t\t$survey_fq= sprintf(' survey_uid:(%s)',$survey_fq);\n\n\t\t//get a select query instance\n\t\t$query = $this->solr_client->createSelect();\n\n\t\t$query->setFields(array(\n\t\t\t\t'id:survey_uid',\n\t\t\t\t'title:title',\n\t\t\t\t'nation',\n\t\t\t\t'idno'\n\t\t\t));\n\n\t\t//filter on survey id\n\t\t$query->createFilterQuery('survey_list')->setQuery($survey_fq);\n\n\t\t//set to return surveys only\n\t\t$query->createFilterQuery('survey_doctype_1')->setQuery('doctype:1');\n\n\t\t$query->setRows(count($id_arr)); //get 0-100 rows\n\n\t\t//execute search\n\t\t$resultset = $this->solr_client->select($query);\n\n\t\t//get the total number of documents found by solr\n\t\t$found_rows=$resultset->getNumFound();\n\n\t\t$output=array();\n\n\t\t$search_result=$resultset->getData();\n\n\t\t//get search result as array\n\t\tforeach($search_result['response']['docs'] as $row){\n\t\t\t\t$output[$row['id']]=$row;\n\t\t}\n\n\t\treturn $output;\n\t}", "public function getLesCompteRendu($id){\n\t\t$req = \"select r.rap_num as rapportnum,r.pra_num,p.pra_nom as nomprat ,r.rap_date as daterapport from rapport_visite r, praticien p where VIS_MATRICULE='$id' and r.pra_num=p.pra_num order by r.rap_date\";\n\t\t$rs = PdoGsb::$monPdo->query($req);\n\t\treturn $rs;\n\t}", "public function index($station_id)\n {\n //\n $stationName = Station::where('id', $station_id)->first();\n $railroads = Railroad::where('station_id', $station_id)->get();\n return view('railroads.index', [ \n 'railroads' => $railroads,\n 'station_id' => $station_id,\n 'station_name' => $stationName->name\n ]);\n }", "function get_qsos_for_print($station_id = 'All') {\n\t\tif ($station_id != 'All') {\n\t\t\t$this->db->where($this->config->item('table_name').'.station_id', $station_id);\n\t\t}\n\n\t\t$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');\n\t\t$this->db->where_in('COL_QSL_SENT', array('R', 'Q'));\n\t\t$this->db->order_by(\"COL_TIME_ON\", \"ASC\");\n\t\t$query = $this->db->get($this->config->item('table_name'));\n\n\t\treturn $query;\n\t}", "public function station_get(){\n\t\t$id = $this->get('id');\n\t\tif(count($this->get())>1){\n\t\t\t$response = array(\n\t\t\t\t\"status\"=>\"error\",\n\t\t\t\t\"status_code\"=>409,\n\t\t\t\t\"message\"=>\"Too many params was sent\",\n\t\t\t\t\"validations\"=>array(\n\t\t\t\t\t\"id\"=>\"Send Id (Get) to get specific station, or empty to get all stations\"\n\t\t\t\t),\n\t\t\t\t\"data\"=>null\n\t\t\t);\n\t\t}else{\n\t\t\tif($id){\n\t\t\t\t$response = $this->DAO->entitySelection('station',array('idStation'=>$id),TRUE);\n\t\t\t}else{\n\t\t\t\t$response = $this->DAO->entitySelection('station');\n\t\t\t}\n\t\t}\n\t\t$this->response($response,200);\n\t}", "static function getAllSurveys($id = null, $cfg) {\n // In the event the survey project is longitudinal, we need to use the event ID\n $survey_event_id = empty($cfg['SURVEY_EVENT_ARM_NAME']) ? NULL : StaticUtils::getEventIdFromName($cfg['SURVEY_PID'], $cfg['SURVEY_EVENT_ARM_NAME']);\n $survey_event_prefix = empty($cfg['SURVEY_EVENT_ARM_NAME']) ? \"\" : \"[\" . $cfg['SURVEY_EVENT_ARM_NAME'] . \"]\";\n\n if ($id == null) {\n $filter = null; //get all ids\n } else {\n $filter = $survey_event_prefix . \"[{$cfg['SURVEY_FK_FIELD']}]='$id'\";\n }\n\n $get_data = array(\n $cfg['SURVEY_PK_FIELD'],\n $cfg['SURVEY_FK_FIELD'],\n $cfg['SURVEY_TIMESTAMP_FIELD'],\n $cfg['SURVEY_DATE_FIELD'],\n $cfg['SURVEY_DAY_NUMBER_FIELD'],\n $cfg['SURVEY_FORM_NAME'] . '_complete'\n ) ;\n\n $q = REDCap::getData(\n $cfg['SURVEY_PID'],\n 'json',\n NULL,\n $get_data,\n $survey_event_id,\n NULL,FALSE,FALSE,FALSE,\n $filter\n );\n\n $results = json_decode($q,true);\n return $results;\n }", "function getScans( $data ){\n $colArray = array( 'scan_detail_id', 'scan_id', 'ez', 'ez_string', 'hsn', 'tsn', 'vsn', 'field_2_2', 'vin', 'd3', 'registrationNumber', 'name1', 'name2', 'firstname', 'address1', 'address2', 'j', 'field_4', 'field_3', 'd1', 'd2_1', 'd2_2', 'd2_3', 'd2_4', 'field_2', 'field_5_1', 'field_5_2', 'v9', 'field_14', 'p3', 'field_10', 'field_14_1', 'p1', 'l', 'field_9', 'p2_p4', 't', 'field_18', 'field_19', 'field_20', 'g', 'field_12', 'field_13', 'q', 'v7', 'f1', 'f2', 'field_7_1', 'field_7_2', 'field_7_3', 'field_8_1', 'field_8_2', 'field_8_3', 'u1', 'u2', 'u3', 'o1', 'o2', 's1', 's2', 'field_15_1', 'field_15_2', 'field_15_3', 'r', 'field_11', 'k', 'field_6', 'field_17', 'field_16', 'field_21', 'field_22', 'hu', 'creation_date', 'creation_city', 'document_id', 'Maker', 'Model', 'PowerKw', 'PowerHpKw', 'Ccm', 'Fuel', 'FuelCode', 'Filename', 'itime' );\n \n //get last timestamp from database\n $lastTimestamp = $GLOBALS['dbh']->getOne( 'SELECT itime FROM lxc_fs_scans ORDER BY itime DESC LIMIT 1' )['itime'];\n $lastTsDB = (int) strtotime( $lastTimestamp ); //seconds from unix epoch\n\n $apiKeyArray = getDefaultsByArray( array( 'lxcarsapi') );\n $rs = file_get_contents( 'https://fahrzeugschein-scanner.de/api/Scans/GetScans/'.$apiKeyArray['lxcarsapi'].'/?take=16' );\n $rsArray = json_decode( $rs, TRUE ); //JSON to Array\n\n foreach( $rsArray AS $key => $value ){ // Timestamp from scanner is always a iso 8601 timestamp!!!\n $scanTs = (int) strtotime( $value['timestamp'] );\n if( $lastTsDB < $scanTs ){ \n $rsFsData = file_get_contents( 'https://fahrzeugschein-scanner.de/api/Scans/ScanDetails/'.$apiKeyArray['lxcarsapi'].'/'.$value['id'].'/false' );\n $rsFsDataArray = json_decode( $rsFsData, TRUE ); //JSON to Array\n foreach( $rsFsDataArray AS $key1 => $value1 ) if( strpos( $key1, 'img' ) ) unset( $rsFsDataArray[$key1] ); // remove *_img data\n $fsValues = array_values( $rsFsDataArray );\n $fsValues[] = $value['timestamp'];\n $GLOBALS['dbh']->insert( 'lxc_fs_scans', $colArray, $fsValues );\n }\n }\n\n //get FS from DB\n $dbScans = $GLOBALS['dbh']->getAll( \"SELECT *, to_char( itime::TIMESTAMP AT TIME ZONE 'GMT', 'DD.MM.YYYY HH24:MI' ) AS myts FROM lxc_fs_scans ORDER BY itime DESC LIMIT \".$data['fsmax'] );\n echo json_encode( $dbScans );\n }", "public function getWatchBySticker($sticker_id) {\n $query = \"SELECT\n wa.id,\n wa.player_id,\n wa.sticker_id,\n wa.date_started,\n wa.date_expiring,\n st.name as sticker_name,\n st.ident as sticker_number\n FROM \" . $this->__schema . \".watch wa\n INNER JOIN \" . $this->__schema . \".sticker st ON wa.sticker_id = st.id\n WHERE wa.sticker_id = \" . $this->db()->quote($sticker_id)\n . \" AND wa.date_expiring > now()\";\n $data = $this->db()->getCollection($query);\n if ($data) {\n $sticker_keys = array_map(function($an_object) { return $an_object['sticker_id']; }, $data);\n $payload = array_combine($sticker_keys, $data);\n return [\n 'success' => TRUE,\n 'payload' => $payload,\n ];\n }\n else {\n return [\n 'success' => FALSE,\n 'payload' => NULL,\n ];\n }\n }", "public function stationview_get(){\n\t\t$id = $this->get('id');\n\t\tif(count($this->get())>1){\n\t\t\t$response = array(\n\t\t\t\t\"status\"=>\"error\",\n\t\t\t\t\"status_code\"=>409,\n\t\t\t\t\"message\"=>\"Too many params was sent\",\n\t\t\t\t\"validations\"=>array(\n\t\t\t\t\t\"id\"=>\"Send Id (Get) to get specific station, or empty to get all stations\"\n\t\t\t\t),\n\t\t\t\t\"data\"=>null\n\t\t\t);\n\t\t}else{\n\t\t\tif($id){\n\t\t\t\t$response = $this->DAO->entitySelection('systemStation',array('idStation'=>$id),TRUE);\n\t\t\t}else{\n\t\t\t\t$response = $this->DAO->entitySelection('systemStation');\n\t\t\t}\n\t\t}\n\t\t$this->response($response,200);\n\t}", "public function getSourceOfListeners() {\n//\t\t# if terrestrial_delay = 0, then the event was from Terrestrial radio\n//\t\t# if terrestrial_delay > 0 then the event was from Streaming radio\n//\t\tSelect count(*)\n//\t\tfrom airshr_events\n//\t\twhere terrestrial_delay > '0' and station_id = '8' and time(created_at) > '06:00' and time(created_at) < '22:00'\n\t\ttry {\n\t\t\t$station = \\Auth::User()->station;\n\t\t\t$timezone = $station->getStationTimezone();\n\t\t\t$station_time = new \\DateTime('now', new \\DateTimeZone($timezone));\n\t\t\t$offset = $station_time->getOffset();\n\n\t\t\t$stream = \\DB::table('airshr_events')\n\t\t\t\t->where('terrestrial_delay', '>', 0)\n\t\t\t\t->where('station_id', '=', $station->id)\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) >= 6*60*60\") //\"MOD(record_timestamp + {$offset}, 86400)\" gets second since midnight\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) < 22*60*60\")// We then compare the hours from midnight to check if it is between the hours we want\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) >= 6')\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) < 22')\n\t\t\t\t->count();\n\n\t\t\t$terrestrial = \\DB::table('airshr_events')\n\t\t\t\t->where('terrestrial_delay', '=', 0)\n\t\t\t\t->where('station_id', '=', $station->id)\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) >= 6*60*60\")\n\t\t\t\t->whereRaw(\"MOD(record_timestamp + {$offset}, 86400) < 22*60*60\")\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) >= 6')\n//\t\t\t\t->whereRaw('HOUR(CONVERT_TZ(FROM_UNIXTIME(record_timestamp), @@session.time_zone, \\''.$timezone.'\\')) < 22')\n\t\t\t\t->count();\n\n\t\t\t$streaming_users = \\DB::select(\\DB::raw('select count(*) as count from (select user_id, date(created_at), time(created_at), count(*)\n\t\t\t\t\tfrom airshr_streaming_status\n\t\t\t\t\tgroup by 1\n\t\t\t\t\torder by 4 desc) as T'));\n\t\t\t\n\t\t\treturn response()->json(array('code' => 0, 'stream' => $stream, 'terrestrial' => $terrestrial, 'streaming_users' => $streaming_users));\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\n\t}", "function getRelatedSamples($id){\n\t\n\t\t$query = 'SELECT * FROM samples As Sample \n\t\t\t\t LEFT JOIN minerals AS Mineral ON Sample.mineral_id=Mineral.id\n\t\t\t\t LEFT JOIN crystal_systems as CrystalSystem ON Mineral.crystal_system_id=CrystalSystem.id\n\t\t\t\t WHERE CrystalSystem.id = '.$id;\n\t\t\n\t\treturn $this->query($query);\n\t\n\t}", "public function getStudentArares($id)\r\n {\r\n\r\n $this->db->select('*');\r\n $this->db->from('section_arares a');\r\n $this->db->join('users u','u.user_id=a.student','left');\r\n $this->db->join('programmes p','p.prog_id=u.program','left');\r\n $this->db->join('departments d','d.dept_id=p.department_id','left');\r\n $this->db->join('schools s','s.sch_id=d.sch_id','left');\r\n $this->db->join('status t','t.status_id=a.status_id','left');\r\n $this->db->join('sections c','c.section_id=a.section_id');\r\n $this->db->where('a.status_id',2);\r\n $this->db->where('a.section_id',$id);\r\n $query=$this->db->get();\r\n return $query->result_array();\r\n }", "function srvsadd($srvsid)\n {\n $db= new DB();\n $db->open();\n if($srvsid==0)\n {\n $sql = \"Select srvs_main.sr_id, srvs_main.cname, srvs_main.cpname, srvs_main.add1, srvs_main.add2, \n city.citname,\n district.dstname, \n state.stname, \n country.cntname, \n srvs_main.pin,\n srvs_main.tel,\n srvs_main.fax, \n srvs_main.mob,\n srvs_main.mail,\n srvs_main.web,\n srvs_main.cno,\n srvs_main.amail,\n\t\t\t\tsrvs_main.srvs_auth\n\n from srvs_main, city, district, state, country\n where srvs_main.sr_id='$srvsid' and\n srvs_main.city=city.citid and\n srvs_main.dist=district.dstid and\n srvs_main.stat=state.stid and\n srvs_main.cout=country.cntid\";\n }\n else {\n $sql = \"Select srvs_main.sr_id, srvs_main.cname, srvs_main.cpname, srvs_main.add1, srvs_main.add2, \n city.citname,\n district.dstname, \n state.stname, \n country.cntname, \n srvs_main.pin,\n srvs_main.tel,\n srvs_main.fax, \n srvs_main.mob,\n srvs_main.mail,\n srvs_main.web,\n srvs_main.cno,\n srvs_main.amail,\n\t\t\t\tsrvs_main.srvs_auth\n \n\t\t from srvs_main, city, district, state, country\n where srvs_main.sr_id='$srvsid' and\n srvs_main.city=city.citid and\n srvs_main.dist=district.dstid and\n srvs_main.stat=state.stid and\n srvs_main.cout=country.cntid\";\n \n } \n \n $result2 = mysql_query($sql);\n\n $cisrvs =0;\n $srvsData;\n while($row = mysql_fetch_array($result2))\n {\n $srid = $row['sr_id'];\n $cname = $row['cname'];\n $cpname = $row['cpname']; \n $add1 = $row['add1'];\n $add2 = $row['add2'];\n $city = $row['citname'];\n $dist = $row['dstname'];\n $stat = $row['stname'];\n $cont = $row['cntname'];\n $pin = $row['pin'];\n $tel = $row['tel']; \n $fax = $row['fax'];\n $mob = $row['mob'];\n $mail = $row['mail']; \n $web = $row['web'];\n $cno = $row['cno'];\n $amail = $row['amail'];\n $srvs_auth = $row['srvs_auth'];\n\t\t\t\t \n $srvsmain = new srvsmain();\n $srvsmain->setSrvsid($srid);\n $srvsmain->setCname($cname);\n $srvsmain->setCpname($cpname);\n $srvsmain->setAdd1($add1);\n $srvsmain->setAdd2($add2);\n $srvsmain->setCity($city);\n $srvsmain->setDist($dist);\n $srvsmain->setStat($stat);\n $srvsmain->setCont($cont);\n\t\t\t\t $srvsmain->setPin($pin);\n $srvsmain->setTel($tel);\n $srvsmain->setFax($fax);\n $srvsmain->setMob($mob);\n $srvsmain->setMail($mail);\n $srvsmain->setWeb($web);\n $srvsmain->setCno($cno);\n $srvsmain->setAmail($amail);\n $srvsmain->setSrvs_auth($srvs_auth);\n\t\t\t\t \n $srvsData[$cisrvs] = $srvsmain;\n $cisrvs = $cisrvs+1;\n \n return $srvsData;\n \n \n }\n \n}", "public function agentSaleList($id)\n {\n $report_info =array();\n $operator_id =$this->myGlob->operator_id;\n $agent_ids =$this->myGlob->agent_ids;\n $agopt_ids =$this->myGlob->agopt_ids;\n $operator_ids =array();\n if($agopt_ids){\n $operator_ids =$agopt_ids;\n }else{\n $operator_ids[] =$operator_id;\n }\n $agent_status=$agent_id =$id;\n $trips =Input::get('trips'); //for agent report or not\n $search=array();\n $search['agent_rp'] =1;\n\n $from =Input::get('from');\n $to =Input::get('to');\n\n $start_date =Input::get('start_date');\n $end_date =Input::get('end_date') ? Input::get('end_date') : $this->getDate();\n if($start_date){\n $start_date =str_replace('/', '-', $start_date);\n $start_date =date('Y-m-d', strtotime($start_date));\n $end_date =str_replace('/', '-', $end_date);\n $end_date =date('Y-m-d', strtotime($end_date));\n }else{\n $start_date=$this->getDate();\n $end_date=$this->getDate();\n }\n\n $departure_time =Input::get('departure_time');\n $departure_time =str_replace('-', ' ', $departure_time);\n\n $operator_id =$operator_id ? $operator_id : $this->myGlob->operator_id;\n\n if($from=='all')\n $from=0;\n\n $trip_ids=array();\n $sale_item=array();\n $order_ids=array();\n\n if($departure_time){\n $trip_ids=Trip::wherein('operator_id',$operator_ids)\n ->wheretime($departure_time)->lists('id');\n }else{\n $trip_ids=Trip::wherein('operator_id',$operator_ids)\n ->lists('id');\n }\n\n if($trip_ids)\n $order_ids=SaleItem::wherein('trip_id',$trip_ids)\n ->where('departure_date','>=',$start_date)\n ->where('departure_date','<=',$end_date)\n ->groupBy('order_id')->lists('order_id');\n\n if($order_ids)\n $order_ids=SaleOrder::wherein('id',$order_ids)->wherebooking(0)->lists('id');\n\n if($order_ids)\n { \n /******************************************************************************** \n * For agent report by agent group and branches OR don't have branch agent\n ***/\n $agentgroup_id =Input::get('agentgroup');\n if($agentgroup_id==\"All\")\n $agentgroup_id=0;\n $arr_agent_id =array();\n\n if($agentgroup_id && $agent_id)\n {\n $sale_item = SaleItem::wherein('order_id', $order_ids)\n ->selectRaw('order_id, count(*) as sold_seat, trip_id, price, foreign_price, departure_date, busoccurance_id, SUM(free_ticket) as free_ticket, agent_id')\n ->whereagent_id($agent_id)\n ->groupBy('order_id')->orderBy('departure_date','asc')->get(); \n }\n elseif(!$agentgroup_id && $agent_id)\n {\n $sale_item = SaleItem::wherein('order_id', $order_ids)\n ->selectRaw('order_id, count(*) as sold_seat, trip_id, price, foreign_price, departure_date, busoccurance_id, SUM(free_ticket) as free_ticket, agent_id')\n ->whereagent_id($agent_id)\n ->groupBy('order_id')->orderBy('departure_date','asc')->get();\n }\n elseif($agentgroup_id && !$agent_id)\n {\n $arr_agent_id=Agent::whereagentgroup_id($agentgroup_id)->lists('id');\n \n $order_ids2=array();\n if($arr_agent_id)\n $order_ids2=SaleItem::wherein('agent_id',$arr_agent_id)->where('departure_date','>=',$start_date)->where('departure_date','<=',$end_date)->groupBy('order_id')->lists('order_id');\n // for unique orderids for all agent branches\n $order_id_list=array_intersect($order_ids, $order_ids2);\n // dd($order_id_list);\n if($order_id_list)\n $sale_item = SaleItem::wherein('order_id', $order_id_list)\n ->selectRaw('order_id, count(*) as sold_seat, trip_id, price, foreign_price, departure_date, busoccurance_id, SUM(free_ticket) as free_ticket, agent_id')\n // ->whereagent_id($agent_id)\n ->groupBy('order_id')->orderBy('departure_date','asc')->get(); \n }\n /***\n * End For agent report by agent group and branches OR don't have branch agent\n *********************************************************************************/\n \n /******************************************************************* \n * for Trip report \n */\n else\n {\n $sale_item = SaleItem::wherein('order_id', $order_ids)\n ->selectRaw('order_id, count(*) as sold_seat, trip_id, price, foreign_price, departure_date, busoccurance_id, SUM(free_ticket) as free_ticket, agent_id')\n ->groupBy('order_id')->orderBy('departure_date','asc')->get();\n }\n\n }\n \n $lists = array();\n foreach ($sale_item as $rows) {\n $local_person = 0;\n $foreign_price = 0;\n $total_amount = 0;\n $commission=0;\n $percent_total=0;\n $trip = Trip::whereid($rows->trip_id)->first();\n $order_date=SaleOrder::whereid($rows->order_id)->pluck('orderdate');\n $list['order_date'] = $order_date;\n $list['order_id'] = $rows->order_id;\n // dd($rows->agent_id);\n $agent_name=Agent::whereid($rows->agent_id)->pluck('name');\n $list['agent_id']=$rows->agent_id ? $rows->agent_id : 0;\n $list['agent_name']=$agent_name ? $agent_name : \"-\";\n \n if($trip){\n $list['id'] = $rows->trip_id;\n $list['bus_id'] = $rows->busoccurance_id;\n $list['departure_date'] = $rows->departure_date;\n $list['from_id'] = $trip->from;\n $list['to_id'] = $trip->to;\n $list['from_to'] = City::whereid($trip->from)->pluck('name').'-'.City::whereid($trip->to)->pluck('name');\n $list['time'] = $trip->time;\n $list['class_id'] = $trip->class_id;\n $list['class_name'] = Classes::whereid($trip->class_id)->pluck('name');\n \n $list['from_to_class']=$list['from_to']. \"(\".$list['class_name'].\")\";\n \n $nationality=SaleOrder::whereid($rows->order_id)->pluck('nationality');\n \n $agent_commission = AgentCommission::wheretrip_id($rows->trip_id)->whereagent_id($rows->agent_id)->first();\n if($agent_commission){\n $commission = $agent_commission->commission;\n }else{\n $commission = Trip::whereid($rows->trip_id)->pluck('commission');\n }\n\n if( $nationality== 'local'){\n $local_person += $rows->sold_seat;\n $total_amount += $rows->free_ticket > 0 ? ($rows->price * $rows->sold_seat) - ($rows->price * $rows->free_ticket) : $rows->price * $rows->sold_seat ;\n $tmptotal =$rows->price * ($rows->sold_seat- $rows->free_ticket);\n $percent_total +=$tmptotal - ($commission * ($rows->sold_seat- $rows->free_ticket));\n }else{\n $foreign_price += $rows->sold_seat;\n $total_amount += $rows->free_ticket > 0 ? ($rows->foreign_price * $rows->sold_seat) - ($rows->foreign_price * $rows->free_ticket) : $rows->foreign_price * $rows->sold_seat ;\n $tmptotal =$rows->foreign_price * ($rows->sold_seat- $rows->free_ticket);\n $percent_total +=$tmptotal - ($commission * ($rows->sold_seat- $rows->free_ticket));\n }\n $list['local_person'] = $local_person;\n $list['foreign_person'] = $foreign_price;\n $list['local_price'] = $rows->price;\n $list['foreign_price'] = $rows->foreign_price;\n $list['sold_seat'] = $rows->sold_seat;\n $list['free_ticket'] = $rows->free_ticket;\n $list['total_amount'] = $total_amount;\n $list['percent_total'] = $percent_total;\n $lists[] = $list;\n }\n }\n //Grouping from Lists\n $stack = array();\n foreach ($lists as $rows) {\n if($search['agent_rp'])\n $check = $this->ifExistAgent($rows, $stack);\n else\n $check = $this->ifExist($rows, $stack);\n if($check != -1){\n $stack[$check]['local_person'] += $rows['local_person'];\n $stack[$check]['foreign_person'] += $rows['foreign_person'];\n $stack[$check]['sold_seat'] += $rows['sold_seat'];\n $stack[$check]['free_ticket'] += $rows['free_ticket'];\n $stack[$check]['total_amount'] += $rows['total_amount'];\n $stack[$check]['percent_total'] += $rows['percent_total'];\n }else{\n array_push($stack, $rows);\n }\n }\n\n $search['agentgroup']=\"\";\n $agentgroup=array();\n $agentgroup=AgentGroup::whereoperator_id($operator_id)->get();\n $search['agentgroup']=$agentgroup;\n\n $cities=array();\n $cities=$this->getCitiesByoperatorId($operator_id);\n $search['cities']=$cities;\n \n $times=array();\n $times=$this->getTime($operator_id, $from, $to);\n $search['times']=$times;\n\n $search['operator_id']=$operator_id;\n $search['trips']=$trips;\n $search['from']=$from;\n $search['to']=$to;\n $search['time']=$departure_time;\n $search['start_date']=$start_date;\n $search['end_date']=$end_date;\n $search['agentgroup_id']=Input::get('agentgroup')? Input::get('agentgroup') : 0;\n $search['agent_name']=Agent::whereid($id)->pluck('name');\n $search['agent_id']=$id;\n \n // sorting result\n $response=$this->msort($stack,array(\"departure_date\",\"time\"), $sort_flags=SORT_REGULAR,$order=SORT_ASC);\n \n // grouping\n if($search['agent_rp']==1){\n $tripandorderdategroup = array();\n foreach ($response AS $arr) {\n $tripandorderdategroup[$arr['agent_name']][] = $arr;\n }\n }\n else\n {\n $tripandorderdategroup = array();\n foreach ($response AS $arr) {\n $tripandorderdategroup[$arr['from_to_class']][] = $arr;\n }\n // sorting\n }\n ksort($tripandorderdategroup);\n\n $agent=Agent::whereoperator_id($operator_id)->where('id','!=',$id)->get();\n // return Response::json($tripandorderdategroup);\n return View::make('agent.agentsalelist', array('response'=>$tripandorderdategroup, 'search'=>$search,'agentlist'=>$agent));\n }", "public function getResults($studId, $overviewId) {\n global $ilDB, $lng;\n $average;\n $maxPoints;\n\n $data = array();\n \n $query = \"SELECT ref_id_test FROM rep_robj_xtov_t2o WHERE obj_id_overview = %s\";\n $result = $ilDB->queryF($query, array('integer'), array($overviewId));\n $tpl = new ilTemplate(\"tpl.stud_view.html\", true, true, \"Customizing/global/plugins/Services/Repository/RepositoryObject/TestOverview\");\n //Internationalization\n $lng->loadLanguageModule(\"assessment\");\n $lng->loadLanguageModule(\"certificate\");\n $lng->loadLanguageModule(\"rating\");\n $lng->loadLanguageModule(\"common\");\n $lng->loadLanguageModule(\"trac\");\n $tpl->setCurrentBlock(\"head_row\");\n $tpl->setVariable(\"test\", $lng->txt(\"rep_robj_xtov_testOverview\"));\n $tpl->setVariable(\"exercise\", $lng->txt(\"rep_robj_xtov_ex_overview\"));\n $tpl->setVariable(\"testTitle\", $lng->txt(\"certificate_ph_testtitle\"));\n $tpl->setVariable(\"score\", $lng->txt(\"toplist_col_score\"));\n $tpl->parseCurrentBlock();\n $tpl->setVariable(\"average\", $lng->txt('rep_robj_xtov_avg_points'));\n $tpl->setVariable(\"averagePercent\", $lng->txt(\"trac_average\"));\n $tpl->setVariable(\"exerciseTitle\", $lng->txt(\"certificate_ph_exercisetitle\"));\n $tpl->setVariable(\"mark\", $lng->txt(\"tst_mark\"));\n $tpl->setVariable(\"studentRanking\", $lng->txt(\"toplist_your_result\"));\n //Baut aus den Einzelnen Zeilen Objekte\n while ($testObj = $ilDB->fetchObject($result)) {\n array_push($data, $testObj);\n }\n\n\n foreach ($data as $set) {\n $result = $this-> getTestData($studId,$set->ref_id_test);\n $timestamp = time();\n //$datum = (float) date(\"YmdHis\", $timestamp);\n\n $testTime = (float) $result->ending_time;\n \n \n\n /* Checks if the test has been finished or if no end time is given */\n if ((($testTime - $timestamp) < 0 || $result->timeded == 0) && $this->isTestDeleted($set->ref_id_test) == null && $result != null ) {\n $tpl->setCurrentBlock(\"test_results\");\n $tpl->setVariable(\"Name\", $result->title);\n $average += $result->points;\n $maxPoints += $result->maxpoints;\n if ($result->points > ($result->maxpoints / 2)) {\n $pointsHtml = \"<td class='green-result'>\" . $result->points . \"</td>\";\n } else {\n $pointsHtml = \"<td class='red-result'>\" . $result->points . \"</td>\";\n }\n $tpl->setVariable(\"Point\", $pointsHtml);\n\n $tpl->parseCurrentBlock();\n }\n }\n ////Exercise Part ////\n require_once ilPlugin::getPluginObject(IL_COMP_SERVICE, 'Repository', 'robj', 'TestOverview')\n ->getDirectory() . '/classes/mapper/class.ilExerciseMapper.php';\n $excMapper = new ilExerciseMapper();\n $grades = $this->getExerciseMarks($studId, $overviewId);\n $totalGrade = 0;\n\n foreach ($grades as $grade) {\n if ($this->isExerciseDeleted($grade->obj_id) == null) {\n $gradeName = $excMapper->getExerciseName($grade->obj_id);\n $totalGrade += $grade->mark;\n $tpl->setCurrentBlock(\"exercise_results\");\n $tpl->setVariable(\"Exercise\", $gradeName);\n $tpl->setVariable(\"Mark\", $grade->mark);\n $tpl->parseCurrentBlock();\n }\n }\n\n //// general Part /////\n if ($this->getNumTests($overviewId) == 0) {\n $averageNum = 0;\n } else {\n $averageNum = round($average / $this->getNumTests($overviewId), 2);\n }\n $tpl->setVariable(\"AveragePoints\", $averageNum);\n if ($maxPoints == 0) {\n $Prozentnum = 0;\n } else {\n $Prozentnum = (float) ($average / $maxPoints) * 100;\n }\n $lng->loadLanguageModule(\"crs\");\n $tpl->setVariable(\"averageMark\", $lng->txt('rep_robj_xtov_average_mark'));\n\n if (count($grades) > 0) {\n\n $tpl->setVariable(\"AverageMark\", $totalGrade / count($grades));\n }\n $tpl->setVariable(\"totalMark\", $lng->txt('rep_robj_xtov_total_mark'));\n $tpl->setVariable(\"TotalMark\", $totalGrade);\n\n $tpl->setVariable(\"Average\", round($Prozentnum, 2));\n /// ranking part /////\n $ilOverviewMapper = new ilOverviewMapper();\n $rank = $ilOverviewMapper->getRankedStudent($overviewId, $studId);\n $count = $ilOverviewMapper->getCount($overviewId);\n $date = $ilOverviewMapper->getDate($overviewId);\n if (!$rank == '0') {\n $tpl->setVariable(\"toRanking\", $rank . \" \" . $lng->txt('rep_robj_xtov_out_of') . \" \" . $count . \"<br> \".$lng->txt('rep_robj_xtov_lastupdate').\": \" . $date);\n } else {\n $tpl->setVariable(\"toRanking\", $lng->txt('links_not_available'));\n }\n $ilExerciseMapper = new ilExerciseMapper();\n $rank = $ilExerciseMapper->getRankedStudent($overviewId, $studId);\n $count = $ilExerciseMapper->getCount($overviewId);\n $date = $ilExerciseMapper->getDate($overviewId);\n if (!$rank == '0') {\n $tpl->setVariable(\"eoRanking\", $rank . \" \" . $lng->txt('rep_robj_xtov_out_of') . \" \" . $count . \"<br> \".$lng->txt('rep_robj_xtov_lastupdate').\": \" . $date);\n } else {\n $tpl->setVariable(\"eoRanking\", $lng->txt('links_not_available'));\n }\n\n return $tpl->get();\n }", "function getRoundsForStudy($theStudyID, $clientID) {\n global $definitions;\n\n $roundItemTypeID = getClientItemTypeID_RelatedWith_byName($definitions['roundsplanning'], $clientID);\n $roundsAssociatedStudyID = getClientPropertyID_RelatedWith_byName($definitions['roundsplanningAssociatedStudyID'], $clientID);\n\n //First get the relation associated\n $returnProperties = array();\n\n //build an empty filter\n $filters = array();\n $filters[] = array('ID' => $roundsAssociatedStudyID, 'value' => $theStudyID);\n\n $rounds = getFilteredItemsIDs($roundItemTypeID, $clientID, $filters, $returnProperties);\n\n return $rounds;\n\n}", "public function show($id)\n {\n $scanResult = ScanRequests::select('id', 'rq_num')\n ->with(['scan_results' => function ($q) {\n $q->with(['scanCateg' => function ($r) {\n $r->select('id', 'categ_name', 'points');\n }]);\n }])->where('id', $id)\n ->orWhere('rq_num', $id)->get();\n // $scanResult = ScanResults::with(['scan_request' => function ($q, $myId = $this->id) {\n // $q->select('id', 'rqNum')->where('id', $myId)->orWhere('rq_num', $myId);\n // }, 'scanCategs' => function ($q) {\n // $q->select('id', 'scan_name', 'points');\n // }])->where('request_id', $id)\n // ->get();\n // $scanResults = collect($scanResults);\n // $scanFiles = $scanResults->transform(function ($value, $key) {\n // return [\n // 'files' => $value['scan_results'],\n\n // ];\n // });\n // $scanfiles = $scanResult->scan_results();\n return response()->json(['message' => 'Case Files Collected', 'success' => true, 'files' => $scanResult[0]->scan_results], HttpFoundationResponse::HTTP_ACCEPTED);\n }", "function getDetailAllStationNext($common_id1,$DbConnection)\n {\n $query=\"SELECT station_id,station_name from station USE INDEX(stn_uaid_status) where user_account_id='$common_id1' AND status='1'\";\n //echo \"query=\".$query.\"<br>\";\n $result=mysql_query($query,$DbConnection);\t\t\n while($row=mysql_fetch_object($result))\n {\t\t\t\t\t\t\t\t\t\n /*$geo_id=$row->station_id;\n $geo_name=$row->station_name;*/\n\t\t\t\n $data[]=array('geo_id'=>$row->station_id,'geo_name'=>$row->station_name);\t\n }\n return $data;\t\t\t\t\t\t\n }", "function scan()\n {\n $arlines = array();\n exec(\n $this->arfilelocation['iwpriv'] . ' '\n . escapeshellarg($this->interface) . ' get_site_survey',\n $arlines\n );\n\n return $this->parsescan($arlines);\n }", "public function getAssignStfDetl($refid, $staff_id)\n {\n $this->db->select(\"sth_staff_id,\n sm_staff_name,\n sth_status,\n sth_apply_date,\n to_char(sth_apply_date, 'dd/mm/yyyy') sth_apply_date2,\n sth_fee_code||' - '||tfs_desc as fee_code_desc,\n tc_amount,\n sth_fee_code,\n sth_recommender_reason,\n sth_approve_reason,\n sm_dept_code staff_dept,\n tpr_desc,\n sth_staff_training_benefit,\n sth_dept_training_benefit,\n case sth_hod_evaluation\n WHEN 'Y' THEN 'Yes'\n WHEN 'N' THEN 'No'\n end sth_hod_evaluation2,\n sth_hod_evaluation,\n sth_participant_role\n \");\n $this->db->from(\"ims_hris.staff_training_head\");\n $this->db->join(\"ims_hris.staff_main\", \"sm_staff_id = sth_staff_id\", \"LEFT\");\n $this->db->join(\"ims_hris.training_participant_role\", \"tpr_code = sth_participant_role\", \"LEFT\");\n $this->db->join(\"ims_hris.training_fee_setup\", \"tfs_code = sth_fee_code\", \"LEFT\");\n $this->db->join(\"ims_hris.training_cost\", \"tc_cost_code = 'T001' and tc_training_refid = '$refid'\", \"LEFT\");\n $this->db->where(\"sth_training_refid\", $refid);\n $this->db->where(\"sth_staff_id\", $staff_id);\n $q = $this->db->get();\n \n return $q->row_case('UPPER');\n }", "public function seriesDetails($id);", "private function getStudent(){\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire.sql\";\n\n\t\t$this->result[\"liste_stagiaire\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_techno_carousel.sql\";\n\n\t\t$this->result[\"liste_techno\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_rs.sql\";\n\n\t\t$this->result[\"liste_rs\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t\t$spathSQLSelect = $this->GLOBALS_INI[\"PATHS\"][\"PATH_HOME\"] . $this->GLOBALS_INI[\"PATHS\"][\"PATH_MODEL\"] . \"select_stagiaire_doc.sql\";\n\n\t\t$this->result[\"liste_doc\"] = $this->obj_bdd->getSelectDatas(\n\t\t\t$spathSQLSelect,\n\t\t\tarray(\n\t\t\t\t'id_session' => $this->id_session\n\t\t\t\t),\n\t\t\t\t0\n\t\t);\n\t}", "public function getRonAdSlotReport($ronAdSlotId, $segmentId = null)\n {\n }", "function getStats($station) {\n\n\t\t$retval = array();\n\t\t$redis_key = \"station/getStats-${station}\";\n\t\t//$redis_key .= time(); // Debugging\n\t\t$redis_ttl = 300;\n\n\t\tif ($retval = $this->redisGet($redis_key)) {\n\t\t\treturn($retval);\n\n\t\t} else {\n\n\t\t\t$query = 'search index=\"septa_analytics\" '\n\t\t\t\t. 'earliest=-24h late != 999 '\n\t\t\t\t. 'nextstop=\"' . $station . '\" '\n\t\t\t\t. '| eval time=strftime(_time,\"%Y-%m-%dT%H:%M:%S\") '\n\t\t\t\t. '| eval id = trainno . \"-\" . dest | '\n\t\t\t\t. 'timechart span=1h latest(late) AS late by id '\n\t\t\t\t. '| addtotals '\n\t\t\t\t. '| timechart span=1h latest(Total) AS \"Total Minutes Late\" '\n\t\t\t\t. '| join _time [search index=\"septa_analytics\" late != 999 nextstop=\"Ardmore\" '\n\t\t\t\t\t. '| eval id = trainno . \"-\" . dest '\n\t\t\t\t\t. '| timechart span=1h count(id) AS \"# Trains\"'\n\t\t\t\t\t. ']'\n\t\t\t\t;\n\n\t\t\t$retval = $this->query($query);\n\t\t\t$retval[\"metadata\"][\"_comment\"] = \"Stats for station '$station'. How many trains per hour versus total minutes late that hour.\";\n\n\t\t\t$this->redisSetEx($redis_key, $retval, $redis_ttl);\n\t\t\treturn($retval);\n\n\t\t}\n\n\t}", "public function getScorers()\n\t{\n\t\t$data = array();\n\t\t// get the match scorers\n\t\t$scorer_query = 'SELECT u.username, u.user_id FROM users AS u, scorers AS s '.\n\t\t\t\t\t\t'WHERE s.report_id = '.$this->id.' '.\n\t\t\t\t\t\t'AND s.user_id = u.user_id';\n\t\t$scorer_result = mysql_query($scorer_query)\n\t\t\tor die(mysql_error());\n\t\twhile ($scorer_row = mysql_fetch_array($scorer_result))\n\t\t{\n\t\t\t$data[] = array('id'=>$scorer_row['user_id'],\n\t\t\t\t\t\t\t'name'=>$scorer_row['username']);\n\t\t}\n\t\treturn $data;\n\t}", "function get_all_by_survey($sid)\r\n {\r\n $this->db->select(\"*\");\r\n $this->db->where(\"sid\",$sid);\r\n return $this->db->get(\"data_files\")->result_array();\r\n }", "function getEventAndRounds($sancID) {\n\t foreach ($_SESSION['allSanctionIDs'] as $sanctions => $sanctionID) {\n\t\t if ($sancID == $sanctions) {\n\t\t\t echo $sanctions . \"<br />\";\n\t\t\t echo $sanctionID['tourneyName'];\n\t\t\t echo $sanctionID['slalomRounds'];\n\t\t\t echo $sanctionID['trickRounds'];\n\t\t\t echo $sanctionID['jumpRounds'];\n\n\n\t\t\t $_SESSION[\"thisSancID\"] = $sanctions;\n\t\t\t $_SESSION[\"thisTourneyName\"] = $sanctionID['tourneyName'];\n\t\t\t $_SESSION[\"thisSlalomRounds\"] = $sanctionID['slalomRounds'];\n\t\t\t $_SESSION[\"thisTrickRounds\"] = $sanctionID['trickRounds'];\n\t\t\t $_SESSION[\"thisJumpRounds\"] = $sanctionID['jumpRounds'];\n\t\t }\n\t }\n}", "public function getSentraData($query)\n {\n // config\n $prevPeriod = $this->getPrevDatePeriod($query['startDate'], $query['endDate']);\n\n $granularity = $this->getGranularity($query['startDate'], $query['endDate']);\n if($granularity == 'month') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n } else if($granularity == 'day') {\n $dateQuery = 'to_char(orderlines.created_at, \\'YYYY-MM-DD\\') as date';\n $dateGroupBy = array('date');\n $dateOrder = 'date asc';\n }\n\n\n $data = array();\n $data['granularity'] = $granularity;\n\n DB::enableQueryLog();\n // execute\n // TRANSACTION DATA\n // transaction count\n $currentTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('count(*)'))\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n $prevTransactionCount = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('count(*)'))\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n\n // total transaction value\n $currentTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n $prevTransactionValue = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw($query['aggregate'].'as value, coalesce(round(avg(subtotal), 0), 0) as average'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n // transaction status\n $transactionStatus = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('orderline_statuses.name, count(*)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy('orderline_statuses.name')\n ->orderByRaw('count desc')\n ->get();\n\n $transactionHistory = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw($query['aggregate'].'as value, count(*),'.$dateQuery))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n // TRANSACTION\n $data['transaction'] = array();\n $data['transaction']['count'] = array();\n $data['transaction']['count']['current'] = $currentTransactionCount[0];\n $data['transaction']['count']['prev'] = $prevTransactionCount[0];\n $data['transaction']['value'] = array();\n $data['transaction']['value']['current'] = $currentTransactionValue[0];\n $data['transaction']['value']['prev'] = $prevTransactionValue[0];\n $data['transaction']['history'] = $transactionHistory;\n $data['transaction']['status'] = $transactionStatus;\n \n // BUYER\n $currentBuyers = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->distinct('buyer_id')\n ->count('buyer_id');\n\n $prevBuyers = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->distinct('buyer_id')\n ->count('buyer_id');\n\n $buyerHistory = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw($dateQuery.',count(distinct buyer_id)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data['buyer'] = array();\n $data['buyer']['count'] = array();\n $data['buyer']['count']['current'] = $currentBuyers;\n $data['buyer']['count']['prev'] = $prevBuyers;\n $data['buyer']['history'] = $buyerHistory;\n\n\n // PRODUCT\n $product = DB::connection('marketplace')\n ->table('orderlines')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->join('products', 'orderlines.product_id', '=', 'products.id')\n ->select(DB::raw('products.id, products.name, count(*), sum(quantity) as sums, sum(orderlines.subtotal) as value'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy('products.id')\n ->orderByRaw('sums desc, products.name asc')\n ->limit(5)\n ->get();\n\n for($i=0; $i<count($product); $i++) {\n $countData = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('products', 'orderlines.product_id', '=', 'products.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('products.id', '=', $product[$i]->id)\n ->count();\n if($countData) {\n $prevData = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('products', 'orderlines.product_id', '=', 'products.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('count(*), sum(quantity) as sums, sum(orderlines.subtotal) as value'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->where('products.id', '=', $product[$i]->id)\n ->get();\n } else {\n $prevData = array();\n }\n if(count($prevData) != 0) {\n $product[$i]->count_change = (string) ($product[$i]->count - $prevData[0]->count);\n $product[$i]->sum_change = (string) ($product[$i]->sums - $prevData[0]->sums);\n $product[$i]->value_change = (string) ($product[$i]->value - $prevData[0]->value);\n } else {\n $product[$i]->count_change = (string) 0;\n $product[$i]->sum_change = (string) 0;\n $product[$i]->value_change = (string) 0;\n }\n }\n\n $data['product'] = $product;\n\n // RATING\n $currentRating = DB::connection('marketplace')\n ->table('ratings')\n ->join('feedbacks', 'ratings.feedback_id', '=', 'feedbacks.id')\n ->join('orderlines', 'feedbacks.orderline_id', '=', 'orderlines.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('round(avg(value), 2) as rating'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n $prevRating = DB::connection('marketplace')\n ->table('ratings')\n ->join('feedbacks', 'ratings.feedback_id', '=', 'feedbacks.id')\n ->join('orderlines', 'feedbacks.orderline_id', '=', 'orderlines.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('round(avg(value), 2) as rating'))\n ->where('orderlines.created_at', '>=', $prevPeriod['startDate'])\n ->where('orderlines.created_at', '<=', $prevPeriod['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->get();\n\n $ratingTrend = DB::connection('marketplace')\n ->table('ratings')\n ->join('feedbacks', 'ratings.feedback_id', '=', 'feedbacks.id')\n ->join('orderlines', 'feedbacks.orderline_id', '=', 'orderlines.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('round(avg(value), 2) as rating,'.$dateQuery))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy($dateGroupBy)\n ->orderByRaw($dateOrder)\n ->get();\n\n $data['rating'] = array();\n $data['rating']['average']['current'] = $currentRating[0]->rating;\n $data['rating']['average']['prev'] = $prevRating[0]->rating;\n $data['rating']['trend'] = $ratingTrend;\n\n $city = DB::connection('marketplace')\n ->table('orderlines')\n ->join('orders','orderlines.order_id','orders.id')\n ->join('orderline_statuses','orderlines.orderline_status_id','orderline_statuses.id')\n ->join('stores', 'orderlines.store_id', '=', 'stores.id')\n ->select(DB::raw('orders.buyer_city as name, count(*)'))\n ->where('orderlines.created_at', '>=', $query['startDate'])\n ->where('orderlines.created_at', '<=', $query['endDate'])\n ->where('orderline_statuses.name', '=', $this->successStatus)\n ->where('stores.sentra_id', '=', $query['sentraId'])\n ->groupBy('orders.buyer_city')\n ->orderByRaw('count desc')\n ->limit(5)\n ->get();\n\n $data['city'] = $city;\n\n $status = $this->setStatus();\n\n return response()->json([\n 'status' => $status,\n 'data' => $data\n ]); \n }", "public function getUserStatisticsAdditionalServiceById($id)\n {\n $sql = \"select au.auxservice_name as 'Тип сервиса',\n case \n when sa.provisioned = 1 then 'Активный'\n when sa.provisioned = 2 then 'Пауза'\n else 'Ошибка'\n end as 'Статус', \n case\n when sa.nextrecurringchargedate is null then 'отсутствует'\n else sa.nextrecurringchargedate\n end as 'Дата снятия следующей АП'\n from subscriber_aux_services sa\n inner join auxiliary_services au on au.auxservice_id = sa.auxservice_id\n inner join subscriber su on sa.subscriber_id = su.subs_id\n where su.subs_id = :id\";\n $stmt = $this->connection->prepare($sql);\n $stmt->bindValue(\"id\", $id);\n $stmt->execute();\n return $stmt->fetchAll();\n }", "function select_rollingroad_data($rrid)\n\t{\n\t\tglobal $db;\n\n\t \t$sql = \"SELECT rr.*, images.* , g.made_year, makes.make, models.model, CONCAT_WS(' ', g.made_year, makes.make, models.model) AS vehicle\n \tFROM \" . GARAGE_ROLLINGROAD_TABLE . \" AS rr\n\t\t \tLEFT JOIN \" . GARAGE_TABLE . \" AS g ON rr.garage_id = g.id\n\t\t \tLEFT JOIN \" . GARAGE_MAKES_TABLE . \" AS makes ON g.make_id = makes.id\n \tLEFT JOIN \" . GARAGE_MODELS_TABLE . \" AS models ON g.model_id = models.id\n \t\t\tLEFT JOIN \" . GARAGE_IMAGES_TABLE . \" AS images ON images.attach_id = rr.image_id \n \tWHERE rr.id = $rrid\";\n\n\t\tif ( !($result = $db->sql_query($sql)) )\n \t\t{\n \t\tmessage_die(GENERAL_ERROR, 'Could Not Select Quartermile Data', '', __LINE__, __FILE__, $sql);\n \t\t}\n\n\t\t$row = $db->sql_fetchrow($result);\n\t\t$db->sql_freeresult($result);\n\n\t\treturn $row;\n\t}", "public static function getSpecificSubspectreForSensor($deveui, $date_request)\n {\n $db = static::getDB();\n\n $sql_query_get_spectre = \"SELECT r.sensor_id, st.id AS structure_id, r.date_time AS date_d,\n `subspectre`,`subspectre_number`,`min_freq`,`max_freq`,`resolution`\n FROM `spectre` AS sp\n JOIN record AS r ON (r.id=sp.record_id)\n JOIN sensor on sensor.id = r.sensor_id\n JOIN structure as st ON (st.id=r.structure_id)\n JOIN site as s ON (s.id=st.site_id)\n WHERE CAST(r.date_time as DATE) LIKE :date_request\n AND sensor.deveui = :deveui \";\n\n $stmt = $db->prepare($sql_query_get_spectre);\n\n $stmt->bindValue(':date_request', $date_request, PDO::PARAM_STR);\n $stmt->bindValue(':deveui', $deveui, PDO::PARAM_STR);\n\n if ($stmt->execute()) {\n\n $all_spectre_data = $stmt->fetchAll(PDO::FETCH_ASSOC);\n if (empty($all_spectre_data)) {\n return 0;\n }\n return $all_spectre_data[0];\n }\n }", "function getInstruments($stationName) {\r\n $this->load->helper(array('form', 'url'));\r\n\r\n $stationName = ($stationName == \"\") ? $this->input->post('stationName') : $stationName;\r\n//check($value,$field,$table)\r\n if ($this->input->post('stationName') == \"\") {\r\n echo '<span style=\"color:#f00\">Please Input Name. </span>';\r\n } else {\r\n\r\n\r\n //$get_result = $this->DbHandler->getResults($stationName, 'StationName', 'instruments'); // $value, $field, $table\r\n //More than one result.(Array of instruments at a station)\r\n $data['results'] = $this->DbHandler->getResults($stationName, 'StationName', 'instruments');\r\n if($data['results']){ // we got a result, output json\r\n echo json_encode( $data['results'] );\r\n } else {\r\n echo json_encode( array('error' => true) );\r\n }\r\n }\r\n }", "public function getStudentsByClassIdAndSubGen($lastSeasonId,$classe){\n // $this->db->select('students.*,points.subject,points.sc,points.te');\n $this->db->select('students.*');\n $this->db->join('classes','students.classe=classes.id');\n // $this->db->join('points','points.student=students.id');\n // $this->db->where('students.classe',$classeId);\n $filter = array(\n 'students.season'=>$lastSeasonId,\n 'classes.id'=>$classe\n // 'points.subject'=>$sub\n );\n $this->db->where($filter);\n // $this->db->where_in('points.subject',$ids);\n return $this->db->get('students')->result();\n }", "public function index($sir_id = 0)\n {\n $data[\"_truck\"] = Tbl_truck::where(\"archived\",0)->where(\"truck_shop_id\",$this->user_info->shop_id)->get();\n $data[\"_employees\"] = Tbl_employee::position()->where(\"position_code\",\"sales_agent\")->where(\"shop_id\",$this->user_info->shop_id)->where(\"tbl_employee.archived\",0)->get();\n\n \n $type = [1,4]; \n $data[\"_item\"] = Item::get_all_category_item($type);\n\n $data[\"sir\"] = Tbl_sir::truck()->saleagent()->where(\"sir_id\",$sir_id)->first();\n\n return view(\"member.purchasing_inventory_system.reload_sir.reload_sir\",$data);\n \n }", "public static function download_start_stop_time_by_id($measurement_id)\r\n {\r\n\t\t$result_get_data_json = TracerouteMeasurement::get_measurement_data_by_id($measurement_id);\r\n\t\t\r\n\t\t/*\r\n $description = $result_get_data_json[description];\r\n $address_family = $result_get_data_json[af];\r\n\t\tif ($result_get_data_json[proto_tcp]) {\r\n\t\t\t$protocol = \"TCP\";\r\n\t\t} else {\r\n\t\t\t$protocol = $result_get_data_json[protocol];\r\n\t\t}\r\n\t\t*/\r\n\t\t\r\n $creation_time_unix = $result_get_data_json[creation_time];\r\n\t\t$start_time_unix = $result_get_data_json[start_time];\r\n $stop_time_unix = $result_get_data_json[stop_time];\r\n\r\n\t\t$creation_time = date(\"Y-m-d H:i:s\", $creation_time_unix);\r\n\t\t$start_time = date(\"Y-m-d H:i:s\", $start_time_unix);\r\n\t\t$stop_time = date(\"Y-m-d H:i:s\", $stop_time_unix);\r\n\t\t\r\n\t\t/*\r\n $response_timeout = $result_get_data_json[response_timeout];\r\n $paris = $result_get_data_json[paris];\r\n $packets = $result_get_data_json[packets];\r\n $port = $result_get_data_json[port];\r\n $size = $result_get_data_json[size];\r\n $maxhops = $result_get_data_json[maxhops];\r\n\t\t\r\n $number_of_probes_involved = $result_get_data_json[participant_count];\r\n\t\t\r\n $target_address = $result_get_data_json[dst_addr];\r\n $target_asn = $result_get_data_json[dst_asn];\r\n $target_name = $result_get_data_json[dst_name];\r\n\t\t\r\n\t\techo $description;\r\n\t\techo '<br/>';\r\n\t\techo $address_family;\r\n\t\techo '<br/>';\r\n\t\techo $protocol;\r\n\t\techo '<br/>';\r\n\t\techo $creation_time;\r\n\t\techo '<br/>';\r\n echo $start_time;\r\n\t\techo '<br/>';\r\n\t\techo $stop_time;\r\n\t\techo '<br/>';\r\n\t\t*/\r\n\r\n\t\t// create and check connection\r\n $link = CheckrouteDatabase::connect();\r\n\r\n\t\t// write information on new measurement to database\r\n\t\t$stmt = mysqli_prepare($link, \"UPDATE `TracerouteMeasurement` SET `creation_time`=?, `start_time`=?, `end_time`=? WHERE `id` = ?\");\r\n\t\tif ($stmt === false) {\r\n\t\t\ttrigger_error('Error: Insert statement failed. ' . htmlspecialchars(mysqli_error($mysqli)), E_USER_ERROR);\r\n\t\t}\r\n\t\t$bind = mysqli_stmt_bind_param($stmt, \"ssss\", $creation_time, $start_time, $stop_time, $measurement_id);\r\n\t\tif ($bind === false) {\r\n\t\t\ttrigger_error('Error: Bind of parameter failed. ', E_USER_ERROR);\r\n\t\t}\r\n\t\t$exec = mysqli_stmt_execute($stmt);\r\n\t\tif ($exec === false) {\r\n\t\t\ttrigger_error('Error: execution of statement failed. ' . htmlspecialchars(mysqli_stmt_error($stmt)), E_USER_ERROR);\r\n\t\t}\r\n\t\t\r\n // close database connection\r\n\t\tCheckrouteDatabase::close($link);\r\n\r\n }", "public function get_mc_analysis($mc_id=null)\r\n {\r\n try {\r\n //get global settings\r\n if(!$global = DB::table('global')->first()) return;\r\n\r\n //add constraint for a given mc_id else use foreign key\r\n $extra = $mc_id ? \"AND ss.user_id = $mc_id\" : \"AND ss.user_id = u.id\";\r\n\r\n //merchant analysis query\r\n $mca = DB::select(\"\r\n SELECT u.id as mc_id, CONCAT(u.first_name, ' ', u.last_name) as name, ss.status, ss.created_at as since,\r\n m.company_name as merchant, m.osmall_commission, m.mc_sales_staff_commission, c.name as country,\r\n sum(p.receivable) as sales_since, count(m.id) as merchant,\r\n\r\n #revenue_since\r\n (\r\n sum(p.receivable) * m.osmall_commission\r\n ) as revenue_since,\r\n\r\n #earn_since\r\n case\r\n\t\t\t\t\twhen m.mc_sales_staff_commission > 0 then (m.mc_sales_staff_commission / 100) * sum(p.receivable)\r\n\t\t\t\t\telse $global->mc_sales_staff_commission * sum(p.receivable)\r\n\t\t\t\tend as earn_since,\r\n\r\n #outstanding\r\n\t\t\t\tcase\r\n\t\t\t\t\twhen m.mc_sales_staff_commission > 0 then sum(p.receivable) * m.mc_sales_staff_commission\r\n\t\t\t\t\telse sum(p.receivable) * $global->mc_sales_staff_commission\r\n\t\t\t\tend as outstanding,\r\n\r\n #mp\r\n\t\t\t\tcase\r\n\t\t\t\t\twhen (m.mcp1_sales_staff_id <> 0 && m.mcp1_sales_staff_id <> 0) then count(m.id)\r\n\t\t\t\t\telse 0\r\n\t\t\t\tend as mp,\r\n\r\n #sales_ytd\r\n (\r\n\t\t\t\t SELECT SUM(p.receivable)\r\n\t\t\t\t FROM sales_staff ss, merchant m, users u, merchantproduct mp, orderproduct op, porder po, payment p\r\n\t\t\t\t WHERE po.created_at >= concat(year(curdate()),'-01-01')\r\n\t\t\t\t AND ss.id = m.mc_sales_staff_id AND u.id = ss.user_id AND m.id = mp.merchant_id\r\n\t\t\t\t AND op.product_id = mp.product_id AND po.id = op.porder_id AND p.id = po.payment_id\r\n\t\t\t\t AND ss.type = 'mct' AND ss.user_id = u.id\r\n\t\t\t\t) as sales_ytd,\r\n\r\n #revenue_ytd\r\n\t\t\t\t(\r\n\t\t\t\t SELECT SUM(p.receivable) * m.osmall_commission\r\n\t\t\t\t FROM sales_staff ss, merchant m, users u, merchantproduct mp, orderproduct op, porder po, payment p\r\n\t\t\t\t WHERE po.created_at >= concat(year(curdate()),'-01-01')\r\n\t\t\t\t AND ss.id = m.mc_sales_staff_id AND u.id = ss.user_id AND m.id = mp.merchant_id\r\n\t\t\t\t AND op.product_id = mp.product_id AND po.id = op.porder_id AND p.id = po.payment_id\r\n\t\t\t\t AND ss.type = 'mct' AND ss.user_id = u.id\r\n\t\t\t\t) as revenue_ytd,\r\n\r\n #earn_ytd\r\n\t\t\t\t(\r\n\t\t\t\t SELECT (\r\n\t\t\t\t case\r\n when m.mc_sales_staff_commission > 0 then m.mc_sales_staff_commission * sum(p.receivable)\r\n else $global->mc_sales_staff_commission * sum(p.receivable)\r\n end\r\n\t\t\t\t ) as earn_ytd\r\n\t\t\t\t FROM sales_staff ss, merchant m, users u, merchantproduct mp, orderproduct op, porder po, payment p\r\n\t\t\t\t WHERE po.created_at >= concat(year(curdate()),'-01-01')\r\n\t\t\t\t AND ss.id = m.mc_sales_staff_id AND u.id = ss.user_id AND m.id = mp.merchant_id\r\n\t\t\t\t AND op.product_id = mp.product_id AND po.id = op.porder_id AND p.id = po.payment_id\r\n\t\t\t\t AND ss.type = 'mct' AND ss.user_id = u.id\r\n\t\t\t\t) as earn_ytd\r\n\r\n\t\t\t\tFROM sales_staff ss\r\n\r\n\t\t\t\tLEFT JOIN merchant m ON ss.id = m.mc_sales_staff_id\r\n\t\t\t\tLEFT JOIN users u ON u.id = ss.user_id\r\n\t\t\t\tLEFT JOIN country c ON u.nationality_country_id = c.id\r\n\r\n\t\t\t\tLEFT JOIN merchantproduct mp ON m.id = mp.merchant_id\r\n\t\t\t\tLEFT JOIN orderproduct op ON op.product_id = mp.product_id\r\n\t\t\t\tLEFT JOIN porder po ON po.id = op.porder_id\r\n\t\t\t\tLEFT JOIN payment p ON p.id = po.payment_id\r\n\r\n\t\t\t\tWHERE ss.type = 'mct'\r\n\r\n\t\t\t\t$extra\r\n \");\r\n\r\n } catch(QueryException $e){\r\n throw new CustomException($e->getMessage());\r\n }\r\n\r\n $mca = is_array($mca) && !empty($mca) ? $mca : null;\r\n return $mca;\r\n }", "public function get_read() {\n\t\tif ($this->error != NULL){\n\t\t\treturn $this->sendError($this->error, \"GET\", \"RADIOS\");\n\t\t}\n\n\t\t// Token required\n\t\t/*if ($this->token == NULL) {\n\t\t\treturn $this->sendError($this->constants['tokenRequired'], \"GET\", \"RADIOS\");\n\t\t}*/\n\n\t\ttry {\n\t\t\t$results = [];\n\n\t\t\t// Only one radio\n\t\t\tif ($this->id !== NULL) {\n\t\t\t\t$results = \tRadio::where('id', $this->id)\n\t\t\t\t\t\t\t\t->with('created_by')\n\t\t\t\t\t\t\t\t->with('updated_by')\n\t\t\t\t\t\t\t\t->with('city.province.region')\n\t\t\t\t\t\t\t\t->with('country')\n\t\t\t\t\t\t\t\t->with('editorial_group')\n\t\t\t\t\t\t\t->first();\n\n\t\t\t\t$this->total = 1;\n\t\t\t}\n\t\t\t// Radios' list\n\t\t\telse {\n\n\t\t\t\t// query string like this filters[0][field]=ability&filters[0][value]=SU&filters[1][field]=city.name&filters[1][value]=Rovigo\n\t\t\t\t$filters = $this->filters;\n\n\t\t\t\t// ##### Filter for the main table #####\n\t\t\t\t\t$filters_main = [];\n\t\t\t\t\tforeach ($filters as $key => $filter) {\n\t\t\t\t\t\tif (count(explode('.', $filter['field']))==1) {\n\t\t\t\t\t\t\t$filters_main[] = $filter;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t// ##### Set filters for join table #####\n\t\t\t\t\t$filters = $this->diff_2_array($filters, $filters_main); // array_diff not applicable\n\t\t\t\t\t$filters_createdby = [];\n\t\t\t\t\t$filters_updatedby = [];\n\t\t\t\t\t$filters_city = [];\n\t\t\t\t\t$filters_province = [];\n\t\t\t\t\t$filters_region = [];\n\t\t\t\t\t$filters_country = [];\n\t\t\t\t\t$filters_editorialgroup = [];\n\t\t\t\t\tforeach ($filters as $key => $filter) {\n\n\t\t\t\t\t\t$field_exploded = explode('.', $filter['field']);\n\n\t\t\t\t\t\tswitch ($field_exploded[0]) { // at index 0 there's the city field\n\t\t\t\t\t\t\tcase \"created_by\":\n\t\t\t\t\t\t\t\t$filters_createdby[] = $filter;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"updated_by\":\n\t\t\t\t\t\t\t\t$filters_updatedby[] = $filter;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"city\":\n\t\t\t\t\t\t\t\t$filters_city[] = $filter;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"province\":\n\t\t\t\t\t\t\t\t$filters_province[] = $filter;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"region\":\n\t\t\t\t\t\t\t\t$filters_region[] = $filter;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"country\":\n\t\t\t\t\t\t\t\t$filters_country[] = $filter;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase \"editorial_group\":\n\t\t\t\t\t\t\t\t$filters_editorialgroup[] = $filter;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t// ##### Filters for other tables #####\n\n\t\t\t\t\t$results = \tRadio::with('created_by')\n\t\t\t\t\t\t\t\t\t->with('updated_by')\n\t\t\t\t\t\t\t\t\t->with('city.province.region')\n\t\t\t\t\t\t\t\t\t->with('country')\n\t\t\t\t\t\t\t\t\t->with('editorial_group');\n\n\t\t\t\t\t$results->filter($filters_main, 'radios');\n\t\t\t\t\t$results->filterBy('created_by', $filters_createdby, 'users');\n\t\t\t\t\t$results->filterBy('updated_by', $filters_updatedby, 'users');\n\t\t\t\t\t$results->filterBy('city.province.region', $filters_region, 'regions');\n\t\t\t\t\t$results->filterBy('country', $filters_country, 'countries');\n\t\t\t\t\t$results->filterBy('editorial_group', $filters_editorialgroup, 'editorial_groups');\n\n\t\t\t\t\t/*$users_columns = $this->get_table_columns('users');\n\t\t\t\t\t$radios_columns = $this->get_table_columns('radios');\n\t\t\t\t\t$cities_columns = $this->get_table_columns('cities');\n\t\t\t\t\t$provinces_columns = $this->get_table_columns('provinces');\n\t\t\t\t\t$region_columns = $this->get_table_columns('regions');\n\t\t\t\t\t$countries_columns = $this->get_table_columns('contries');\n\t\t\t\t\t$editorialgroups_columns = $this->get_table_columns('editorial_groups');\n\n\t\t\t\t\t$results = \tRadio::with('created_by')\n\t\t\t\t\t\t\t\t\t->with('updated_by')\n\t\t\t\t\t\t\t\t\t->with('city.province.region')\n\t\t\t\t\t\t\t\t\t->with('country')\n\t\t\t\t\t\t\t\t\t->with('editorial_group');\n\n\t\t\t\t\t// FILTER RADIOS TABLE\n\t\t\t\t\tif (count($filters_main)>0) {\n\t\t\t\t\t\t$results->where(function($query) use ($filters_main, $radios_columns) {\n\n\t\t\t\t\t\t\t$this->exit = false;\n\t\t\t\t\t\t\tforeach ($filters_main as $key => $filter) {\n\n\t\t\t\t\t\t\t\t// if the field exist in the table\n\t\t\t\t\t\t\t\tif (in_array($filter['field'], $radios_columns)) {\n\t\t\t\t\t\t\t\t\tswitch ((isset($filter['like'])) ? $filter['like'] : 0) {\n\t\t\t\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t\t\tdefault: // field == value\n\t\t\t\t\t\t\t\t\t\t\t$query->where($filter['field'], $filter['value']);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 1: // field == value%\n\t\t\t\t\t\t\t\t\t\t\t$query->where($filter['field'], 'LIKE', $filter['value'].'%');\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 2: // field == %value\n\t\t\t\t\t\t\t\t\t\t\t$query->where($filter['field'], 'LIKE', '%'.$filter['value']);\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 3: // field == %value%\n\t\t\t\t\t\t\t\t\t\t\t$query->where($filter['field'], 'LIKE', '%'.$filter['value'].'%');\n\t\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\telse {\n\t\t\t\t\t\t\t\t\t$this->exit = true; // $ilter['field'] doesn't match with the $radios_columns so exit\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($this->exit) {\n\t\t\t\t\t\t\treturn $this->sendError($this->constants['invalidFilters'], \"GET\", \"RADIOS\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// FILTER CREATED_BY TABLE\n\t\t\t\t\tif (count($filters_createdby)>0) {\n\t\t\t\t\t\t$results->whereHas('created_by', function($query) use($filters_createdby, $users_columns) {\n\t\t\t\t\t\t\t$this->exit = $this->filter($query, $filters_createdby, $users_columns);\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($this->exit) {\n\t\t\t\t\t\t\treturn $this->sendError($this->constants['invalidFilters'], \"GET\", \"RADIOS\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// FILTER UPDATED_BY TABLE\n\t\t\t\t\tif (count($filters_updatedby)>0) {\n\t\t\t\t\t\t$results->whereHas('created_by', function($query) use($filters_updatedby, $users_columns) {\n\t\t\t\t\t\t\t$this->exit = $this->filter($query, $filters_updatedby, $users_columns);\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($this->exit) {\n\t\t\t\t\t\t\treturn $this->sendError($this->constants['invalidFilters'], \"GET\", \"RADIOS\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// FILTER CITY TABLE\n\t\t\t\t\tif (count($filters_city)>0) {\n\t\t\t\t\t\t$results->whereHas('city', function($query) use($filters_city, $cities_columns) {\n\t\t\t\t\t\t\t$this->exit = $this->filter($query, $filters_city, $cities_columns);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tif ($this->exit) {\n\t\t\t\t\t\t\treturn $this->sendError($this->constants['invalidFilters'], \"GET\", \"RADIOS\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// FILTER PROVINCE TABLE\n\t\t\t\t\tif (count($filters_province)>0) {\n\t\t\t\t\t\t$results->whereHas('city.province', function($query) use($filters_province, $provinces_columns) {\n\t\t\t\t\t\t\t$this->exit = $this->filter($query, $filters_province, $provinces_columns);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tif ($this->exit) {\n\t\t\t\t\t\t\treturn $this->sendError($this->constants['invalidFilters'], \"GET\", \"RADIOS\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// FILTER REGION TABLE\n\t\t\t\t\tif (count($filters_region)>0) {\n\t\t\t\t\t\t$results->whereHas('city.province.region', function($query) use($filters_region, $region_columns) {\n\t\t\t\t\t\t\t$this->exit = $this->filter($query, $filters_region, $region_columns);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tif ($this->exit) {\n\t\t\t\t\t\t\treturn $this->sendError($this->constants['invalidFilters'], \"GET\", \"RADIOS\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// FILTER COUNTRY TABLE\n\t\t\t\t\tif (count($filters_country)>0) {\n\t\t\t\t\t\t$results->whereHas('country', function($query) use($filters_country, $countries_columns) {\n\t\t\t\t\t\t\t$this->exit = $this->filter($query, $filters_country, $countries_columns);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tif ($this->exit) {\n\t\t\t\t\t\t\treturn $this->sendError($this->constants['invalidFilters'], \"GET\", \"RADIOS\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// FILTER EDITORIAL GROUP TABLE\n\t\t\t\t\tif (count($filters_editorialgroup)>0) {\n\t\t\t\t\t\t$results->whereHas('editorial_group', function($query) use($filters_editorialgroup, $editorialgroups_columns) {\n\t\t\t\t\t\t\t$this->exit = $this->filter($query, $filters_editorialgroup, $editorialgroups_columns);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tif ($this->exit) {\n\t\t\t\t\t\t\treturn $this->sendError($this->constants['invalidFilters'], \"GET\", \"RADIOS\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}*/\n\n\t\t\t\t\t$this->total = $results->count();\n\n\t\t\t\t\t$results = \t$results\n\t\t\t\t\t\t\t\t->take($this->limit)\n\t\t\t\t\t\t\t\t->skip($this->limit * ($this->page-1))\n\t\t\t\t\t\t\t\t->get();\n\n\t\t\t} // end ($this->id !== NULL) else\n\n\t\t\tif (count($results) > 0) {\n\t\t\t\treturn $this->sendSuccess($this->constants['success'], \n\t\t\t\t\t\t\t\t\t\t \"GET\", \n\t\t\t\t\t\t\t\t\t\t \"RADIOS\",\n\t\t\t\t\t\t\t\t\t\t $results);\n\t\t\t}\n\n\t\t\t// NO RESULTS\n\t\t\treturn $this->sendSuccess($this->constants['noContent'], \n\t\t\t\t\t\t\t\t\t \"GET\", \n\t\t\t\t\t\t\t\t\t \"RADIOS\", \n\t\t\t\t\t\t\t\t\t $results);\n\t\t}\n\t\tcatch(\\Exception $e) {\n\t\t\tprint_r($e->getMessage());\n\t\t\treturn $this->sendError($this->constants['generic'], \"GET\", \"RADIOS\");\n\t\t}\n\t}", "public function indexRisks($id_risks)\n {\n\n $risks_politics = RisksPolitics::where('id_risks', $id_risks)->get();\n return response()->json(array(\n 'risks_politics'=> $risks_politics,\n 'status'=>'success'\n ), 200);\n }", "function getOperator_route_details(){\n $travel_id=$this->input->post('opid');\n $fdate=$this->input->post('fdate');\n $tdate=$this->input->post('tdate');\n $i=1;\n echo \"<table align='center' width='650'>\n <tr style='font-size:13px; color:#ffffff; background:#84a3b8;'>\n <th width='171'>Routes</th>\n <th width='137' height='21'>Total Tickets</th>\n <th width='157'>Tickets booked</th>\n <th width='165'>Occupancy%</th>\n </tr>\";\n if($travel_id==0){\n $this->db2->distinct();\n $this->db2->select('service_num');\n $query=$this->db2->get('master_buses');\n }else{\n $this->db2->distinct();\n $this->db2->select('service_num');\n $this->db2->where('travel_id',$travel_id); \n $query=$this->db2->get('master_buses');\n }\n foreach ($query->result() as $value) {\n $srno=$value->service_num;\n // echo $srno;\n $query1=$this->db2->query(\"select min(start_time) as busstart_time from master_buses where service_num='$srno'\");\n \n foreach ($query1->result() as $value1) {\n $busstartime=$value1->busstart_time;\n }\n \n $query2=$this->db2->query(\"select max(journey_time) as buslastdrop_time from master_buses where service_num='$srno'\");\n foreach ($query2->result() as $value2) {\n $lastbusdroptime=$value2->buslastdrop_time;\n }\n \n $query3=$this->db2->query(\"select distinct from_name from master_buses where service_num='$srno' and start_time='$busstartime'\");\n foreach ($query3->result() as $value3) {\n $from_name=$value3->from_name;\n \n }\n $query4=$this->db2->query(\"select distinct to_name from master_buses where service_num='$srno' and journey_time='$lastbusdroptime'\");\n foreach ($query4->result() as $value4) {\n $to_name=$value4->to_name;\n \n } \n \n $query5 =$this->db2->query(\"select sum(pass) as num_rows from master_booking where service_no ='$srno' and (bdate BETWEEN '\".$fdate.\"' AND '\".$tdate.\"') and (status='confirmed' || status='Confirmed')\"); \n $query6 =$this->db2->query(\"select sum(pass) as num_rows from master_booking where service_no ='$srno' and (bdate BETWEEN '\".$fdate.\"' AND '\".$tdate.\"') and (status='cancelled' || status='Cancelled')\"); \n foreach($query5->result() as $rows)\n {\n $results2=$rows->num_rows;\n }\n\n foreach($query6->result() as $row)\n {\n $results3=$row->num_rows;\n }\n $totalbooked=$results2-$results3;\n $res_query1=$this->db2->query(\"select distinct journey_date from buses_list where service_num='$srno' and (journey_date BETWEEN '\".$fdate.\"' AND '\".$tdate.\"') and status='1' \");\n $getcount=$res_query1->num_rows();\n // echo \"count\".$getcount;\n $res_query=$this->db2->query(\"select seat_nos from master_buses where service_num='$srno' \");\n foreach($res_query->result() as $rows)\n {\n $tot_res1=$rows->seat_nos;\n //echo $tot_res1;\n $tot_res=$getcount*$tot_res1;\n }\n $oc=($results2/$tot_res)*100;\n $occupancy = sprintf (\"%.3f\", $oc);\n $class = ($i%2 == 0)? 'bg': 'bg1'; \n echo '<tr class=\"'.$class.'\">';\n echo '<td height=\"30\">'.$from_name.'-'.$to_name.'</td>';\n echo '<td>'.$tot_res.'</td>';\n echo '<td>'.$totalbooked.'</td>';\n echo '<td>'.$occupancy.'</td>';\n echo '</tr>';\n $i++;\n }\n echo '</table>';\n \n }", "public function show_radrpt()\n {\n // load library to cek user session and level\n $this->pageauth->sess_level_auth();\n $this->load->model('pages/m_crud_report');\n $query = $this->m_crud_report->select_radrpt();\n foreach ($query->result() as $row) {\n echo \"<input onclick='GetRadValue()' type='radio' name='\".$row->el_name.\"' value='\".$row->rpt_code.\"'> \".$row->rpt_name.\"&nbsp;&nbsp;&nbsp;\";\n }\n }", "public function getEventoItemByRat($id)\n {\n $this->db->select('rats_item.id as id, item_evento.descricao as item, eventos.nome_evento as evento')\n ->join('item_evento', 'rats_item.item = item_evento.id', 'inner')\n ->join('eventos', 'item_evento.evento = eventos.id', 'inner') \n ->order_by('id', 'asc');\n \n \n $q = $this->db->get_where('rats_item', array('rat' => $id));\n\n if ($q->num_rows() > 0) {\n foreach (($q->result()) as $row) {\n $data[] = $row;\n }\n return $data;\n }\n return FALSE;\n \n }", "public function getRonAdTagReport($ronTagId, $segmentId = null, $hasNativeSlotContainer = false)\n {\n }", "function getRSO($rso_id, $db){\n\n\t$temp = $db->query(\"SELECT rso.name AS name, rso.description as description, rso_type.type as type, rso.joinable as joinable\n\t\tFROM rso, rso_type\n\t\tWHERE (rso.rid) = '\" . $rso_id . \"' \n\t\t\t&& (rso_type.rtid) = (rso.rtid)\");\n\t//echo '<pre>', var_dump($temp), '</pre>';\n\t$rso = $temp->fetch_assoc();\n\treturn $rso;\n}", "public function retrieveTermRecords($student_id, $class_id, $class_type, $class_arm_id, $session_id){\n\t\t\t$query = $this->connection()->prepare(\"SELECT * FROM student_term_record WHERE student_id='$student_id' AND clazz_id='$class_id' AND clazz_type_id='$class_type' AND class_arm_id='$class_arm_id' AND sessionz_id='$session_id'\");\n\t\t\t$query->execute();\n\t\t\treturn $query->fetchAll();\n\t\t}", "function getAllActiveRasInfos()\n{\n $ras_infos=array();\n $ras_ips_request=new GetActiveRasIPs();\n list($success,$ras_ips)=$ras_ips_request->send();\n if(!$success)\n return array(FALSE,$ras_ips);\n $ras_info_request=new GetRasInfo(\"\");\n foreach($ras_ips as $ras_ip)\n {\n $ras_info_request->changeParam(\"ras_ip\",$ras_ip);\n list($success,$ras_info)=$ras_info_request->send();\n if(!$success)\n return array(FALSE,$ras_info);\n $ras_infos[]=$ras_info;\n }\n return array(TRUE,$ras_infos);\n}", "public function getStation() {\n\t\t$stations = @file(Flight::get(\"pathStation\"),FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);\n\t\tif (count($stations) >=1 && $stations ) {\n\t\t\tforeach ($stations as $station) {\n\t\t\t\t$station = explode(\"#\",$station);\n\t\t\t\t$x = explode(' ',$station[0]);\n\t\t\t\t$entry[] = array('URL'=>rtrim($x[1]),'name'=>ltrim($station[1],\"#\"),'selected'=> $x[0]);\n\t\t\t}\n\t\t\tFlight::json(array('Status' => \"OK\", 'station' => $entry));\n\t\t}\n\t\telse Flight::json(array('Status' => \"KO\", 'station' => 'Not Found'));\n\t}", "function getSNPsSources($source_id){\n global $snp_service;$url=\"$snp_service?format=xml&src=1\";\n $xml = simplexml_load_file($url);$rows=\"<div class='sh'>Current SNPs Sources</div><ul id='sour'>\";\n if($xml){\n $sources=$xml->children()->source; $index=0; $count=count($sources);\n while($index < $count){$bg=\"\";\n if($index%2==0)$bg=\"style='background:#fff;'\";\n $source=$sources[$index]; ++$index;$id= $source->children()->id;$name= $source->children()->name;\n if($id==$source_id) \n $rows.=\"<li><input type='Radio' name='snpsource' value=\\\"$id\\\" checked/>&nbsp;$name&nbsp;</li>\";\n else $rows.=\"<li><input type='Radio' name='snpsource' value=\\\"$id\\\"/>&nbsp;$name&nbsp;</li>\";\n \n }\n }\n $rows.=\"</ul>\";\n return $rows; \n}", "function series($id)\n{\n global $app;\n\n $details = $app->calibre->seriesDetails($id);\n if (is_null($details)) {\n $app->getLog()->debug('no series ' . $id);\n $app->notFound();\n }\n $app->render('series_detail.html', [\n 'page' => mkPage(getMessageString('series_details'), 5, 3),\n 'series' => $details['series'],\n 'books' => $details['books']]);\n}", "public function getSummonerData($id) {\n $returnObject = []; // The object that will be returned to the front end\n $summonerId = $id;\n\n // First, find the summoner data\n try {\n $summoner = (is_numeric($id) ? Summoner::where('accountId', $id)->firstOrFail() : Summoner::where('name', $id)->firstOrFail());\n } catch (ModelNotFoundException $e) {\n $summoner = new Summoner;\n $summoner->assignDataFromAPI($id);\n }\n\n\n $returnObject['summoner'] = $summoner;\n\n $summonerId = $summoner->id;\n $accountId = $summoner->accountId;\n\n // Then get the normal and ranked matchlist for that summoner\n // Normal matchlist first\n $normalParams = [\n 'queue'=> [2,14,400,430],\n 'season'=> [9],\n 'endIndex'=> 20\n ];\n try {\n $matchListAggregate = MatchList::where('summonerId',$accountId)->get();\n if (count($matchListAggregate) == 0) {\n throw new ModelNotFoundException();\n } else {\n $found = false;\n // go through all the matchlists found, then for each matchlist, compare it to the params we were sent\n // if one of the matchlists matches the params sent in, return that, else we have to throw an exception\n foreach($matchListAggregate as $matchListEntry) {\n // if it's the same season, same list type, and less than a day old\n if ($matchListEntry->list_type == 'normal') {\n $matchListObject = $matchListEntry;\n $found = true;\n if (strtotime($matchListObject->updated_at) < (strtotime('-1 day'))) {\n $matches = $this->api->getMatchList($accountId, $normalParams);\n $tempType = gettype($matches);\n if ($tempType == \"object\") {\n $matchListObject->matches = json_encode($matches->matches);\n } else {\n $matchListObject->matches = json_encode($matches['matches']);\n }\n $matchListObject->updated_at = $matchListObject->freshTimestampString();\n $matchListObject->save();\n $this->saveMatchListMatches($this->api, $matchListObject);\n }\n }\n }\n // throw the exception since we couldn't find a matchlist that matches!\n if (!$found) {\n throw new ModelNotFoundException();\n }\n }\n } catch (ModelNotFoundException $e) {\n $matches = $this->api->getMatchList($accountId, $normalParams);\n $matchListObject = new MatchList;\n $matchListObject->summonerId = $accountId;\n $matchListObject->season = '[\"9\"]';\n $matchListObject->list_type = 'normal';\n $matchListObject->matches = json_encode($matches['matches']);\n $matchListObject->save();\n $this->saveMatchListMatches($this->api, $matchListObject);\n }\n\n $definedMatchListObject = $this->getMatchListMatches($matchListObject);\n $this->formatMatchListForDelivery($matchListObject);\n $this->formatDefinedMatchListForDelivery($definedMatchListObject);\n $returnObject['normalDefinedMatchList'] = $definedMatchListObject;\n $returnObject['normalMatchList'] = $matchListObject;\n\n // Ranked matchlist and matches next\n $rankedParams = [\n 'queue' => [410, 420, 440, 6, 41, 42],\n 'season' => [9],\n 'endIndex' => 20\n ];\n try {\n $matchListAggregate = MatchList::where('summonerId',$accountId)->get();\n if (count($matchListAggregate) == 0) {\n throw new ModelNotFoundException();\n } else {\n $found = false;\n // go through all the matchlists found, then for each matchlist, compare it to the params we were sent\n // if one of the matchlists matches the params sent in, return that, else we have to throw an exception\n foreach($matchListAggregate as $matchListEntry) {\n // if it's the same season, same list type, and less than a day old\n if ($matchListEntry->list_type == 'ranked') {\n $matchListObject = $matchListEntry;\n $found = true;\n if (strtotime($matchListObject->updated_at) < (strtotime('-1 day'))) {\n $matches = $this->api->getMatchList($accountId, $rankedParams);\n $tempType = gettype($matches);\n if ($tempType == \"object\") {\n $matchListObject->matches = json_encode($matches->matches);\n } else {\n $matchListObject->matches = json_encode($matches['matches']);\n }\n $matchListObject->updated_at = $matchListObject->freshTimestampString();\n $matchListObject->save();\n $this->saveMatchListMatches($this->api, $matchListObject);\n }\n }\n }\n // throw the exception since we couldn't find a matchlist that matches!\n if (!$found) {\n throw new ModelNotFoundException();\n }\n }\n } catch (ModelNotFoundException $e) {\n $matches = $this->api->getMatchList($accountId, $rankedParams);\n $matchListObject = new MatchList;\n $matchListObject->summonerId = $accountId;\n $matchListObject->season = '[\"9\"]';\n $matchListObject->list_type = 'ranked';\n $matchListObject->matches = json_encode($matches['matches']);\n $matchListObject->save();\n $this->saveMatchListMatches($this->api, $matchListObject);\n }\n\n $definedMatchListObject = $this->getMatchListMatches($matchListObject);\n $this->formatMatchListForDelivery($matchListObject);\n $this->formatDefinedMatchListForDelivery($definedMatchListObject);\n $returnObject['rankedMatchList'] = $matchListObject;\n $returnObject['rankedDefinedMatchList'] = $definedMatchListObject;\n\n $otherParams = [\n 'queue'=> [70, 72, 73, 75, 76, 78, 83, 98, 100, 310, 313, 317, 325, 450, 460, 470, 600, 610, 900, 910, 920, 940, 950, 960, 980, 990, 1000, 1010],\n 'season'=> [9],\n 'endIndex'=> 20\n ];\n try {\n $matchListAggregate = MatchList::where('summonerId',$accountId)->get();\n if (count($matchListAggregate) == 0) {\n throw new ModelNotFoundException();\n } else {\n $found = false;\n // go through all the matchlists found, then for each matchlist, compare it to the params we were sent\n // if one of the matchlists matches the params sent in, return that, else we have to throw an exception\n foreach($matchListAggregate as $matchListEntry) {\n // if it's the same season, same list type, and less than a day old\n if ($matchListEntry->list_type == 'other') {\n $matchListObject = $matchListEntry;\n $found = true;\n if (strtotime($matchListObject->updated_at) < (strtotime('-1 day'))) {\n $matches = $this->api->getMatchList($accountId, $otherParams);\n $tempType = gettype($matches);\n if ($tempType == \"object\") {\n $matchListObject->matches = json_encode($matches->matches);\n } else {\n $matchListObject->matches = json_encode($matches['matches']);\n }\n $matchListObject->updated_at = $matchListObject->freshTimestampString();\n $matchListObject->save();\n $this->saveMatchListMatches($this->api, $matchListObject);\n }\n }\n }\n // throw the exception since we couldn't find a matchlist that matches!\n if (!$found) {\n throw new ModelNotFoundException();\n }\n }\n } catch (ModelNotFoundException $e) {\n $matches = $this->api->getMatchList($accountId, $otherParams);\n $matchListObject = new MatchList;\n $matchListObject->summonerId = $accountId;\n $matchListObject->season = '[\"9\"]';\n $matchListObject->list_type = 'other';\n $matchListObject->matches = json_encode($matches['matches']);\n $matchListObject->save();\n $this->saveMatchListMatches($this->api, $matchListObject);\n }\n\n $definedMatchListObject = $this->getMatchListMatches($matchListObject);\n $this->formatMatchListForDelivery($matchListObject);\n $this->formatDefinedMatchListForDelivery($definedMatchListObject);\n $returnObject['otherMatchList'] = $matchListObject;\n $returnObject['otherDefinedMatchList'] = $definedMatchListObject;\n\n return response()->json(json_encode($returnObject));\n }", "public static function download_single_result_measurement_data_by_id($measurement_id)\r\n {\r\n\t\t$data = TracerouteMeasurement::get_result_data_by_id($measurement_id);\r\n\r\n\t\t// create and check connection\r\n $link = CheckrouteDatabase::connect();\r\n\t\t\r\n\t\t// get ID of source probe of this measurement and write it to the database\r\n\t\t$atlas_probe_id = $data[0][prb_id];\r\n\t\t$stmt = mysqli_prepare($link, \"UPDATE `TracerouteMeasurement` SET `probe_number`=? WHERE `id` = ?\");\r\n\t\tif ($stmt === false) {\r\n\t\t\ttrigger_error('Error: Insert statement failed. ' . htmlspecialchars(mysqli_error($mysqli)), E_USER_ERROR);\r\n\t\t}\r\n\t\t$bind = mysqli_stmt_bind_param($stmt, \"ss\", $atlas_probe_id, $measurement_id);\r\n\t\tif ($bind === false) {\r\n\t\t\ttrigger_error('Error: Bind of parameter failed. ', E_USER_ERROR);\r\n\t\t}\r\n\t\t$exec = mysqli_stmt_execute($stmt);\r\n\t\tif ($exec === false) {\r\n\t\t\ttrigger_error('Error: execution of statement failed. ' . htmlspecialchars(mysqli_stmt_error($stmt)), E_USER_ERROR);\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($data[0][result] as $traceroute_hop) {\r\n\t\t\t$hop_number = $traceroute_hop[hop];\r\n\t\t\t$traceroute_hop[result][0][from];\r\n\r\n\t\t\tif (empty($traceroute_hop[error])) {\r\n\t\t\t\t// check whether current hop was a timeout (in at least one execution)\r\n\t\t\t\tif ($traceroute_hop[result][0][x] == '*' || $traceroute_hop[result][1][x] == '*' || $traceroute_hop[result][2][x] == '*') {\r\n\t\t\t\t\t$is_timeout = 1;\r\n\t\t\t\t\t$is_varying = NULL;\r\n\t\t\t\t\t$hop_from = NULL;\r\n\t\t\t\t\t$time_to_live = NULL;\r\n\t\t\t\t\t$size_of_reply = NULL;\r\n\t\t\t\t\t$round_trip_time1 = NULL;\r\n\t\t\t\t\t$round_trip_time2 = NULL;\r\n\t\t\t\t\t$round_trip_time3 = NULL;\t\t\t\t\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$is_timeout = 0;\r\n\t\t\t\t\t// check whether all three executions of traceroute have the same source for this hop\r\n\t\t\t\t\tif (($traceroute_hop[result][0][from] == $traceroute_hop[result][1][from]) && ($traceroute_hop[result][1][from] == $traceroute_hop[result][2][from])) {\r\n\t\t\t\t\t\t$has_different_froms = false;\r\n\t\t\t\t\t\t$hop_from_formatted = $traceroute_hop[result][0][from];\r\n\t\t\t\t\t\t$hop_from = ip2long($hop_from_formatted);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$has_different_froms = true;\r\n\t\t\t\t\t\t$hop_from = NULL;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// check whether all three executions of traceroute have the same TTL for this hop\r\n\t\t\t\t\tif (($traceroute_hop[result][0][ttl] == $traceroute_hop[result][1][ttl]) && ($traceroute_hop[result][1][ttl] == $traceroute_hop[result][2][ttl])) {\r\n\t\t\t\t\t\t$has_different_ttl = false;\r\n\t\t\t\t\t\t$time_to_live = $traceroute_hop[result][0][ttl];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$has_different_ttl = true;\r\n\t\t\t\t\t\t$time_to_live = NULL;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// check whether all three executions of traceroute have the same reply size for this hop\r\n\t\t\t\t\tif (($traceroute_hop[result][0][size] == $traceroute_hop[result][1][size]) && ($traceroute_hop[result][1][size] == $traceroute_hop[result][2][size])) {\r\n\t\t\t\t\t\t$has_different_size = false;\r\n\t\t\t\t\t\t$size_of_reply = $traceroute_hop[result][0][size];\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$has_different_size = true;\r\n\t\t\t\t\t\t$size_of_reply = NULL;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$round_trip_time1 = $traceroute_hop[result][0][rtt];\r\n\t\t\t\t\t$round_trip_time2 = $traceroute_hop[result][1][rtt];\r\n\t\t\t\t\t$round_trip_time3 = $traceroute_hop[result][2][rtt];\r\n\t\t\t\t\tif ($has_different_froms || $has_different_ttl || $has_different_size) {\r\n\t\t\t\t\t\t$is_varying = 1;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$is_varying = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// write information on current hop to database\r\n\t\t\t\t$stmt = mysqli_prepare($link, \"INSERT INTO TracerouteHop (id_measurement, result_number, hop_number, from_ip, roundtrip_time1, roundtrip_time2, roundtrip_time3, size_of_reply, ttl, is_varying, is_timeout, remarks) VALUES (?, 1, ?, ?, ?, ?, ?, ?, ?, ?, ?, NULL)\");\r\n\t\t\t\tif ($stmt === false) {\r\n\t\t\t\t\ttrigger_error('Error: Insert statement failed. ' . htmlspecialchars(mysqli_error($mysqli)), E_USER_ERROR);\r\n\t\t\t\t}\r\n\t\t\t\t$bind = mysqli_stmt_bind_param($stmt, \"ssssssssss\", $measurement_id, $hop_number, $hop_from, $round_trip_time1, $round_trip_time2, $round_trip_time3, $size_of_reply, $time_to_live, $is_varying, $is_timeout);\r\n\t\t\t\tif ($bind === false) {\r\n\t\t\t\t\ttrigger_error('Error: Bind of parameter failed. ', E_USER_ERROR);\r\n\t\t\t\t}\r\n\t\t\t\t$exec = mysqli_stmt_execute($stmt);\r\n\t\t\t\tif ($exec === false) {\r\n\t\t\t\t\ttrigger_error('Error: execution of statement failed. ' . htmlspecialchars(mysqli_stmt_error($stmt)), E_USER_ERROR);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t// error in this hop\r\n\t\t\t\techo 'Error in traceroute hop detected: ' . $traceroute_hop[error];\r\n\r\n\t\t\t\t// write information on current hop to database\r\n\t\t\t\t$stmt = mysqli_prepare($link, \"INSERT INTO TracerouteHop (id_measurement, result_number, hop_number, from_ip, roundtrip_time1, roundtrip_time2, roundtrip_time3, size_of_reply, ttl, is_varying, is_timeout, remarks) VALUES (?, 1, ?, ?, ?, ?, ?, ?, ?, ?, 0, NULL)\");\r\n\t\t\t\tif ($stmt === false) {\r\n\t\t\t\t\ttrigger_error('Error: Insert statement failed. ' . htmlspecialchars(mysqli_error($mysqli)), E_USER_ERROR);\r\n\t\t\t\t}\r\n\t\t\t\t$bind = mysqli_stmt_bind_param($stmt, \"sssssssss\", $measurement_id, $hop_number, $hop_from, $round_trip_time1, $round_trip_time2, $round_trip_time3, $size_of_reply, $time_to_live, $is_varying);\r\n\t\t\t\tif ($bind === false) {\r\n\t\t\t\t\ttrigger_error('Error: Bind of parameter failed. ', E_USER_ERROR);\r\n\t\t\t\t}\r\n\t\t\t\t$exec = mysqli_stmt_execute($stmt);\r\n\t\t\t\tif ($exec === false) {\r\n\t\t\t\t\ttrigger_error('Error: execution of statement failed. ' . htmlspecialchars(mysqli_stmt_error($stmt)), E_USER_ERROR);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n // close database connection\r\n\t\tCheckrouteDatabase::close($link);\r\n\t}", "public function getObservationsFromRequest() {\n \n // Load the observations from the database\n if (!$this->cDatabaseConnection->load($this->cLatestObservations)) {\n $this->logError($this->cDatabaseConnection->lastError());\n }\n\n // Get the latest observations from sensor data\n $lLsid = $this->cStationDataReceiver->getLsid(); \n\t\t$lDataStructureType=$this->cStationDataReceiver->getDataStructureType();\n\t\t$lTransmitterID=$this->cStationDataReceiver->getTransmitterID();\n\t\t$lTemp=$this->cStationDataReceiver->getTemp();\n\t\t$lHum = $this->cStationDataReceiver->getHum();\n\t\t$lDewPoint= $this->cStationDataReceiver->getDewPoint();\n\t\t$lWetBulb = $this->cStationDataReceiver->getWetBulb();\n\t\t$lHeatIndex = $this->cStationDataReceiver->getHeatIndex();\n\t\t$lWindChill = $this->cStationDataReceiver->getWindChill();\n\t\t$lThwIndex = $this->cStationDataReceiver->getThwIndex();\n\t\t$lThswIndex = $this->cStationDataReceiver->getThswIndex();\n\t\t$lWindSpeedLast = $this->cStationDataReceiver->getWindPpeedLast();\n\t\t$lWindDirLast = $this->cStationDataReceiver->getWindDirLast();\n\t\t$lWindSpeedAvgLast_1_min = $this->cStationDataReceiver->getWindSpeedAvgLast_1_min();\n\t\t$lWindDirScalarAvg_last_1_min = $this->cStationDataReceiver->getWindDirScalarAvg_last_1_min();\n\t\t$lWindSpeedAvgLast_2_min = $this->cStationDataReceiver->getWindSpeedAvgLast_2_min();\n\t\t$lWindDirScalarAvg_last_2_min = $this->cStationDataReceiver->getWindDirScalarAvg_last_2_min();\n\t\t$lWindSpeedHi_last_2_min = $this->cStationDataReceiver->getWindSpeedHi_last_2_min();\n\t\t$lWindDirAtHiSpeedLast_2_min = $this->cStationDataReceiver->getWindDirAtHiSpeedLast_2_min();\n\t\t$lWindSpeedAvgLast_10_min = $this->cStationDataReceiver->getWindSpeedAvgLast_10_min();\n\t\t$lWindDirScalarAvgLast_10_min = $this->cStationDataReceiver->getWindDirScalarAvgLast_10_min();\n\t\t$lWindSpeedHiLast_10_min = $this->cStationDataReceiver->getWindSpeedHiLast_10_min();\n\t\t$lWindDirAtHiSpeedLast_10_min = $this->cStationDataReceiver->getWindDirAtHiSpeedLast_10_min();\n\t\t$lRainSize = $this->cStationDataReceiver->getRainSize();\n\t\t$lRainRateLast = $this->cStationDataReceiver->getRainRateLast();\n\t\t$lRainRateHi = $this->cStationDataReceiver->getRainRateHi();\n\t\t$lRainfallLast_15_min = $this->cStationDataReceiver->getRainfallLast_15_min();\n\t\t$lRainRateHiLast_15_min = $this->cStationDataReceiver->getRainRateHiLast_15_min();\n\t\t$lRainfallLast_60_min = $this->cStationDataReceiver->getRainfallLast_60_min();\n\t\t$lRainfallLast_24_hr = $this->cStationDataReceiver->getRainfallLast_24_hr();\n\t\t$lRainStorm = $this->cStationDataReceiver->getRainStorm();\n\t\t$lRainStormStartAt = $this->cStationDataReceiver->getRainStormStartAt();\n\t\t$lSolarRad = $this->cStationDataReceiver->getSolarRad();\n\t\t$lUvIndex = $this->cStationDataReceiver->getUvIndex();\n\t\t$lRxState = $this->cStationDataReceiver->getRxState(1);\n\t\t$lTransBatteryFlag = $this->cStationDataReceiver->getTransBatteryFlag(1);\n\t\t$lRrainfallDaily = $this->cStationDataReceiver->getRrainfallDaily();\n\t\t$lRainfallMonthly = $this->cStationDataReceiver->getRainfallMonthly();\n\t\t$lRainfallYear = $this->cStationDataReceiver->getRainfallYear();\n\t\t$lRainStormLast = $this->cStationDataReceiver->getRainStormLast();\n\t\t$lRainStormLastStartAt = $this->cStationDataReceiver->getRainStormLastStartAtSeconds();\n\t\t$lRainStormLastEndAt = $this->cStationDataReceiver->getRainStormLastEndAtSeconds();\n\t\t$lSoilTemp1 = $this->cStationDataReceiver->getSoilTemp1();\n\t\t$lTemp_3 = $this->cStationDataReceiver->getTemp_2();\n\t\t$lTemp_4 = $this->cStationDataReceiver->getTemp_3();\n\t\t$lTemp_2 = $this->cStationDataReceiver->getTemp_4();\n\t\t$lMoistSoil1 = $this->cStationDataReceiver->getMoistSoil1();\n\t\t$lMpistSoil2 = $this->cStationDataReceiver->getMpistSoil2();\n\t\t$lMoistSoil3 = $this->cStationDataReceiver->getMoistSoil3();\n\t\t$lMoistSoil4 = $this->cStationDataReceiver->getMoistSoil4();\n\t\t$lWetleaf1 = $this->cStationDataReceiver->getWetleaf1();\n\t\t$lWetleaf2 = $this->cStationDataReceiver->getWetleaf2();\n\t\t$lInTemp = $this->cStationDataReceiver->getInTemp();\n\t\t$lInHum = $this->cStationDataReceiver->getInHum();\n\t\t$lInDewPoint = $this->cStationDataReceiver->getInDewPoint();\n\t\t$lInHeatIndex = $this->cStationDataReceiver->getInHeatIndex();\n\t\t$lBarSeaLevel = $this->cStationDataReceiver->getBarSeaLevel();\n\t\t$lBarTrend = $this->cStationDataReceiver->getBarTrend();\n\t\t$lBarAbsolute = $this->cStationDataReceiver->getBarAbsolute();\n\t\t$lObservationReceiveTime = $this->cStationDataReceiver->getTimeReceived();\n $lPrevPacketLatency = $this->cStationDataReceiver->getLatency();\n\n\t\t// Only update the observations if data is available, otherwise keep existing data\n\t\tif ($lLsid!==NULL) {$this->cLatestObservations->setLsid($lLsid);} \n\t\tif ($lDataStructureType!==NULL) {$this->cLatestObservations->setDataStructureType($lDataStructureType);} \n\t\tif ($lTransmitterID!==NULL) {$this->cLatestObservations->setTransmitterID($lTransmitterID);} \n\t\tif ($lTemp!==NULL) {$this->cLatestObservations->setTemp($lTemp);} \n if ($lHum!==NULL) {$this->cLatestObservations->setHum($lHum);} \n\t\tif ($lDewPoint!==NULL) {$this->cLatestObservations->setDewPoint($lDewPoint);} \n\t\tif ($lWetBulb!==NULL) {$this->cLatestObservations->setWetBulb($lWetBulb);} \n\t\tif ($lHeatIndex!==NULL) {$this->cLatestObservations->setHeatIndex($lHeatIndex);} \n\t\tif ($lWindChill!==NULL) {$this->cLatestObservations->setWindChill($lWindChill);} \n\t\tif ($lThwIndex!==NULL) {$this->cLatestObservations->setThwIndex($lThwIndex);} \n\t\tif ($lThswIndex!==NULL) {$this->cLatestObservations->setThswIndex($lThswIndex);} \n\t\t \n\t\tif ($lWindSpeedAvgLast_1_min!==NULL) {$this->cLatestObservations->setWindSpeedAvgLast_1_min($lWindSpeedAvgLast_1_min);} \n\t\tif ($lWindDirScalarAvg_last_1_min!==NULL) {$this->cLatestObservations->setWindDirScalarAvg_last_1_min($lWindDirScalarAvg_last_1_min);} \n\t\tif ($lWindSpeedAvgLast_2_min!==NULL) {$this->cLatestObservations->setWindSpeedAvgLast_2_min($lWindSpeedAvgLast_2_min);} \n\t\tif ($lWindDirScalarAvg_last_2_min!==NULL) {$this->cLatestObservations->setWindDirScalarAvg_last_2_min($lWindDirScalarAvg_last_2_min);} \n\t\tif ($lWindSpeedHi_last_2_min!==NULL) {$this->cLatestObservations->setWindSpeedHi_last_2_min($lWindSpeedHi_last_2_min);} \n\t\tif ($lWindDirAtHiSpeedLast_2_min!==NULL) {$this->cLatestObservations->setWindDirAtHiSpeedLast_2_min($lWindDirAtHiSpeedLast_2_min);} \n\t\tif ($lWindSpeedAvgLast_10_min!==NULL) {$this->cLatestObservations->setWindSpeedAvgLast_10_min($lWindSpeedAvgLast_10_min);} \n\t\tif ($lWindDirScalarAvgLast_10_min!==NULL) {$this->cLatestObservations->setWindDirScalarAvgLast_10_min($lWindDirScalarAvgLast_10_min);} \n\t\tif ($lWindSpeedHiLast_10_min!==NULL) {$this->cLatestObservations->setWindSpeedHiLast_10_min($lWindSpeedHiLast_10_min);} \n\t\tif ($lWindDirAtHiSpeedLast_10_min!==NULL) {$this->cLatestObservations->setWindDirAtHiSpeedLast_10_min($lWindDirAtHiSpeedLast_10_min);} \n\t\tif ($lRainSize!==NULL) {$this->cLatestObservations->setRainSize($lRainSize);} \n\t\tif ($lRainRateHi!==NULL) {$this->cLatestObservations->setRainRateHi($lRainRateHi);} \n\t\tif ($lRainRateHiLast_15_min!==NULL) {$this->cLatestObservations->setRainRateHiLast_15_min($lRainRateHiLast_15_min);} \n if ($lRainfallLast_15_min!==NULL) {$this->cLatestObservations->setRainfallLast_15_min($lRainfallLast_15_min);}\n if ($lRainfallLast_60_min!==NULL) {$this->cLatestObservations->setRainfallLast_60_min($lRainfallLast_60_min);}\n\t\tif ($lRainfallLast_24_hr!==NULL) {$this->cLatestObservations->setRainfallLast_24_hr($lRainfallLast_24_hr);}\n\n // This value can have NULL assigned to it because if it not currently raining, the rain storm \n // would have stopped, and the Rain Storm Start At value would not make any sense.\n $this->cLatestObservations->setRainStormStartAt($lRainStormStartAt); \n $this->cLatestObservations->setRainStorm($lRainStorm);\n $this->cLatestObservations->setWindPpeedLast($lWindSpeedLast);\n\t\t\n // If there is no wind speed, there is no wind direction. So don't set the wind direction\n if ($lWindSpeedLast>0) $this->cLatestObservations->setWindDirLast($lWindDirLast); \n \n $this->cLatestObservations->setRainRateLast($lRainRateLast);\n\n $this->cLatestObservations->setObservationReceiveTime($lObservationReceiveTime);\n $this->cLatestObservations->setPrevPacketLatency($lPrevPacketLatency);\n\n if ($lSolarRad!==NULL) {$this->cLatestObservations->setSolarRad($lSolarRad);} \n\t\tif ($lUvIndex!==NULL) {$this->cLatestObservations->setUvIndex($lUvIndex);} \n\t\tif ($lRxState!==NULL) {$this->cLatestObservations->setRxState($lRxState);} \n\t\tif ($lTransBatteryFlag!==NULL) {$this->cLatestObservations->setTransBatteryFlag($lTransBatteryFlag);} \n\t\tif ($lRrainfallDaily!==NULL) {$this->cLatestObservations->setRrainfallDaily($lRrainfallDaily);} \n\t\tif ($lRainfallMonthly!==NULL) {$this->cLatestObservations->setRainfallMonthly($lRainfallMonthly);} \n\t\tif ($lRainfallYear!==NULL) {$this->cLatestObservations->setRainfallYear($lRainfallYear);} \n\t\tif ($lRainStormLast!==NULL) {$this->cLatestObservations->setRainStormLast($lRainStormLast);} \n\t\tif ($lRainStormLastStartAt!==NULL) {$this->cLatestObservations->setRainStormLastStartAt($lRainStormLastStartAt);} \n\t\tif ($lRainStormLastEndAt!==NULL) {$this->cLatestObservations->setRainStormLastEndAt($lRainStormLastEndAt);} \n\t\tif ($lSoilTemp1!==NULL) {$this->cLatestObservations->setSoilTemp1($lSoilTemp1);} \n\t\tif ($lTemp_3!==NULL) {$this->cLatestObservations->setTemp_2($lTemp_3);} \n\t\tif ($lTemp_4!==NULL) {$this->cLatestObservations->setTemp_3($lTemp_4);} \n\t\tif ($lTemp_2!==NULL) {$this->cLatestObservations->setTemp_4($lTemp_2);} \n\t\tif ($lMoistSoil1!==NULL) {$this->cLatestObservations->setMoistSoil1($lMoistSoil1);} \n\t\tif ($lMpistSoil2!==NULL) {$this->cLatestObservations->setMpistSoil2($lMpistSoil2);} \n\t\tif ($lMoistSoil3!==NULL) {$this->cLatestObservations->setMoistSoil3($lMoistSoil3);} \n\t\tif ($lMoistSoil4!==NULL) {$this->cLatestObservations->setMoistSoil4($lMoistSoil4);} \n\t\tif ($lWetleaf1!==NULL) {$this->cLatestObservations->setWetleaf1($lWetleaf1);} \n\t\tif ($lWetleaf2!==NULL) {$this->cLatestObservations->setWetleaf2($lWetleaf2);} \n\t\tif ($lInTemp!==NULL) {$this->cLatestObservations->setInTemp($lInTemp);} \n\t\tif ($lInHum!==NULL) {$this->cLatestObservations->setInHum($lInHum);} \n\t\tif ($lInDewPoint!==NULL) {$this->cLatestObservations->setInDewPoint($lInDewPoint);} \n\t\tif ($lInHeatIndex!==NULL) {$this->cLatestObservations->setInHeatIndex($lInHeatIndex);} \n\t\tif ($lBarSeaLevel!==NULL) {$this->cLatestObservations->setBarSeaLevel($lBarSeaLevel);} \n\t\tif ($lBarTrend!==NULL) {$this->cLatestObservations->setBarTrend($lBarTrend);} \n\t\tif ($lBarAbsolute!==NULL) {$this->cLatestObservations->setBarAbsolute($lBarAbsolute);} \n\n // Save the observations to the database\n if (!$this->cDatabaseConnection->save($this->cLatestObservations)) {\n $this->logError($this->cDatabaseConnection->lastError());\n return false;\n }\n \n return true;\n\n }", "public function get_single_service_detail($service_id) {\n $this->db->select('business_services.*,business_services_details.description,business_services_details.duration,business_services_details.price,business_services_details.service_type,business_services_details.discount,business_services_details.discount_start_date,business_services_details.discount_end_date');\n $this->db->from('business_services');\n $this->db->join('business_services_details', 'business_services.id = business_services_details.service_id');\n $this->db->where('business_services.id', $service_id);\n $query = $this->db->get();\n $query_result = $query->result();\n $business_service_details = array();\n if (!empty($query_result)) {\n $business_service_details['details'] = $query_result[0];\n } else {\n $business_service_details['details'] = $query_result;\n }\n\n\n $gallery_query = $this->db->get_where('business_service_gallery', array('service_id' => $service_id));\n $gallery_query_result = $gallery_query->result();\n $business_service_details['gallery'] = $gallery_query_result;\n\n $membership_query = $this->db->get_where('memberships', array('business_service_id' => $service_id));\n $membership_query_result = $membership_query->result();\n $business_service_details['memberships'] = $membership_query_result;\n\n $slot_query = $this->db->get_where('services_slots', array('service_id' => $service_id));\n $slot_query_result = $slot_query->result();\n $slots = array();\n foreach ($slot_query_result as $key => $value) {\n $check_date = date('D', strtotime($value->date));\n if ($check_date == 'Mon') {\n $slots['1'][] = $value;\n } elseif ($check_date == 'Tue') {\n $slots['2'][] = $value;\n } elseif ($check_date == 'Wed') {\n $slots['3'][] = $value;\n } elseif ($check_date == 'Thu') {\n $slots['4'][] = $value;\n } elseif ($check_date == 'Fri') {\n $slots['5'][] = $value;\n } elseif ($check_date == 'Sat') {\n $slots['6'][] = $value;\n } elseif ($check_date == 'Sun') {\n $slots['7'][] = $value;\n }\n asort($slots);\n }\n $business_service_details['slots'] = $slots;\n\n return $business_service_details;\n }", "public function find($id)\n {\n if ($id == 0) {\n $bands = DB::select(DB::raw(\"select * from bands\"));\n if (count($bands)) {\n $status = 'success';\n $data = $bands;\n }else{\n $status = 'failure';\n $data = null;\n }\n }else{\n $band = DB::select(DB::raw(\"select * from bands where id = $id\"));\n if (count($band)) {\n $status = 'success';\n $data = $band[0];\n }else{\n $status = 'failure';\n $data = null;\n }\n }\n $response = [\n 'status' => $status,\n 'data' => $data\n ];\n return json_encode($response);\n }", "public static function reconstituteOneSpectreForSensorSecondGeneration($deveui, $date_request)\n {\n\n $fullSpectreArr = array();\n\n $allSubspectresArr = SpectreManager::getAllFirstSubspectreForSensorSecondGeneration($deveui, $date_request);\n\n if (isset($date_request)) {\n //There is only one spectre to deal with\n\n $firstSubSpectreArr = $allSubspectresArr[0];\n $record_id = $firstSubSpectreArr[\"record_id\"];\n $date_time = $firstSubSpectreArr[\"date_time\"];\n $fullSpectreArr[\"min_freq\"] = 1;\n $fullSpectreArr[\"max_freq\"] = 1550;\n $fullSpectreArr[\"record_id\"] = $record_id;\n $fullSpectreArr[\"date_time\"] = $date_time;\n $fullSpectreArr[\"structure_name\"] = $firstSubSpectreArr[\"structure_name\"];\n $fullSpectreArr[\"transmission_name\"] = $firstSubSpectreArr[\"transmission_name\"];\n $fullSpectreArr[\"site_name\"] = $firstSubSpectreArr[\"site_name\"];\n $fullSpectreArr[\"deveui\"] = $firstSubSpectreArr[\"deveui\"];\n\n $subspectreID = 1;\n\n $full_spectre_decomposed = SpectreManager::getAllSubspectres($deveui, $date_request);\n\n for ($i = 0; $i < count($full_spectre_decomposed); $i++) {\n $subspectre_name = 'subspectre_' . $subspectreID;\n\n $subspectreNumber = $full_spectre_decomposed[$i][\"subspectre_number\"];\n\n $fullSpectreArr[$subspectre_name][\"record_id\"] = $full_spectre_decomposed[$i][\"record_id\"];\n $fullSpectreArr[$subspectre_name][\"structure_name\"] = $full_spectre_decomposed[$i][\"structure_name\"];\n $fullSpectreArr[$subspectre_name][\"transmission_name\"] = $full_spectre_decomposed[$i][\"transmission_name\"];\n $fullSpectreArr[$subspectre_name][\"site_name\"] = $full_spectre_decomposed[$i][\"site_name\"];\n $fullSpectreArr[$subspectre_name][\"deveui\"] = $full_spectre_decomposed[$i][\"deveui\"];\n $fullSpectreArr[$subspectre_name][\"date_time\"] = $full_spectre_decomposed[$i][\"date_time\"];\n $fullSpectreArr[$subspectre_name][\"data\"] = $full_spectre_decomposed[$i][\"subspectre\"];\n $fullSpectreArr[$subspectre_name][\"resolution\"] = $full_spectre_decomposed[$i][\"resolution\"];\n $fullSpectreArr[$subspectre_name][\"min_freq\"] = $full_spectre_decomposed[$i][\"min_freq\"];\n $fullSpectreArr[$subspectre_name][\"max_freq\"] = $full_spectre_decomposed[$i][\"max_freq\"];\n\n $subspectreID++;\n }\n }\n\n //var_dump($fullSpectreArr);\n return $fullSpectreArr;\n }", "public function getstudentInfoByApplicationId($id) {\n $this->db->select('stu.*,stu_info.*,p.*');\n $this->db->from('studentinfo stu_info');\n $this->db->join('student stu', 'stu.applicationId=stu_info.applicationId');\n $this->db->join('programoffer p', 'p.programOfferId=stu.programOfferId');\n $this->db->where('stu_info.applicationId', $id);\n\n $query = $this->db->get();\n $result = $query->row_array();\n if (!empty($result)) {\n return $result;\n }\n }", "public function pullSubReqData()\n {\n // Make the query\n $q = \"SELECT id_user, id_team, id_event, sex_needed,\n experience_needed, id_region\n FROM subrequests\n WHERE id_subrequest = {$this->id_subrequest}\n LIMIT 1\";\n\n // Execute the query & store result\n $result = $this->_dbObject->getRow($q);\n\n // Found result\n if($result !== false) {\n $this->setSRAttributes($result['id_user'], $result['id_team'], $result['id_event'],\n $result['sex_needed'], $result['experience_needed'],\n $result['id_region']);\n }\n }", "public function getsmsDetail($master_id){\n\t\ttry{\n\t\t\t$select = $this->_db->select()\n\t\t\t\t\t->from(array('SSS' =>STATUS_SMS_SETTING),array('*'))\n\t\t\t\t\t->joininner(array('FT' =>FORWARDERS),'FT.forwarder_id = SSS.forwarder_id',array('FT.forwarder_name'))\t\t\t\t\t\n\t\t\t\t\t->where('SSS.master_id='.$master_id);\t\n\t\t\t\t//echo $select->__tostring();die;\t\t\t\t\t\n return $this->getAdapter()->fetchAll($select);\n\t\t}catch (Exception $e) {\n\t\t\t\t $this->_logger->info('Class-'.__CLASS__.',Function-'.__FUNCTION__.',Line-'.__LINE__.',Error-'.$e->getMessage());\n\t\t}\n }", "public function get_data_avt130($studCom)\n {\n\n $training_org = TrainingOrganisation::first();\n // dd($training_org);\n // $sc = new StudentCompletion;\n // $studCom = $sc->avetmiss_compliant($dateFrom, $dateTo, $reportTo);\n\n $data = [];\n\n foreach($studCom as $val){\n if($val->completion_status_id == 3){\n $data[$val->id] = $val->toArray();\n $data[$val->id]['certificate'] = isset($val->certificate->id) ? $val->certificate->toArray() : null;\n $data[$val->id]['organisation'] = $training_org->toArray();\n }\n }\n\n // dd($data);\n return $data;\n \n // return collect( json_decode( json_encode( DB::select(DB::raw(\"SELECT\n // \t (SELECT `org_identifier` FROM `vrx_organisation_info`) AS train_org_identifier,\n // CONCAT('2019', vrx_student_info.uniq_stud_identifier) AS client_identifier,\n // vrx_courses.code prg_identifier,\n // DATE_FORMAT(`vrx_student_completion_details`.end_date,'%d%m%Y') AS date_prg_completed,\n // DATE_FORMAT(`vrx_student_completion_details`.end_date,'%Y') AS year_prg_completed,\n // 'Y' AS issued_flag\n // -- vrx_party.name AS fullname\n // FROM vrx_student_completion\n // INNER JOIN vrx_student_completion_details ON vrx_student_completion_details.student_completion_id = vrx_student_completion.id\n // -- INNER JOIN vrx_users ON (vrx_training_schedule.trainer_id = vrx_users.id)\n // INNER JOIN vrx_courses ON vrx_courses.code = vrx_student_completion.course_code\n // -- INNER JOIN vrx_stud_train_sched ON (vrx_training_schedule.id = vrx_stud_train_sched.schedule_id)\n // -- INNER JOIN vrx_deals ON (vrx_deals.id = vrx_stud_train_sched.deal_id)\n // INNER JOIN vrx_persons ON vrx_persons.id = vrx_student_completion.persons_id\n // INNER JOIN vrx_party ON vrx_party.id = vrx_persons.party_id\n // INNER JOIN vrx_deals ON vrx_deals.party_id = vrx_party.id\n // INNER JOIN vrx_deal_details ON (vrx_deals.id = vrx_deal_details.deal_id)\n // INNER JOIN vrx_enrolments ON (vrx_deals.id = vrx_enrolments.deal_id)\n // INNER JOIN vrx_student_info ON (vrx_student_info.person_id = vrx_persons.id)\n // -- INNER JOIN vrx_party ON (vrx_party.id = vrx_deals.party_id)\n // -- INNER JOIN vrx_persons ON (vrx_persons.party_id = vrx_party.id)\n // INNER JOIN vrx_address ON (vrx_address.party_id = vrx_party.id)\n // -- INNER JOIN vrx_training_plan ON (vrx_training_plan.deal_id = vrx_deals.id)\n // INNER JOIN vrx_opportunities ON (vrx_opportunities.deal_id = vrx_deals.id)\n // WHERE\n // vrx_student_completion_details.end_date BETWEEN '{$dateFrom}' AND '{$dateTo}'\n // AND vrx_student_info.uniq_stud_identifier IS NOT NULL\n // -- AND vrx_training_schedule.status_id = 6\n // AND vrx_student_completion.completion_date IS NOT NULL\n // AND vrx_student_completion.deleted_at IS NULL\n // AND vrx_student_completion.completion_status_id = 3\n // AND vrx_deals.deleted_at IS NULL\n // AND vrx_courses.code != '1111'\n // -- AND vrx_training_plan.deleted_at IS NULL\n // -- AND vrx_stud_train_sched.stud_stat_id IN (3)\n // GROUP BY\n // vrx_deals.id\n // ORDER BY\n // vrx_student_completion_details.end_date\")) ), true ) );\n }", "public function show($id)\n {\n $test_id = $id;\n\n $test = Test::findorfail($id);\n $test = Test::where('id', $test_id)->first();\n\n $max_a = Result::where('test_id', $test_id)->where('class', 'IX-A')->max('value');\n $min_a = Result::where('test_id', $test_id)->where('class', 'IX-A')->min('value');\n $avg_a = Result::where('test_id', $test_id)->where('class', 'IX-A')->avg('value');\n\n $max_b = Result::where('test_id', $test_id)->where('class', 'IX-B')->max('value');\n $min_b = Result::where('test_id', $test_id)->where('class', 'IX-B')->min('value');\n $avg_b = Result::where('test_id', $test_id)->where('class', 'IX-B')->avg('value');\n\n $max_c = Result::where('test_id', $test_id)->where('class', 'IX-C')->max('value');\n $min_c = Result::where('test_id', $test_id)->where('class', 'IX-C')->min('value');\n $avg_c = Result::where('test_id', $test_id)->where('class', 'IX-C')->avg('value');\n\n $max_d = Result::where('test_id', $test_id)->where('class', 'IX-D')->max('value');\n $min_d = Result::where('test_id', $test_id)->where('class', 'IX-D')->min('value');\n $avg_d = Result::where('test_id', $test_id)->where('class', 'IX-D')->avg('value');\n\n $data_a = array(\n 'name' => $test->user->name,\n 'subject' => $test->subject,\n 'subject_test' => $test->subject_test,\n 'time' => $test->time,\n 'start' => $test->start,\n 'num_questions' => $test->num_questions,\n 'max' => $max_a,\n 'min' => $min_a,\n 'avg' => $avg_a\n );\n\n $data_b = array(\n 'name' => $test->user->name,\n 'subject' => $test->subject,\n 'subject_test' => $test->subject_test,\n 'time' => $test->time,\n 'start' => $test->start,\n 'num_questions' => $test->num_questions,\n 'max' => $max_b,\n 'min' => $min_b,\n 'avg' => $avg_b\n );\n\n $data_c = array(\n 'name' => $test->user->name,\n 'subject' => $test->subject,\n 'subject_test' => $test->subject_test,\n 'time' => $test->time,\n 'start' => $test->start,\n 'num_questions' => $test->num_questions,\n 'max' => $max_c,\n 'min' => $min_c,\n 'avg' => $avg_c\n );\n\n $data_d = array(\n 'name' => $test->user->name,\n 'subject' => $test->subject,\n 'subject_test' => $test->subject_test,\n 'time' => $test->time,\n 'start' => $test->start,\n 'num_questions' => $test->num_questions,\n 'max' => $max_d,\n 'min' => $min_d,\n 'avg' => $avg_d\n );\n\n\n $IX_A = Result::where('test_id', $test_id)\n ->where('class', 'IX-A')\n ->get();\n\n $IX_B = Result::where('test_id', $test_id)\n ->where('class', 'IX-B')\n ->get();\n\n $IX_C = Result::where('test_id', $test_id)\n ->where('class', 'IX-C')\n ->get();\n\n $IX_D = Result::where('test_id', $test_id)\n ->where('class', 'IX-D')\n ->get();\n\n $result = array(\n 'IX_A' => $IX_A,\n 'IX_B' => $IX_B,\n 'IX_C' => $IX_C,\n 'IX_D' => $IX_D,\n );\n\n return view('results.show')->with(compact('test_id','result', 'data_a', 'data_b', 'data_c', 'data_d'));\n\n }", "public function index()\n {\n try{\n\n $data = [];\n $data['sample'] = ServiceLog::select('s.id as sample_id','t_service_log.updated_at as ID','m.enroll_id', 'e.label', 'm.receive_date as receive',\n 'm.test_reason as reason','m.sample_quality','m.sample_type', 'm.others_type', 'is_accepted','s.result','t_service_log.sample_label','t_service_log.stage','t_service_log.service_id',\n\t\t't_service_log.id as log_id', 't_service_log.status','m.fu_month','m.service_id as serviceID','t_service_log.enroll_id AS enrollID','t_service_log.tag',\n 't_service_log.status as STATUS','t_service_log.sample_id','t_service_log.rec_flag')\n ->leftjoin('enrolls as e','e.id','=','t_service_log.enroll_id')\n ->leftjoin('sample as m','m.id','=','t_service_log.sample_id')\n ->leftjoin('t_microscopy as s','s.sample_id','=','t_service_log.sample_id')\n ->whereIn('t_service_log.service_id',[1,2])\n ->whereIn('t_service_log.status',[1]) //->whereIn('t_service_log.status',[0,1,2]) changed\n\t\t->distinct()\n ->orderBy('enroll_id','desc')\n ->get(); \n \n //dd($data);\n\t\t\n\t\t//dd(Config::get('m_services_array.tests'));\t\t\t\n\t\t\t foreach($data['sample'] as $sampledata){\n\t\t\t\t//echo $sampledata->enroll_id; die;\n\t\t\t\t\n\t\t\t\t$services=RequestServices::select('service_id','enroll_id')->where('enroll_id',$sampledata->enroll_id)->get();\n\t\t\t\t//dd($services);\n\t\t\t\t$data['test_requested['.$sampledata->enroll_id.']']='';\n\t\t\t\t$data['services_col_color['.$sampledata->enroll_id.']']='N';\n\t\t\t\tif(!$services->isEmpty()){ //echo \"hi\"; die;\t\t\t\t\t\n\t\t\t\t\t//$result[]='';\n\t\t\t\t\t\n\t\t\t\t\tunset($result);//reinitialize array\n\t\t\t\t\tforeach($services as $serv){\n\t\t\t\t\t\t$result[] = Config::get('m_services_array.tests')[$serv->service_id] ?? null;\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t//dd($result);\n\t\t\t\t\t//dd(count($result));\n\t\t\t\t\t// comma in the array \n $data['test_requested['.$sampledata->enroll_id.']'] = implode(', ', $result); \n\t\t\t\t\t//dd($data);\n\t\t\t\t\t//For display green colour for more than 1 services\n\t\t\t\t\tif(count($result)>1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$data['services_col_color['.$sampledata->enroll_id.']']='Y';\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t }\n\n $data['summaryTotal'] = ServiceLog::whereIn('status',[0,1,2])\n ->whereIn('service_id',[1,2])\n ->count();\n $data['summaryDone'] = ServiceLog::where('status',1)\n ->whereIn('service_id',[1,2])\n ->count();\n $data['summarySent'] = ServiceLog::where('status',2)\n ->whereIn('service_id',[1,2])\n ->count();\n\n $data['services'] = Service::select('id','name')->where('record_status',1)->get();\n\t\treturn view('admin.microscopy.list',compact('data'));\n\n }catch(\\Exception $e){\n $error = $e->getMessage();\n return view('admin.layout.error',$error); // insert query\n }\n }", "public function spis_assign($spisdata, $spis_id) {\n\t\t$watches_queried = false;\n\t\t$watches = array();\n\t\t\n\t\tif (($spisdata['rc'] != 0) || ($spisdata['ic'] != 0)) {\n\t\t\tif (($spisdata['rc'] == 0) || ($spisdata['ic'] == 0)) {\n\t\t\t\t// if any is 0 use and logic\n\t\t\t\tif ($spisdata['ic'] != 0) {\n\t\t\t\t\t$this->isirdb->where('ic', $spisdata['ic']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($spisdata['rc'] != 0) {\n\t\t\t\t\t$this->isirdb->where('rc', $spisdata['rc']);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// if both are filled use or logic\n\t\t\t\t$this->isirdb->or_where('ic', $spisdata['ic']);\n\t\t\t\t$this->isirdb->or_where('rc', $spisdata['rc']);\n\t\t\t}\n\n\t\t\t$watches = $this->isirdb->get('users_watches')->result_array();\n\t\t\t$watches_queried = true;\n\t\t}\n\t\t\n\t\t// query by birthdate too\n\t\tif (($spisdata['birthdate'] != '0000-00-00') && ($spisdata['birthdate'] != '') && ($spisdata['surname'] != '')) {\n\t\t\t$this->isirdb->where('birthdate', $spisdata['birthdate']);\n\t\t\t$this->isirdb->where('birthdate <> ', '0000-00-00');\n\t\t\t$this->isirdb->where('name', $spisdata['surname']);\n\t\t\t\n\t\t\t// TODO: solve cases when twins are submitted by follwing proposal:\n\t\t\t/*\n\t\t\tif ($spisdata['firstname'] != '') {\n\t\t\t\t$this->isirdb->where('firstname', $spisdata['firstname']); OR where firstname is empty\n\t\t\t}\n\t\t\t*/\n\t\t\t\n\t\t\t$watches_birthdate = $this->isirdb->get('users_watches')->result_array();\n\n\t\t\tif ($watches_queried == true) {\n\t\t\t\t// merge with previous watches\n\t\t\t\tforeach($watches_birthdate as $watch_birthdate) {\n\t\t\t\t\t$is_in_watches = false;\n\t\t\t\t\tforeach($watches as $watch) {\n\t\t\t\t\t\tif ($watch_birthdate['id'] == $watch['id']) {\n\t\t\t\t\t\t\t$is_in_watches = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ($is_in_watches == false) {\n\t\t\t\t\t\tarray_push($watches, $watch_birthdate);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$watches = $watches_birthdate;\n\t\t\t\t$watches_queried = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (($watches_queried == true) && (sizeof($watches) > 0)) {\n\t\t\t// associate found watches with the newly added record\n\t\t\tforeach ($watches as $i) {\n\t\t\t\t$adddata = array(\n\t\t\t\t\t\"spis_id\" => $spis_id,\n\t\t\t\t\t\"watched_id\" => $i['id']\n\t\t\t\t);\n\n\t\t\t\t// check if the watches does not exist already?\n\t\t\t\t$existsquery = $this->isirdb->get_where('spis2users_watches', $adddata);\n\t\t\t\tif ($existsquery->num_rows() == 0) {\n\t\t\t\t\t// it does not exist - create it\t\t\t\t\n\t\t\t\t\t$this->isirdb->insert('spis2users_watches', $adddata);\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t}", "public function getSaisonsList($id)\n {\n\n $allSaisons = Serie::findOrFail($id)->saisons;\n return $this->response->collection($allSaisons, new SaisonTransformer, ['key'=>'saisons']);\n }", "public function getSiswa($id)\n {\n $result = $this->db->get_where('siswa', ['id' => $id])->row_array();\n return $result;\n }", "public function get($strandid = NULL) {\n if ($strandid) {\n\n $results = db_query(\"SELECT u.id, u.strand_id as strandid, u.name, u.description, u.last_update, \n s.name as strandname, s.description as stranddescription, \n s.mission_id as missionid, m.name as missionname,\n m.country_id as countryid, c.name as countryname \n FROM kaunit u, kastrand s, kacountry c, kamission m where \n s.mission_id = m.id and m.country_id = c.id and\n u.strand_id = s.id and u.strand_id = :strandid\", array(':strandid' => $strandid))->fetchAllAssoc('id');\n\n $i = 0;\n // create strandunits array\n $strandunits = array();\n\n foreach($results as $row)\n {\n // if defined retrieve reference to existing strandunit information else create and initialise a new one for this row of data\n if (isset($strandunits['strandunits']))\n { \n $strandunititem = $strandunits['strandunits'];\n }\n else\n {\n $strandunititem = array\n (\n 'countryid' => $row -> countryid,\n 'countryname' => $row -> countryname,\n 'missionid' => $row -> missionid,\n 'missionname' => $row -> missionname, \n 'strandid' => $row -> strandid,\n 'strandname' => $row -> strandname,\n 'stranddescription' => $row -> stranddescription,\n 'units' => array() // create unit array for strand\n );\n $strandunits['strandunits'] = $strandunititem;\n }\n \n $unitid = $row -> id;\n \n // if defined retrieve reference to existing unit information else create and initialise a new one for this row of data\n $newunititem = false;\n $unititem = null;\n $unitkey = null;\n \n foreach ($strandunititem['units']['id'] as $key => $value) \n {\n if($strandunititem['units'][$key] === $unitid)\n {\n $unititem = $strandunititem['units'][$key];\n $unitkey = $key;\n break;\n }\n }\n \n if(isset($unititem) == false)\n {\n $unititem = array\n (\n 'id' => $unitid,\n 'name' => $row -> name,\n 'description' => $row -> description,\n 'last_update' => $row -> last_update\n );\n $newunititem = true; \n }\n \n // if previously flagged that we created a new unit item add to the units array for the strand, otherwise update the exising unit item for the strand\n if($newunititem)\n {\n $strandunititem['units'][] = $unititem;\n }\n else {\n $strandunititem['units'][$unitkey] = $unititem;\n }\n // update the root array with the updated arrays\n $strandunits['strandunits'] = $strandunititem;\n $i = $i + 1;\n }\n \n if ($i > 0) {\n // need to turn off the cache on the results array so set the max-age to 0 by adding $results entity to the cache dependencies.\n // This will clear our cache when this entity updates.\n $renderer = \\Drupal::service('renderer');\n $renderer->addCacheableDependency($results, null);\n\n return new \\Symfony\\Component\\HttpFoundation\\JsonResponse($strandunits);\n }\n \n throw new NotFoundHttpException(t('No Units found for strandid: ' . $strandid));\n }\n throw new NotFoundHttpException(t('strand not provided'));\n }", "public function getStokSite($id){\n try{\n $m_item_id = $_GET['m_item_id'];\n } catch(Exception $e) {\n $m_item_id = null;\n }\n\n if($m_item_id == null) {\n $datas = DB::select(\"\n select \n (COALESCE(inv_in.site_id, inv_out.site_id)) as site_id, \n (COALESCE(inv_in.m_item_id, inv_out.m_item_id)) as m_item_id,\n (COALESCE(inv_in.m_warehouse_id, inv_out.m_warehouse_id)) as m_warehouse_id, \n (COALESCE(inv_in.amount, 0)) as amount_in,\n (COALESCE(inv_out.amount, 0)) as amount_out,\n (COALESCE(inv_out.amount_ret, 0)) as amount_ret,\n ((COALESCE(inv_in.amount, 0)) - ((COALESCE(inv_out.amount, 0)) - (COALESCE(inv_out.amount_ret, 0)))) as stok,\n inv_in.updated_at as last_update_in,\n inv_out.updated_at as last_update_out\n from (select site_id, m_item_id, sum(amount) as amount, itd.m_warehouse_id as m_warehouse_id, max(it.updated_at) as updated_at from inv_trxes it\n join inv_trx_ds itd on it.id = itd.inv_trx_id\n where is_entry = true and site_id = \".$id.\" and trx_type != 'RET_ITEM'\n group by site_id, m_item_id, itd.m_warehouse_id) inv_in\n full outer join (select site_id, m_item_id, itd.m_warehouse_id, coalesce((SELECT sum(amount) as amount from inv_trxes it1\n join inv_trx_ds itd1 on it1.id = itd1.inv_trx_id\n where trx_type = 'RET_ITEM' and it1.site_id=it.site_id and itd1.m_item_id=itd.m_item_id and itd1.m_warehouse_id=itd.m_warehouse_id), 0) AS amount_ret, sum(amount) as amount, max(it.updated_at) as updated_at from inv_trxes it\n join inv_trx_ds itd on it.id = itd.inv_trx_id\n where is_entry = false and site_id = \".$id.\" \n group by site_id, m_item_id, itd.m_warehouse_id) inv_out on inv_in.m_item_id = inv_out.m_item_id and inv_in.site_id = inv_out.site_id and inv_in.m_warehouse_id = inv_out.m_warehouse_id\n \");\n } else {\n $datas = DB::select(\"\n select \n (COALESCE(inv_in.site_id, inv_out.site_id)) as site_id, \n (COALESCE(inv_in.m_item_id, inv_out.m_item_id)) as m_item_id,\n (COALESCE(inv_in.m_warehouse_id, inv_out.m_warehouse_id)) as m_warehouse_id, \n (COALESCE(inv_in.amount, 0)) as amount_in,\n (COALESCE(inv_out.amount, 0)) as amount_out,\n (COALESCE(inv_out.amount_ret, 0)) as amount_ret,\n ((COALESCE(inv_in.amount, 0)) - ((COALESCE(inv_out.amount, 0)) - (COALESCE(inv_out.amount_ret, 0)))) as stok,\n inv_in.updated_at as last_update_in,\n inv_out.updated_at as last_update_out\n from (select site_id, m_item_id, sum(amount) as amount, itd.m_warehouse_id as m_warehouse_id, max(it.updated_at) as updated_at from inv_trxes it\n join inv_trx_ds itd on it.id = itd.inv_trx_id\n where is_entry = true and site_id = \".$id.\" and m_item_id = \".$m_item_id.\" and trx_type != 'RET_ITEM'\n group by site_id, m_item_id, itd.m_warehouse_id) inv_in\n full outer join (select site_id, m_item_id, itd.m_warehouse_id as m_warehouse_id, coalesce((SELECT sum(amount) as amount from inv_trxes it1\n join inv_trx_ds itd1 on it1.id = itd1.inv_trx_id\n where trx_type = 'RET_ITEM' and it1.site_id=it.site_id and itd1.m_item_id=itd.m_item_id and itd1.m_warehouse_id=itd.m_warehouse_id), 0) AS amount_ret, sum(amount) as amount, max(it.updated_at) as updated_at from inv_trxes it\n join inv_trx_ds itd on it.id = itd.inv_trx_id\n where is_entry = false and site_id = \".$id.\" and m_item_id = \".$m_item_id.\"\n group by site_id, m_item_id, itd.m_warehouse_id) inv_out on inv_in.m_item_id = inv_out.m_item_id and inv_in.site_id = inv_out.site_id\n \");\n }\n\n foreach($datas as $data) {\n $data->sites = Site::find($data->site_id);\n $data->m_items = DB::select('select * from m_items where id = ' . $data->m_item_id)[0];\n $data->m_units = MUnit::find($data->m_items->m_unit_id);\n $data->m_warehouse = DB::table('m_warehouses')->where('id', $data->m_warehouse_id)->first();\n // harga average tiap item\n $get_save_price=DB::table('m_item_prices')->where(['m_item_id' => $data->m_item_id, 'site_id' => $data->site_id])->first();\n \n // harga satuan (dari tanggal terakhir)\n // $last_price = DB::select(\"select pd.base_price from inv_trxes it\n // join purchases p on it.purchase_id = p.id\n // join purchase_ds pd on p.id = pd.purchase_id\n // where it.is_entry = true and it.site_id = ? and pd.m_item_id = ?\n // order by it.created_at desc limit 1\", [$data->site_id, $data->m_item_id]);\n $data->last_price = $get_save_price != null ? $get_save_price->price : 0;\n\n // nilai material\n $value = 0;\n $data_values = DB::select(\"select pd.amount, pd.base_price from inv_trxes it\n join purchases p on it.purchase_id = p.id\n join purchase_ds pd on p.id = pd.purchase_id\n where it.is_entry = true and it.site_id = ? and pd.m_item_id = ?\", [$data->site_id, $data->m_item_id]);\n foreach($data_values as $data_value) {\n $amount = $data_value->amount != null ? $data_value->amount : 0;\n $price = $data_value->base_price != null ? $data_value->base_price : 0;\n $value += $amount * $price; \n }\n $data->value = $value;\n }\n\n return response()->json(['data' => $datas]);\n }", "private function getInitialData($userid) {\r\n\t\t// get trials for this researcher\r\n\t\t$returnArray = array();\r\n\t\t$researcher = $trials = $trialList = array();\r\n\t\t$result = getData(\"t,r|t->rt(trialid)->r(researcherid)|researcherid={$userid}\");\r\n\t\t// \"t,r|t->rt(trialid)->r(researcherid)|researcherid={$userid}\"\r\n\t\t$sql = \"SELECT t.*, r.*\r\n\t\t\tFROM trial t\r\n\t\t\tINNER JOIN researcher_trial_bridge rt ON rt.trialid = t.trialid\r\n\t\t\tINNER JOIN researcher r ON r.researcherid = rt.researcherid\r\n\t\t\tWHERE t.active = 1 AND r.active = 1 AND r.researcherid = {$userid}\";\r\n\t\t$result = $db->query($sql);\r\n\t\tif($result && count($result)) {\r\n\t\t\tforeach($result as $row) {\r\n\t\t\t\t$trialid = $row['trialid'];\r\n\t\t\t\tif(!in_array($trialid, $trialList)) $trialList[] = $row['trialid'];\r\n\t\t\t\tif(!array_key_exists($trialid, $trials)) {\r\n\t\t\t\t\t$trials[$trialid] = array(\r\n\t\t\t\t\t\t\"trial_name\" => $row['trial_name'],\r\n\t\t\t\t\t\t\"purpose\" => $row['purpose'],\r\n\t\t\t\t\t\t\"creation_date\" => $row['creation_date']\r\n\t\t\t\t\t);\r\n\t\t\t\t}\r\n\t\t\t\tif(!count(array_keys($researcher))) {\r\n\t\t\t\t\t$researcher = array(\r\n\t\t\t\t\t\t\"prefix\" => $row['prefix'],\r\n\t\t\t\t\t\t\"first_name\" => $row['first_name'],\r\n\t\t\t\t\t\t\"last_name\" => $row['last_name'],\r\n\t\t\t\t\t\t\"suffix\" => $row['suffix'],\r\n\t\t\t\t\t\t\"affiliation\" => $row['affiliation']\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\tif(count($trialList) == 1) {\r\n\t\t\t// given the selected trial, acquire the next batch of data\r\n\r\n\t\t} else if(count($trialList) > 1) {\r\n\t\t\t// this is all the data that's needed for now; after researcher selects a trial, the next batch will be acquired\r\n\t\t\t$returnArray = array(\"researcher\" => $researcher, \"trials\" => $trials, \"trialList\" => $trialList);\r\n\t\t}\r\n\t}", "public function search_sprint_task() \n {\n $id = $this->input->post('sprint_id');\n if ($id != \"\") \n {\n $result = $this->Sprint_model->show_task_by_sid($id);\n if ($result != false)\n {\n $data['result_display'] = $result;\n } \n else\n {\n $data['result_display'] = \"No record found !\";\n }\n } \n else\n {\n $data = array(\n 'id_error_message' => \"Id field is required\"\n );\n }\n $data['show_table'] = $this->view_table_task();\n $this->load->view('searchTask', $data);\n }", "public function get_sermons() \n\t{\n\t\t$query = $this->sermons_model->get_sermons();\n\t\t\n\t\t$v_data['query'] = $query;\n\t\t$data['total'] = $query->num_rows();\n\n\t\t$response['message'] = 'success';\n\t\t$response['result'] = $this->load->view('sermons', $v_data, true);\n\n\t\t\n\t\techo json_encode($response);\n\t}", "function getTrainsLatest($station) {\n\n\t\t$retval = array();\n\t\t$redis_key = \"station/getTrainsLatest-${station}\";\n\n\t\tif ($retval = $this->redisGet($redis_key)) {\n\t\t\treturn($retval);\n\n\t\t} else {\n\t\t\t$query = 'search index=\"septa_analytics\" '\n\t\t\t\t\t. 'earliest=-24h late != 999 '\n\t\t\t\t\t. 'nextstop=\"' . $station . '\" '\n\t\t\t\t\t. '| eval time=strftime(_time,\"%Y-%m-%dT%H:%M:%S\") '\n\t\t\t\t\t. '| eval id = trainno . \"-\" . dest '\n\t\t\t\t\t. '| stats max(late) AS \"Minutes Late\", max(time) AS \"time\", max(train_line) AS \"Train Line\" by id '\n\t\t\t\t\t. '| sort \"Minutes Late\" desc '\n\t\t\t\t\t. '| head '\n\t\t\t\t\t. '| chart max(\"Minutes Late\") AS \"Minutes Late\" by id '\n\t\t\t\t\t. '| sort \"Minutes Late\" desc';\n\n\t\t\t$retval = $this->query($query);\n\t\t\t$retval[\"metadata\"][\"_comment\"] = \"Latest trains that have arrived at the station named '$station'\";\n\n\t\t\t$this->redisSet($redis_key, $retval);\n\t\t\treturn($retval);\n\n\t\t}\n\n\t}", "protected function getDatav2(): array\n {\n //prepare labels\n $labels = array('labels' => array(\n 'SESSION ID', 'SEARCH APPLICATION', 'TIMESTAMP', 'SEARCH TERMS', 'SPECIFIC FIELD TYPE', 'NUMBER OF RESULTS',\n 'AGGREGATIONS',\n 'START DATE',\n 'END DATE',\n '1ST SCORE',\n )\n );\n\n //prepare body's data\n $dataArray = array();\n $entityManager = $this->getDoctrine()->getManager();\n //Query\n $queryString = 'SELECT log.creationTimeStamp, log.payLoad from ' .\n LogActionItem::class . ' log where log.actionName = :actionName order by log.creationTimeStamp DESC';\n $query = $entityManager->createQuery($queryString);\n $query->setParameters(['actionName' => 'New Search']);\n $results = $query->getResult();\n\n $griidcArray = $this->getGriidcStaff();\n\n //process result query into an array with organized data\n foreach ($results as $result) {\n //skip the row if the search is done by a Griidc Staff\n if (\n isset($result['payLoad']['clientInfo']['userId']) &&\n in_array($result['payLoad']['clientInfo']['userId'], $griidcArray)\n ) {\n continue;\n }\n\n // Skip the row if the search is parameterless, as is the case for default search\n // page initial loads.\n if (\n empty($result['payLoad']['searchQueryParams']['inputFormTerms']['searchTerms']) &&\n empty($result['payLoad']['searchQueryParams']['inputFormTerms']['specificFieldType']) &&\n empty($result['payLoad']['searchQueryParams']['inputFormTerms']['aggregations']) &&\n empty($result['payLoad']['searchQueryParams']['inputFormTerms']['dataCollectionStartDate']) &&\n empty($result['payLoad']['searchQueryParams']['inputFormTerms']['dataCollectionEndDate'])\n ) {\n continue;\n }\n\n $searchResults = array\n (\n '1stScore' => '',\n );\n\n $numResults = $result['payLoad']['numResults'];\n if ($numResults > 0) {\n $searchResults['1stScore'] = $result['payLoad']['elasticScoreFirstResult'] ?? '';\n }\n\n if (empty($result['payLoad']['subSite'])) {\n $result['payLoad']['subSite'] = 'GRIIDC';\n }\n\n $dataArray[] = array_merge(\n array\n (\n 'sessionID' => $result['payLoad']['clientInfo']['sessionId'],\n 'subSite' => $result['payLoad']['subSite'],\n 'timeStamp' => $result['creationTimeStamp']->format(parent::INREPORT_TIMESTAMPFORMAT),\n 'searchTerms' => $result['payLoad']['searchQueryParams']['inputFormTerms']['searchTerms'],\n 'specificFieldType' => $result['payLoad']['searchQueryParams']['inputFormTerms']['specificFieldType'],\n 'numResults' => $numResults,\n 'aggregations' => $this->getAggregations($result['payLoad']['searchQueryParams']['aggregations']),\n 'startDate' => $result['payLoad']['searchQueryParams']['inputFormTerms']['dataCollectionStartDate'],\n 'endDate' => $result['payLoad']['searchQueryParams']['inputFormTerms']['dataCollectionEndDate']\n ),\n $searchResults,\n );\n }\n return array_merge($labels, $dataArray);\n }", "function get_rad_surveys($conn, $sup_restriction = NULL, $start_restriction = NULL, $end_restriction = NULL) {\n\t$query_rad = \"SELECT * FROM rad_survey_comment, rad_header WHERE \" .\n\t\t \"rad_survey_comment.header_id = rad_header.header_id \" . \n\t\t ($sup_restriction !== NULL ? (' AND ' . get_sup_filter($sup_restriction, \"rad_header\")) : \"\") . \n\t\t ($start_restriction !== NULL ? (' AND (rad_header.date_start >= \"' . $start_restriction . \n\t\t '\" OR rad_header.date_end >= \"' . $start_restriction . '\") ') : \"\") . \n\t\t ($end_restriction !== NULL ? (' AND (rad_header.date_start <= \"' . $end_restriction . \n\t\t '\" OR rad_header.date_end <= \"' . $end_restriction . '\") ') : \"\");\n\treturn exec_query($conn, $query_rad);\n}", "public function getVotersShehia($id){\n $Query = \"SELECT v.id, v.firstname, v.middlename, v.lastname, v.datebirth, v.gender, v.residentialaddress, \n v.voterIDnumber, v.lifestatus, p.name\n FROM voters2015 v\n JOIN pollingstations p ON v.pollingstation_id = p.id\n JOIN pollingstation_shehia ps ON v.pollingstation_id = ps.pollingstation_id\n WHERE ps.pollingstation_id = $id\n ORDER BY p.name, v.gender, v.firstname, v.middlename, v.lastname ASC\";\n $stmt = $this->con->prepare($Query);\n $stmt->bind_param(\"i\",$id);\n $stmt->execute();\n $shehiaVoters = $stmt->get_result();\n $stmt->close();\n return $shehiaVoters;\n }", "function get_siswa()\n {\n // filter rombel berdasarkan id tahun aktif dan id kelas yang mana user menjadi walikelasnya\n $filter = 'rombel.id_tahun = ' . $_SESSION['id_tahun_pelajaran'] . ' AND rombel.id_kelas = ' . user_info()['id_kelas'];\n // hitung nilai rata-rata sikapnya kemudian selalu bulatkan ke atas\n $this->db->select('siswa.id, siswa.nama_lengkap nama_siswa, siswa.nis');\n $this->db->from('rombel');\n $this->db->where($filter);\n $this->db->join('siswa', 'rombel.id_siswa = siswa.id');\n $this->db->order_by('siswa.nama_lengkap');\n $db = $this->db->get();\n return $db->result_array();\n }", "public function getStatsGeneralBSFiltersSCD($supervisors, $departament){\n if ($supervisors==0 && $departament ==0) {\n $totalBS = DB::table('results')\n ->join('objectives_results','results.id','=','objectives_results.result')\n ->join('objectives','objectives_results.objective','=','objectives.id')\n ->join('plan_objectives', 'objectives.id', '=','plan_objectives.objective')\n ->join('plan','plan_objectives.plan','=','plan.id' )\n ->join('teams', 'plan.team','=','teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality', 'teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament', 'municipality.id_departament','=','departament.id_departament')\n ->select(DB::raw('SUM(objectives_results.amount) as amount'))\n ->where('amount','<>','0')\n ->orderBy('amount','desc')\n ->get();\n $bsGeneral = DB::table('results')\n ->join('objectives_results','results.id','=','objectives_results.result')\n ->join('objectives','objectives_results.objective','=','objectives.id')\n ->join('plan_objectives', 'objectives.id', '=','plan_objectives.objective')\n ->join('plan','plan_objectives.plan','=','plan.id' )\n ->join('teams', 'plan.team','=','teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality', 'teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament', 'municipality.id_departament','=','departament.id_departament')\n ->select('results.description as rls', DB::raw('SUM(objectives_results.amount) as amount'))\n ->where('amount','<>','0')\n ->groupBy('rls')\n ->orderBy('amount','desc')\n ->get();\n if (sizeof($bsGeneral) == 0) {\n # code...\n $result = '<h2> No Existen datos</h2>';\n } else {\n # code...\n if(count($bsGeneral)==1) { \n \n $resulthtml= '<tr class=\"numbers\">\n <td class=\"color-blue\">'.number_format($totalBS[0]->amount).'</td>\n <td class=\"color-indico\">'.number_format($bsGeneral[0]->amount).' ('.number_format($bsGeneral[0]->amount * 100 / $totalBS[0]->amount).'%)</td>';\n\n $resultTitle='<th>Total de bienes y servicios</th>\n <th>'.$bsGeneral[0]->rls.'</th>';\n }else if (count($bsGeneral)==2) {\n # code...\n $resulthtml= '<tr class=\"numbers\">\n <td class=\"color-blue\">'.number_format($totalBS[0]->amount).'</td>\n <td class=\"color-indico\">'.number_format($bsGeneral[0]->amount).' ('.number_format($bsGeneral[0]->amount * 100 / $totalBS[0]->amount).'%)</td>\n <td class=\"color-blue\">'.number_format($bsGeneral[1]->amount).' ('.number_format($bsGeneral[1]->amount * 100 / $totalBS[0]->amount).'%)</td>';\n\n $resultTitle='<th>Total de bienes y servicios</th>\n <th>'.$bsGeneral[0]->rls.'</th>\n <th>'.$bsGeneral[1]->rls.'</th>';\n } else {\n # code...\n $resulthtml= '<tr class=\"numbers\">\n <td class=\"color-blue\">'.number_format($totalBS[0]->amount).'</td>\n <td class=\"color-indico\">'.number_format($bsGeneral[0]->amount).' ('.number_format($bsGeneral[0]->amount * 100 / $totalBS[0]->amount).'%)</td>\n <td class=\"color-blue\">'.number_format($bsGeneral[1]->amount).' ('.number_format($bsGeneral[1]->amount * 100 / $totalBS[0]->amount).'%)</td>\n <td class=\"color-orange\">'.number_format($bsGeneral[2]->amount).' ('.number_format($bsGeneral[2]->amount * 100 / $totalBS[0]->amount).'%)</td>';\n\n $resultTitle='<th>Total de bienes y servicios</th>\n <th>'.$bsGeneral[0]->rls.'</th>\n <th>'.$bsGeneral[1]->rls.'</th>\n <th>'.$bsGeneral[2]->rls.'</th>';\n }\n $result = $this->str_bs(1, 'Generales de bienes y servicios').$resultTitle.$this->str_bs(2,'')\n .$resulthtml.$this->str_bs(5,\"\");\n \n foreach($bsGeneral as $sba){\n $result = $result . '\n <tr>\n <td>'. $sba->rls.'</td>\n <td style=\"text-align:right;\">'. number_format($sba->amount).'</td>\n <td style=\"text-align:right;\">'. number_format($sba->amount * 100 / $totalBS[0]->amount,2).'%</td>\n </tr>\n ';\n }\n $result = $result. '\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td> \n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($totalBS[0]->amount) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\"></td>\n </tr>\n '.$this->str_bs(4,\"\");\n }\n } else if ($supervisors!=0 && $departament ==0) {\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $totalBS =DB::table('results')\n ->join('objectives_results','results.id','=','objectives_results.result')\n ->join('objectives','objectives_results.objective','=','objectives.id')\n ->join('plan_objectives', 'objectives.id', '=','plan_objectives.objective')\n ->join('plan','plan_objectives.plan','=','plan.id' )\n ->join('teams', 'plan.team','=','teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality', 'teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament', 'municipality.id_departament','=','departament.id_departament')\n ->select(DB::raw('SUM(objectives_results.amount) as amount'))\n ->where('amount','<>','0')\n ->where('supervisors.id_supervisors',$supervisors)\n ->orderBy('amount','desc')\n ->get();\n $bsGeneral = DB::table('results')\n ->join('objectives_results','results.id','=','objectives_results.result')\n ->join('objectives','objectives_results.objective','=','objectives.id')\n ->join('plan_objectives', 'objectives.id', '=','plan_objectives.objective')\n ->join('plan','plan_objectives.plan','=','plan.id' )\n ->join('teams', 'plan.team','=','teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality', 'teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament', 'municipality.id_departament','=','departament.id_departament')\n ->select('results.description as rls', DB::raw('SUM(objectives_results.amount) as amount'))\n ->where('amount','<>','0')\n ->where('supervisors.id_supervisors',$supervisors)\n ->groupBy('rls')\n ->orderBy('amount','desc')\n ->get();\n if (sizeof($bsGeneral) == 0) {\n # code...\n $result = '<h2> No Existen datos del supervisor: '.$name_supervisor->name.'</h2>';\n } else {\n # code...\n if(count($bsGeneral)==1) { \n \n $resulthtml= '<tr class=\"numbers\">\n <td class=\"color-blue\">'.number_format($totalBS[0]->amount).'</td>\n <td class=\"color-indico\">'.number_format($bsGeneral[0]->amount).' ('.number_format($bsGeneral[0]->amount * 100 / $totalBS[0]->amount).'%)</td>';\n\n $resultTitle='<th>Total de bienes y servicios</th>\n <th>'.$bsGeneral[0]->rls.'</th>';\n }else if (count($bsGeneral)==2) {\n # code...\n $resulthtml= '<tr class=\"numbers\">\n <td class=\"color-blue\">'.number_format($totalBS[0]->amount).'</td>\n <td class=\"color-indico\">'.number_format($bsGeneral[0]->amount).' ('.number_format($bsGeneral[0]->amount * 100 / $totalBS[0]->amount).'%)</td>\n <td class=\"color-blue\">'.number_format($bsGeneral[1]->amount).' ('.number_format($bsGeneral[1]->amount * 100 / $totalBS[0]->amount).'%)</td>';\n\n $resultTitle='<th>Total de bienes y servicios</th>\n <th>'.$bsGeneral[0]->rls.'</th>\n <th>'.$bsGeneral[1]->rls.'</th>';\n } else {\n # code...\n $resulthtml= '<tr class=\"numbers\">\n <td class=\"color-blue\">'.number_format($totalBS[0]->amount).'</td>\n <td class=\"color-indico\">'.number_format($bsGeneral[0]->amount).' ('.number_format($bsGeneral[0]->amount * 100 / $totalBS[0]->amount).'%)</td>\n <td class=\"color-blue\">'.number_format($bsGeneral[1]->amount).' ('.number_format($bsGeneral[1]->amount * 100 / $totalBS[0]->amount).'%)</td>\n <td class=\"color-orange\">'.number_format($bsGeneral[2]->amount).' ('.number_format($bsGeneral[2]->amount * 100 / $totalBS[0]->amount).'%)</td>';\n\n $resultTitle='<th>Total de bienes y servicios</th>\n <th>'.$bsGeneral[0]->rls.'</th>\n <th>'.$bsGeneral[1]->rls.'</th>\n <th>'.$bsGeneral[2]->rls.'</th>';\n }\n $result = $this->str_bs(1, 'Generales de bienes y servicios, supervisor: '.$name_supervisor->name).$resultTitle.$this->str_bs(2,'')\n .$resulthtml.$this->str_bs(5,\"\");\n \n foreach($bsGeneral as $sba){\n $result = $result . '\n <tr>\n <td>'. $sba->rls.'</td>\n <td style=\"text-align:right;\">'. number_format($sba->amount).'</td>\n <td style=\"text-align:right;\">'. number_format($sba->amount * 100 / $totalBS[0]->amount,2).'%</td>\n </tr>\n ';\n }\n $result = $result. '\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td> \n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($totalBS[0]->amount) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\"></td>\n </tr>\n '.$this->str_bs(4,\"\");\n }\n } else if ($supervisors==0 && $departament !=0) {\n $name_departament = $this->getNameDepartament($departament);\n $totalBS = DB::table('results')\n ->join('objectives_results','results.id','=','objectives_results.result')\n ->join('objectives','objectives_results.objective','=','objectives.id')\n ->join('plan_objectives', 'objectives.id', '=','plan_objectives.objective')\n ->join('plan','plan_objectives.plan','=','plan.id' )\n ->join('teams', 'plan.team','=','teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality', 'teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament', 'municipality.id_departament','=','departament.id_departament')\n ->select(DB::raw('SUM(objectives_results.amount) as amount'))\n ->where('amount','<>','0')\n ->where('departament.id_departament', $departament)\n ->orderBy('amount','desc')\n ->get();\n $bsGeneral = DB::table('results')\n ->join('objectives_results','results.id','=','objectives_results.result')\n ->join('objectives','objectives_results.objective','=','objectives.id')\n ->join('plan_objectives', 'objectives.id', '=','plan_objectives.objective')\n ->join('plan','plan_objectives.plan','=','plan.id' )\n ->join('teams', 'plan.team','=','teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality', 'teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament', 'municipality.id_departament','=','departament.id_departament')\n ->select('results.description as rls', DB::raw('SUM(objectives_results.amount) as amount'))\n ->where('amount','<>','0')\n ->where('departament.id_departament', $departament)\n ->groupBy('rls')\n ->orderBy('amount','desc')\n ->get();\n if (sizeof($bsGeneral) == 0) {\n # code...\n $result = '<h2> No Existen datos del departamento: '.$name_departament->departament.'</h2>';\n } else {\n # code...\n if(count($bsGeneral)==1) { \n \n $resulthtml= '<tr class=\"numbers\">\n <td class=\"color-blue\">'.number_format($totalBS[0]->amount).'</td>\n <td class=\"color-indico\">'.number_format($bsGeneral[0]->amount).' ('.number_format($bsGeneral[0]->amount * 100 / $totalBS[0]->amount).'%)</td>';\n\n $resultTitle='<th>Total de bienes y servicios</th>\n <th>'.$bsGeneral[0]->rls.'</th>';\n }else if (count($bsGeneral)==2) {\n # code...\n $resulthtml= '<tr class=\"numbers\">\n <td class=\"color-blue\">'.number_format($totalBS[0]->amount).'</td>\n <td class=\"color-indico\">'.number_format($bsGeneral[0]->amount).' ('.number_format($bsGeneral[0]->amount * 100 / $totalBS[0]->amount).'%)</td>\n <td class=\"color-blue\">'.number_format($bsGeneral[1]->amount).' ('.number_format($bsGeneral[1]->amount * 100 / $totalBS[0]->amount).'%)</td>';\n\n $resultTitle='<th>Total de bienes y servicios</th>\n <th>'.$bsGeneral[0]->rls.'</th>\n <th>'.$bsGeneral[1]->rls.'</th>';\n } else {\n # code...\n $resulthtml= '<tr class=\"numbers\">\n <td class=\"color-blue\">'.number_format($totalBS[0]->amount).'</td>\n <td class=\"color-indico\">'.number_format($bsGeneral[0]->amount).' ('.number_format($bsGeneral[0]->amount * 100 / $totalBS[0]->amount).'%)</td>\n <td class=\"color-blue\">'.number_format($bsGeneral[1]->amount).' ('.number_format($bsGeneral[1]->amount * 100 / $totalBS[0]->amount).'%)</td>\n <td class=\"color-orange\">'.number_format($bsGeneral[2]->amount).' ('.number_format($bsGeneral[2]->amount * 100 / $totalBS[0]->amount).'%)</td>';\n\n $resultTitle='<th>Total de bienes y servicios</th>\n <th>'.$bsGeneral[0]->rls.'</th>\n <th>'.$bsGeneral[1]->rls.'</th>\n <th>'.$bsGeneral[2]->rls.'</th>';\n }\n $result = $this->str_bs(1, 'Generales de bienes y servicios, departamento: '.$name_departament->departament).$resultTitle.$this->str_bs(2,'')\n .$resulthtml.$this->str_bs(5,\"\");\n \n foreach($bsGeneral as $sba){\n $result = $result . '\n <tr>\n <td>'. $sba->rls.'</td>\n <td style=\"text-align:right;\">'. number_format($sba->amount).'</td>\n <td style=\"text-align:right;\">'. number_format($sba->amount * 100 / $totalBS[0]->amount,2).'%</td>\n </tr>\n ';\n }\n $result = $result. '\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td> \n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($totalBS[0]->amount) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\"></td>\n </tr>\n '.$this->str_bs(4,\"\");\n }\n } else if ($supervisors!=0 && $departament !=0) {\n $name_departament = $this->getNameDepartament($departament);\n $name_supervisor = $this->getNameSupervisor($supervisors);\n $totalBS = DB::table('results')\n ->join('objectives_results','results.id','=','objectives_results.result')\n ->join('objectives','objectives_results.objective','=','objectives.id')\n ->join('plan_objectives', 'objectives.id', '=','plan_objectives.objective')\n ->join('plan','plan_objectives.plan','=','plan.id' )\n ->join('teams', 'plan.team','=','teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality', 'teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament', 'municipality.id_departament','=','departament.id_departament')\n ->select(DB::raw('SUM(objectives_results.amount) as amount'))\n ->where('amount','<>','0')\n ->where('departament.id_departament', $departament)\n ->where('supervisors.id_supervisors',$supervisors)\n ->orderBy('amount','desc')\n ->get();\n $bsGeneral = DB::table('results')\n ->join('objectives_results','results.id','=','objectives_results.result')\n ->join('objectives','objectives_results.objective','=','objectives.id')\n ->join('plan_objectives', 'objectives.id', '=','plan_objectives.objective')\n ->join('plan','plan_objectives.plan','=','plan.id' )\n ->join('teams', 'plan.team','=','teams.id_team')\n ->join('supervisors','teams.supervisor', '=', 'supervisors.id_supervisors')\n ->join('municipality', 'teams.municipality', '=', 'municipality.id_municipality')\n ->join('departament', 'municipality.id_departament','=','departament.id_departament')\n ->select('results.description as rls', DB::raw('SUM(objectives_results.amount) as amount'))\n ->where('amount','<>','0')\n ->where('departament.id_departament', $departament)\n ->where('supervisors.id_supervisors',$supervisors)\n ->groupBy('rls')\n ->orderBy('amount','desc')\n ->get();\n \n if (sizeof($bsGeneral) == 0 || $totalBS[0]->amount ==0 ) {\n # code...\n $result = '<h2> No Existen datos</h2>';\n } else {\n # code...\n if(count($bsGeneral)==1) { \n \n $resulthtml= '<tr class=\"numbers\">\n <td class=\"color-blue\">'.number_format($totalBS[0]->amount).'</td>\n <td class=\"color-indico\">'.number_format($bsGeneral[0]->amount).' ('.number_format($bsGeneral[0]->amount * 100 / $totalBS[0]->amount).'%)</td>';\n\n $resultTitle='<th>Total de bienes y servicios</th>\n <th>'.$bsGeneral[0]->rls.'</th>';\n }else if (count($bsGeneral)==2) {\n # code...\n $resulthtml= '<tr class=\"numbers\">\n <td class=\"color-blue\">'.number_format($totalBS[0]->amount).'</td>\n <td class=\"color-indico\">'.number_format($bsGeneral[0]->amount).' ('.number_format($bsGeneral[0]->amount * 100 / $totalBS[0]->amount).'%)</td>\n <td class=\"color-blue\">'.number_format($bsGeneral[1]->amount).' ('.number_format($bsGeneral[1]->amount * 100 / $totalBS[0]->amount).'%)</td>';\n\n $resultTitle='<th>Total de bienes y servicios</th>\n <th>'.$bsGeneral[0]->rls.'</th>\n <th>'.$bsGeneral[1]->rls.'</th>';\n } else {\n # code...\n $resulthtml= '<tr class=\"numbers\">\n <td class=\"color-blue\">'.number_format($totalBS[0]->amount).'</td>\n <td class=\"color-indico\">'.number_format($bsGeneral[0]->amount).' ('.number_format($bsGeneral[0]->amount * 100 / $totalBS[0]->amount).'%)</td>\n <td class=\"color-blue\">'.number_format($bsGeneral[1]->amount).' ('.number_format($bsGeneral[1]->amount * 100 / $totalBS[0]->amount).'%)</td>\n <td class=\"color-orange\">'.number_format($bsGeneral[2]->amount).' ('.number_format($bsGeneral[2]->amount * 100 / $totalBS[0]->amount).'%)</td>';\n\n $resultTitle='<th>Total de bienes y servicios</th>\n <th>'.$bsGeneral[0]->rls.'</th>\n <th>'.$bsGeneral[1]->rls.'</th>\n <th>'.$bsGeneral[2]->rls.'</th>';\n }\n $result = $this->str_bs(1, 'Generales de bienes y servicios, supervisor: '.$name_supervisor->name.', departamento: '.$name_departament->departament).$resultTitle.$this->str_bs(2,'')\n .$resulthtml.$this->str_bs(5,\"\");\n \n foreach($bsGeneral as $sba){\n $result = $result . '\n <tr>\n <td>'. $sba->rls.'</td>\n <td style=\"text-align:right;\">'. number_format($sba->amount).'</td>\n <td style=\"text-align:right;\">'. number_format($sba->amount * 100 / $totalBS[0]->amount,2).'%</td>\n </tr>\n ';\n }\n $result = $result. '\n <tr>\n <td class=\"color-blue\" style=\"font-size:16px;\">Total</td> \n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\">'. number_format($totalBS[0]->amount) .'</td>\n <td class=\"color-blue\" style=\"text-align:right; font-weight:bold; font-size:16px;\"></td>\n </tr>\n '.$this->str_bs(4,\"\");\n }\n }\n return $result;\n }", "public function getServices()\n\t{\n\t\t$service=\\DB::table('ser_assoc_rate')->join('ser_services','ser_assoc_rate.SerServ_ID','=','ser_services.SerServ_ID')\n\t\t->join('serv_segments', 'ser_services.SerSeg_ID','=','serv_segments.SerSeg_ID')\n\t\t->join('associate','associate.Assoc_ID','=','ser_assoc_rate.Assoc_ID')\n\t\t->select('ser_services.SerServ_ID','ser_services.SerServ_Name','ser_services.SerSeg_ID','serv_segments.SerSeg_Name','ser_assoc_rate.Pattern','associate.Assoc_FirstName', 'associate.Assoc_MiddleName','associate.Assoc_LastName')\n\n->selectRaw(\"MIN(ser_assoc_rate.Rate) AS Rate\")->groupby('ser_assoc_rate.SerServ_ID')->groupby('ser_assoc_rate.Pattern')->orderby('ser_assoc_rate.SerServ_ID')->get();\n\t\t\n\t\t/*$service=\\DB::table('ser_services')->join('serv_segments', 'ser_services.SerSeg_ID','=','serv_segments.SerSeg_ID')\n\t\t->join('ser_assoc_rate','ser_assoc_rate.SerServ_ID','=','ser_services.SerServ_ID')\n\t\t->join('associate','associate.Assoc_ID','=','ser_assoc_rate.Assoc_ID')\n\t\t->select('ser_services.SerServ_ID','ser_services.SerServ_Name','ser_services.SerSeg_ID','serv_segments.SerSeg_Name','ser_assoc_rate.Pattern','ser_assoc_rate.Rate','associate.Assoc_FirstName', 'associate.Assoc_MiddleName','associate.Assoc_LastName')\n\t\t//->orderby('associate.Assoc_ID','DESC')\n\t\t//->groupBy('ser_assoc_rate.SerServ_ID')\n\t\t->get();*/\n\t\t$serResp=array('success'=>true, $service);\n\t\treturn $serResp;\n\t\t\n\t}", "public function getSRID ( $product_line_id )\n {\n $this->db->select( 'emp_id' );\n $this->db->from( 'tbli_db_house_emp_product_line_mapping' );\n $this->db->where( 'pl_id', $product_line_id );\n $query = $this->db->get()->result_array();\n return $query;\n }", "public function findLastSMR($equipment_unit_id) {\n\t\t$sql = \"SELECT unit_number, MAX(smr) last_smr FROM\n (SELECT '\" . $equipment_unit_id . \"' unit_number, MAX(fes.smr) smr from fluidentrysmrupdate fes\n LEFT JOIN servicelog s ON s.id = fes.servicelog_id\n LEFT JOIN equipmentunit eu ON eu.unit_number = s.unit_number\n WHERE s.unit_number = \" . $equipment_unit_id . \"\n \n UNION ALL\n \tSELECT '\" . $equipment_unit_id . \"' unit_number, MAX(ccsu.smr) smr from componentchangesmrupdate ccsu\n \t\tLEFT JOIN servicelog s ON s.id = ccsu.servicelog_id\n \t\tLEFT JOIN equipmentunit eu ON eu.unit_number = s.unit_number\n \t\tWHERE s.unit_number = \" . $equipment_unit_id . \" \n \n UNION ALL\n\t\t\t\t\tSELECT '\" . $equipment_unit_id . \"' unit_number, MAX(isu.smr) smr from inspectionsmrupdate isu\n\t\t\t\t\t\t\tLEFT JOIN inspection i ON i.uuid = isu.uuid\n\t\t\t\t\t\t\tLEFT JOIN equipmentunit eu ON eu.id = i.equipmentunit_id\n\t\t\t\t\t\t\tWHERE eu.unit_number = \" . $equipment_unit_id . \"\n UNION ALL\n SELECT '\" . $equipment_unit_id . \"' unit_number, MAX(pms.current_smr) smr from pmservice pms\n LEFT JOIN servicelog s ON s.id = pms.servicelog_id\n LEFT JOIN equipmentunit eu ON eu.unit_number = s.unit_number\n WHERE s.unit_number = \" . $equipment_unit_id . \"\n UNION ALL\n SELECT '\" . $equipment_unit_id . \"' unit_number, MAX(smr.smr) smr from smrupdate smr\n LEFT JOIN servicelog s ON s.id = smr.servicelog_id\n LEFT JOIN equipmentunit eu ON eu.unit_number = s.unit_number\n WHERE s.unit_number = \" . $equipment_unit_id . \") AS smrvalues\n GROUP BY unit_number\";\n\n\t\t$values = R::getAll($sql);\n\n\t\treturn $values[0]['last_smr'];\n\t}", "function eo_display_reoccurence($id=''){\n\techo eo_get_schedule_summary($id);\n}", "function getDetailAllCustomerNoStationNameStation($account_id,$DbConnection)\n{\n\t$query_plant = \"SELECT customer_no,station_name FROM station USE INDEX(stn_type_uaid_status) WHERE type=1 AND user_account_id='$account_id' AND status=1\";\n\t$result_query = mysql_query($query_plant,$DbConnection);\n\twhile($row=mysql_fetch_object($result_query))\n\t{\n\t\t//$final_plant_list=$row->customer_no;\n\t\t//$final_plant_name_list=$row->station_name;\n\t\t\n\t\t$data[]=array('final_plant_list'=>$row->customer_no,'final_plant_name_list'=>$row->station_name);\t\n\t}\n\treturn $data;\n}" ]
[ "0.5988583", "0.5467989", "0.53364927", "0.5242708", "0.5238135", "0.51104325", "0.51066095", "0.5084125", "0.50703055", "0.5065263", "0.504114", "0.49973273", "0.49900636", "0.49395257", "0.49280193", "0.49038133", "0.48813206", "0.4870103", "0.48688224", "0.48670733", "0.48519978", "0.48362967", "0.4824411", "0.48211703", "0.48035514", "0.47974297", "0.47968495", "0.47959745", "0.47959572", "0.47876197", "0.47742406", "0.4770666", "0.4765431", "0.4762577", "0.47583437", "0.47557488", "0.47344908", "0.47275376", "0.47245955", "0.4722599", "0.4702838", "0.46998245", "0.46895534", "0.4686655", "0.46859312", "0.46834064", "0.46762374", "0.4669163", "0.46617612", "0.46566397", "0.4644349", "0.46411034", "0.46380317", "0.46347052", "0.46288645", "0.46169302", "0.46109164", "0.45988914", "0.45949572", "0.45933884", "0.4590203", "0.45870018", "0.45844638", "0.45790413", "0.45643774", "0.45637974", "0.4560509", "0.4559315", "0.4556141", "0.45557207", "0.45539048", "0.45424598", "0.453934", "0.45374975", "0.45353016", "0.45329714", "0.45319974", "0.45312744", "0.45276275", "0.45274806", "0.4527149", "0.4527051", "0.45241517", "0.45237866", "0.45201948", "0.45082998", "0.4507934", "0.4506364", "0.45061913", "0.4503353", "0.45024738", "0.44978902", "0.44918296", "0.4487399", "0.44846925", "0.44842795", "0.44808805", "0.44756612", "0.44672996", "0.44648758" ]
0.7888373
0
/ para iniciar wordpress
function init_template() { /*aniade soporte a Image destacada en la bara superior*/ add_theme_support('post-thumbnails'); /* aniade soorte de : titulo en la barra superior*/ add_theme_support('title-tag'); /* registrar menu de navegacion en el panel admin*/ register_nav_menus( array( 'top_menu' => 'Menu Principal' ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function WordpressConnect(){\n\n\t\t$this->add_init_hook();\n\n\t}", "function start_wp()\n {\n }", "function wp_head(){\n \tpluginValidaciones();\n logueado();\n }", "public static function wpInit() {}", "function redmoon_setup(){\n load_theme_textdomain( 'redmoon', get_template_directory( ).'/languages' ); \n\n //Feed automático\n add_theme_support('automatic-feed-links'); \n\n //Thumbnails\n add_theme_support( 'post-thumbnails' ); \n\n //opciones d post's\n add_theme_support( 'post-formats', array('aside', 'gallery', 'quote', 'image', 'video') );\n\n //registramos los distintos menus\n register_nav_menus( array(\n 'main_menu' => __('Menú principal', 'redmoon'),\n 'responsive_main_menu' => __('Responsive Menú', 'redmoon'),\n 'social_header' => __('Social Cabecera', 'redmoon'),\n 'footer_social' => __('Social Pie de Página', 'redmoon')\n ) );\n\n require_once get_template_directory( ).'/inc/theme-options/setup-options-theme.php';\n setup_options_theme();\n\n }", "function GaotaiDiviTheme_setup() {\n\t// Add post format support\n\tadd_theme_support('post-formats', array('chat', 'link', 'aside', 'image', 'video', 'gallery'));\n\t// Divi child theme 中文化\n\tload_child_theme_textdomain('Divi', get_stylesheet_directory().'/lang');\n\tload_child_theme_textdomain('et_builder', get_stylesheet_directory().'/includes/builder/languages');\n}", "function wp_scripts()\n {\n }", "function indagare_wp_handle() {\r\n\t/*\r\n\tif( ! isset( $_COOKIE['STYXKEY_firstview'] ) ) {\r\n\t\tsetcookie( 'STYXKEY_firstview', '1', time() + 315360000, '/', $_SERVER['HTTP_HOST'] );\r\n\t\tif ( is_home() || is_front_page() ) {\r\n\t\t\tif ( ! is_user_logged_in() ) {\r\n\t\t\t\theader('Location: /intro/');\r\n\t\t\t\texit;\r\n\t\t\t}\r\n\t\t}\r\n\t} // end first visit - intro page\r\n\t*/\r\n\r\n\tif(function_exists('acf_add_options_page'))\r\n\tacf_add_options_page(array(\r\n\t\t'page_title' \t=> __('Indagare Settings','indagare'),\r\n\t\t'menu_title'\t=> __('Indagare Settings','indagare'),\r\n\t\t'menu_slug' \t=> 'acf-options',\r\n\t\t'capability'\t=> 'edit_posts',\r\n\t\t'redirect'\t\t=> false\r\n\t));\r\n}", "function wpms_classifieds_init() {\n\tregister_activation_hook ( __FILE__, 'wpms_classifieds_build_permissions' );\n//\tif (isset($_GET['page']) && $_GET['page'] == 'settings_page_wp-multilingual-slider') {\n// \t add_action('admin_init', 'wpms_register');\n//\t}\n\tadd_action('admin_init', 'wpms_init');\n\tadd_action('admin_init', 'wpms_register_mysettings');\n\tadd_action('admin_menu', 'wpms_home_create_menu');\n//\tload_plugin_textdomain( 'wp-multilingual-slider', 'wp-content/plugins/wp-multilingual-slider/languages/');\n}", "function conure_setup()\n{\n\t#load_theme_textdomain( 'conure', get_template_directory() . '/languages' );\n\n\t/**\n\t* Register global options from theme options \"up_options\"\n\t*/\n\tadd_action( 'init', 'register_global_up_options_variable' );\n\tadd_action( 'wp_enqueue_scripts', 'conure_load_scripts' );\n\tadd_action( 'widgets_init', 'conure_widgets_init' );\n\tadd_action( 'login_enqueue_scripts', 'custom_login_logo' );\n\tadd_filter( 'login_headerurl', 'my_login_logo_url' );\n\tadd_action( 'wp_before_admin_bar_render', 'remove_wp_logo' );\n\t#add_action( 'admin_init', 'my_remove_menu_pages' );\n\tadd_theme_support( 'automatic-feed-links' );\n\tadd_theme_support( 'post-thumbnails' );\n\tregister_nav_menus( array(\n\t \t'main-menu' => __( 'Main Menu', 'conure' ) \n\t )\n\t);\n\tadd_filter( 'wp_title', 'conure_filter_wp_title' );\n\tadd_filter( 'the_title', 'conure_title' );\n}", "function loading_page_admin_init(){\n load_plugin_textdomain( LOADING_PAGE_TD, false, LOADING_PAGE_PLUGIN_DIR . '/languages/' );\n\n // Set plugin links\n $plugin = plugin_basename(__FILE__);\n add_filter('plugin_action_links_'.$plugin, 'loading_page_links');\n\n // Load resources\n add_action('admin_enqueue_scripts', 'loading_page_admin_resources');\n\n }", "function wpthemes1() {\n\t\tload_theme_textdomain( 'wpthemes1', get_template_directory() . '/languages' );\n\t\tadd_theme_support( 'title-tag' );\n\t\tadd_theme_support( 'post-thumbnails' );\n\t\tadd_theme_support( 'automatic-feed-links' );\n\t\tadd_theme_support(\n\t\t\t'thml5',\n\t\t\tarray(\n\t\t\t\t'comment-list',\n\t\t\t\t'comment-form',\n\t\t\t\t'search-form',\n\t\t\t\t'gallery',\n\t\t\t\t'caption',\n\t\t\t)\n\t\t);\n\t\tregister_nav_menu(\n\t\t\t'primary',\n\t\t\tesc_html__( 'Primary Menu' )\n\t\t);\n\t}", "function wowaries_setup() {\n /* WowAriesProject generated Load Text Domain Begin */\n load_theme_textdomain( 'wowaries', get_template_directory() . '/languages' );\n /* WowAriesProject generated Load Text Domain End */\n\n // Add default posts and comments RSS feed links to head.\n add_theme_support( 'automatic-feed-links' );\n\n /*\n * Let WordPress manage the document title.\n */\n add_theme_support( 'title-tag' );\n\n /*\n * Enable support for Post Thumbnails on posts and pages.\n */\n add_theme_support( 'post-thumbnails' );\n set_post_thumbnail_size( 825, 510, true );\n\n // Add menus.\n register_nav_menus( array(\n 'primary' => __( 'Primary Menu', 'wowaries' ),\n 'social' => __( 'Social Links Menu', 'wowaries' ),\n ) );\n\n /*\n * Switch default core markup for search form, comment form, and comments\n * to output valid HTML5.\n */\n add_theme_support( 'html5', array(\n 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'\n ) );\n\n}", "function pd_startup()\n{\n add_action('init', 'pd_head_cleanup');\n add_action('after_setup_theme', 'pd_theme_support'); /* end pd theme support */\n}", "function schechter_setup() {\r\n add_editor_style();\r\n\r\n // Grab Image_Text_WIdget.\r\n require( dirname( __FILE__ ) . '/inc/widgets.php' );\r\n\r\n // Add default posts and comments RSS feed links to <head>.\r\n add_theme_support( 'automatic-feed-links' );\r\n\r\n // This theme uses wp_nav_menu() sidebar.\r\n register_nav_menu( 'primary', __( 'Primary Menu', 'schechterthemeprivate' ) );\r\n \r\n // This theme uses Featured Images for attach image to logo and photo\r\n add_theme_support( 'post-thumbnails' );\r\n\t\r\n}", "function rekord_setup() {\n\n /*\n * Make theme available for translation.\n * Translations can be filed in the /languages/ directory.\n * If you're building a theme based on rekord, use a find and replace\n * to change 'rekord' to the name of your theme in all the template files\n */\n \n\n $domain = 'rekord';\n\n load_theme_textdomain( $domain, WP_LANG_DIR . '/rekord/' );\n load_theme_textdomain( $domain, get_stylesheet_directory() . '/languages/' );\n load_theme_textdomain( $domain, get_template_directory() . '/languages/' );\n\n\n // Add default posts and comments RSS feed links to head.\n add_theme_support( 'automatic-feed-links' );\n add_theme_support( 'post-formats', array('video' ) );\n // Add wp title support\n add_theme_support( 'title-tag' );\n add_theme_support( 'custom-logo' );\n add_theme_support( 'align-wide' );\n\n /*\n * Enable support for Post Thumbnails on posts and pages.\n *\n * @link http://codex.WordPress.org/Function_Reference/add_theme_support#Post_Thumbnails\n */\n add_theme_support( 'post-thumbnails');\n \n // This theme uses wp_nav_menu() in one location.\n register_nav_menus( array(\n 'main-menu' => esc_html__( 'Main Menu', 'rekord' ),\n 'user-menu' => esc_html__( 'User Dashboard Menu', 'rekord' ),\n 'artist-menu' => esc_html__( 'Artist Dashboard Menu', 'rekord' ),\n ) );\n\n\n // Setup the WordPress core custom background feature.\n add_theme_support( 'custom-background', apply_filters( 'rekord_custom_background_args', array(\n 'default-color' => 'ffffff',\n 'default-image' => '',\n ) ) );\n}", "function theme_enqueue_scripts() {\n wp_enqueue_script( 'pavi_load_post' );\n\n}", "function wp_enqueue_scripts()\n {\n }", "function mfwp_add_content($content) {\r\n\t// récupération de la valeur déclarée en global\r\n\tglobal $mfwp_options;\r\n\r\n\t// Deux conditions: templating et case à cocher pour unable (fichier admin-page.php)\r\n\tif(is_singular() && $mfwp_options[\"enable\"] == true ) {\r\n\t\t// affichage des contenus avec un nettoyage au dernier moment\r\n\t\t$extra_content = sprintf('<p class=\"twitter-message %s\">%s <a href=\"%s\" target=\"_blank\">%s</a> %s<br>%s</p>', $mfwp_options[\"theme\"], __('Follow', 'my-first-wordpress-plugin'), esc_url($mfwp_options[\"twitter_url\"]), esc_html($mfwp_options[\"twitter_name\"]), __('on Twitter:', 'my-first-wordpress-plugin'), wp_kses_post($mfwp_options[\"twitter_bio\"]) );\r\n\t\t$content .= $extra_content;\r\n\t}\r\n\t// dans un filtre le contenu est toujours retourné\r\n\treturn $content;\r\n}", "function wp_dashboard_quick_press_output()\n {\n }", "function init_template()\n{\n // add theme support es una funcion que agrega\n // funcionalidades extrar al tema\n add_theme_support( 'post-thumbnails');\n // post Thumbnails se podrá usar una imagen destacada\n add_theme_support( 'title-tag');\n // permite añadir el titulo de la pagina\n\n // Registrar el MENU\n register_nav_menus(\n array(\n 'top_menu' => 'Menu de Principal',\n 'top_menu_secondary' => 'Menu secundario'\n )\n );\n}", "function ltthe_setup()\r\n{\r\n\tadd_theme_support('post-thumbnails');\r\n\r\n\tremove_action('wp_head','wp_generator');\r\n\r\n\tremove_filter('the_content','wptexturize');\r\n\tremove_filter('the_excerpt','wptexturize');\r\n\r\n\tadd_theme_support('title-tag');\r\n\r\n\trequire_once('includes/wp-bootstrap-navwalker.php');\r\n\r\n\tregister_nav_menus( array('primary' =>__('principal')) );\r\n}", "function theme_doc()\n{\n\tinclude(\"admin/admin-shortcodes.php\");\n}", "function wordfes2014_setup() {\n\t\tload_theme_textdomain( 'wordfes2014', get_template_directory() . '/languages' );\n\n\t\t// Add default posts and comments RSS feed links to head.\n\t\tadd_theme_support( 'automatic-feed-links' );\n\n\t\t/*\n\t\t * Enable support for Post Thumbnails on posts and pages.\n\t\t *\n\t\t * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails\n\t\t */\n\t\tadd_theme_support( 'post-thumbnails' );\n\n\t\t// This theme uses wp_nav_menu() in one location.\n\t\tregister_nav_menus( array(\n\t\t\t'primary' => __( 'Primary Menu', 'wordfes2014' ),\n\t\t\t// 'sub-primary' => __( 'プライマリーメニュー (仮)', 'wordfes2014' ),\n\t\t) );\n\n\n\t\t/*\n\t\t * Switch default core markup for search form, comment form, and comments\n\t\t * to output valid HTML5.\n\t\t */\n\t\tadd_theme_support( 'html5', array(\n\t\t\t'search-form', 'comment-form', 'comment-list', 'gallery', 'caption'\n\t\t) );\n\n\t\t/*\n\t\t * Enable support for Post Formats.\n\t\t * See http://codex.wordpress.org/Post_Formats\n\t\t */\n\t\tadd_theme_support( 'post-formats', array(\n\t\t\t'aside', 'image', 'video', 'quote', 'link',\n\t\t) );\n\n\t}", "function skudo_admin_init(){\n\tglobal $current_screen, $skudo_data, $wp_version, $skudo_met, $skudo_import_fonts, $post;\n\t\n\twp_enqueue_media();\n\twp_enqueue_script( 'gallery' );\n\t\n\twp_register_script('skudo-page-options',SKUDO_SCRIPT_URL.'page-options.js', array('jquery'));\n\t$_wpb_vc_js_status = isset($_GET['post']) ? get_post_meta( $_GET['post'], '_wpb_vc_js_status', true ) : false;\n\tif ($_wpb_vc_js_status == \"false\") $_wpb_vc_js_status = false;\n\t$isGuten = ( ( defined('GUTENBERG_VERSION') || intval($wp_version) > 4 ) && !isset($_GET['classic-editor']) && !$_wpb_vc_js_status ) ? true : false;\n\twp_localize_script( 'skudo-page-options', \"isGuten\", array($isGuten) );\n\t\n\twp_register_script('skudo-options',SKUDO_SCRIPT_URL.'options.js', array('jquery'));\n\t$skudo_met = ini_get('max_execution_time');\n\twp_localize_script( 'skudo-options', 'max_execution_time', $skudo_met );\n\t\n\twp_enqueue_script('jquery-ui-slider', array('jquery'));\n\t\n\tif($current_screen->base=='post'){\n\t\t//enqueue the script and CSS files for the TinyMCE editor formatting buttons\n\t\twp_enqueue_script('jquery-ui-dialog', array('jquery'));\n\t\twp_enqueue_script('skudo-page-options');\n\t\twp_enqueue_script('skudo-colorpicker',SKUDO_SCRIPT_URL.'colorpicker.js', array('jquery'));\n\n\t\t//set the style files\n\t\tadd_editor_style('lib/formatting-buttons/custom-editor-style.css');\n\t\twp_enqueue_style('skudo-page-style',SKUDO_CSS_URL.'page_style.css');\n\t\twp_enqueue_style('skudo-colorpicker-style',SKUDO_CSS_URL.'colorpicker.css');\n\t\twp_enqueue_script('skudo-ajaxupload',SKUDO_SCRIPT_URL.'ajaxupload.js', array('jquery'));\n\t\twp_enqueue_script('skudo-options');\n\t\twp_enqueue_script('skudo-options-des',SKUDO_SCRIPT_URL.'options_upper.js', array('jquery'));\n\t\t\n\t\tif ($isGuten && isset($post->ID)){\n\t\t\t$skudo_styleColor = \"#\".get_option(\"skudo_style_color\");\n\t\t\tif (\"#\".get_option(\"skudo_style_color\") != $skudo_styleColor) $skudo_styleColor = \"#\".get_option(\"skudo_style_color\");\n\t\t\t$skudo_color_code = substr($skudo_styleColor,1);\n\t\t\t\n\t\t\tif (get_post_meta($post->ID, \"skudo_enable_custom_pagetitle_options_value\", true) == \"no\" || !get_post_meta($post->ID, \"skudo_enable_custom_pagetitle_options_value\", true)){\n\t\t\t\t$tcolor = get_option(\"skudo_header_text_color\");\n\t\t\t\t$tsize = intval(str_replace(\" \", \"\", get_option(\"skudo_header_text_size\")),10).\"px\";\n\t\t\t\t$tfont = get_option(\"skudo_header_text_font\");\n\t\t\t\t$type = get_option(\"skudo_header_type\");\n\t\t\t\t$originalalign = get_option(\"skudo_header_text_alignment\");\n\t\t\t\t$thecolor = skudo_hex2rgb(str_replace(\"__USE_THEME_MAIN_COLOR__\", $skudo_color_code, get_option(\"skudo_header_color\"))); \n\t\t\t\t$opacity = intval(str_replace(\"%\",\"\",get_option(\"skudo_header_opacity\")))/100;\n\t\t\t\t$color = \"rgba(\".$thecolor[0].\",\".$thecolor[1].\",\".$thecolor[2].\",\".$opacity.\")\";\n\t\t\t\t$image = get_option(\"skudo_header_image\"); \n\t\t\t\t$pattern = SKUDO_PATTERNS_URL.get_option(\"skudo_header_pattern\"); \n\t\t\t\t$custompattern = get_option(\"skudo_header_custom_pattern\");\n\t\t\t\t$pagetitlepadding = get_option('skudo_page_title_padding');\n\t\t\t\t$pt_overlay = get_option(\"skudo_pagetitle_image_overlay\") == \"on\" ? true : false;\n\t\t\t\t$pt_overlay_type = get_option(\"skudo_pagetitle_overlay_type\");\n\t\t\t\t$pt_overlay_the_color = skudo_hex2rgb(str_replace(\"__USE_THEME_MAIN_COLOR__\", $skudo_color_code, get_option(\"skudo_pagetitle_overlay_color\")));\n\t\t\t\t$pt_overlay_pattern = (is_string(get_option(\"skudo_pagetitle_overlay_pattern\"))) ? SKUDO_PATTERNS_URL.get_option(\"skudo_pagetitle_overlay_pattern\") : \"\";\n\t\t\t\t$pt_overlay_opacity = intval(str_replace(\"%\",\"\",get_option(\"skudo_pagetitle_overlay_opacity\")))/100;\n\t\t\t\t$pt_overlay_color = \"rgba(\".$pt_overlay_the_color[0].\",\".$pt_overlay_the_color[1].\",\".$pt_overlay_the_color[2].\",\".$pt_overlay_opacity.\")\";\n\t\t\t\t$background_position = get_option(\"skudo_pagetitle_background_position\");\n\t\t\t} else {\n\t\t\t\t$tcolor = get_post_meta($post->ID, \"skudo_header_text_color_value\", true);\n\t\t\t\t$tsize = intval(str_replace(\" \", \"\", get_post_meta($post->ID, \"skudo_header_text_size_value\", true)),10).\"px\";\n\t\t\t\t$tfont = get_post_meta($post->ID, \"skudo_header_text_font_value\", true);\n\t\t\t\t$type = get_post_meta($post->ID, \"skudo_header_type_value\", true);\n\t\t\t\t$originalalign = get_post_meta($post->ID, \"skudo_header_text_alignment_value\", true);\n\t\t\t\t$thecolor = skudo_hex2rgb(get_post_meta($post->ID, \"skudo_header_color_value\", true)); \n\t\t\t\t$opacity = intval(str_replace(\"%\",\"\",get_post_meta($post->ID, \"skudo_header_color_opacity_value\", true)))/100;\n\t\t\t\t$color = \"rgba(\".$thecolor[0].\",\".$thecolor[1].\",\".$thecolor[2].\",\".$opacity.\")\";\n\t\t\t\t$image = get_post_meta($post->ID, \"skudo_header_image_value\", true);\n\t\t\t\t$image = explode('|!|',$image);\n\t\t\t\tif (isset($image[1])) $image = explode('|*|',$image[1]);\n\t\t\t\t$image = $image[0];\n\t\t\t\t$pattern = SKUDO_PATTERNS_URL.get_post_meta($post->ID, \"skudo_header_pattern_value\", true).\".jpg\";\n\t\t\t\t$custompattern = get_option(\"skudo_header_custom_pattern_value\"); \n\t\t\t\t$pagetitlepadding = intval(str_replace(\" \", \"\", get_post_meta($post->ID, \"skudo_page_title_padding_value\", true)),10).\"px\";\n\t\t\t\t$pt_overlay = get_post_meta($post->ID, \"skudo_pagetitle_image_overlay_value\", true) == \"on\" ? true : false;\n\t\t\t\t$pt_overlay_type = get_post_meta($post->ID, \"skudo_pagetitle_overlay_type_value\", true);\n\t\t\t\t$pt_overlay_the_color = skudo_hex2rgb(get_post_meta($post->ID, \"skudo_pagetitle_overlay_color_value\", true));\n\t\t\t\t$pt_overlay_pattern = SKUDO_PATTERNS_URL.get_post_meta($post->ID, \"skudo_pagetitle_overlay_pattern_value\", true).\".jpg\";\n\t\t\t\t$pt_overlay_opacity = intval(str_replace(\"%\",\"\",get_post_meta($post->ID, \"skudo_pagetitle_overlay_opacity_value\", true)))/100;\n\t\t\t\t$pt_overlay_color = \"rgba(\".$pt_overlay_the_color[0].\",\".$pt_overlay_the_color[1].\",\".$pt_overlay_the_color[2].\",\".$pt_overlay_opacity.\")\";\n\t\t\t\t$background_position = get_post_meta($post->ID, \"skudo_header_background_position_value\", true);\n\t\t\t}\n\t\t\t$skudo_import_fonts[] = $tfont; $tfont = explode(\"|\",$tfont); $tfont[0] = $tfont[0].\"', 'Arial', 'sans-serif\"; if (!isset($tfont[1])) $tfont[1] = \"\" ;\n\t\t\t$textalign = $originalalign;\n\t\t\tif ($originalalign == \"titlesleftcrumbsright\") $textalign = \"left\";\n\t\t\tif ($originalalign == \"titlesrightcrumbsleft\") $textalign = \"right\";\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$skudo_style_data = \"\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout * { -webkit-font-smoothing: antialiased; }\n\t\t\t\t\n\t\t\t\t.editor-post-title { padding: 0; }\n\t\t\t\t\n\t\t\t\t.editor-post-title__block {\";\n\t\t\t\t\tif ($type == \"none\") $skudo_style_data .= \"background: none;\"; \n\t\t\t\t\tif ($type == \"color\") $skudo_style_data .= \"background: \" . esc_html($color) . \";\";\n\t\t\t\t\tif ($type == \"image\") $skudo_style_data .= \"background: url(\" . esc_url($image) . \") no-repeat; background-size: 100% auto;\"; \n\t\t \t\t\tif ($type == \"pattern\") $skudo_style_data .= \"background: url('\" . esc_url($pattern) . \"') 0 0 repeat;\";\n\t\t\t\t\t$skudo_style_data .= \"\n\t\t\t\t\tpadding: \".esc_html($pagetitlepadding).\" 15px;\n\t\t\t\t\tmax-width: none !important;\n\t\t\t\t\tbackground-position: \". esc_html($background_position) .\";\n\t\t\t\t}\";\n\t\t\t\t\n\t\t\tif ($pt_overlay){\n\t\t\t\t$skudo_style_data .= \"\n\t\t\t\t.editor-post-title__block::before {\n\t\t\t\t\tcontent: '';\n\t\t\t\t\tposition: absolute;\n\t\t\t\t\ttop: 0;\n\t\t\t\t\tright: 0;\n\t\t\t\t\tbottom: 0;\n\t\t\t\t\tleft: 0;\n\t\t\t\t\tpointer-events: none;\n\t\t\t\t\tbackground: \". ($pt_overlay_type == \"color\" ? esc_html($pt_overlay_color) : esc_html( 'url('. $pt_overlay_pattern .') repeat; opacity: '. $pt_overlay_opacity )) . \";\n\t\t\t\t}\";\n\t\t\t}\n\t\t\t\t\n\t\t\t$skudo_style_data .= \"\n\t\t\t\t.editor-post-title__block textarea {\n\t\t\t\t\tfont-family: '\".wp_kses_post($tfont[0]).\"' ,sans-serif !important;\n\t\t\t\t\tfont-weight: \".esc_html( $tfont[1] != \"\" ? $tfont[1] : 600 ).\" !important;\n\t\t\t\t\tfont-size: \".esc_html(intval($tsize)).\"px !important;\n\t\t\t\t\ttext-align: \".esc_html($textalign).\";\n\t\t\t\t\tcolor: #\".esc_html(str_replace(\"__USE_THEME_MAIN_COLOR__\", $skudo_color_code, $tcolor)).\" !important;\";\n\t\t\t\t\t$skudo_style_data .= \"\n\t\t\t\t\t\tmargin-bottom: 0;\n\t\t\t\t\t\tline-height: 1.5em;\n\t\t\t\t\t\tfont-weight: bold;\n\t\t\t\t\t\t-moz-transform: translateZ(1px); -webkit-transform: translateZ(1px); transform: translateZ(1px);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout { padding-top: 35px; }\n\t\t\t\t.editor-block-list__layout .editor-block-list__layout { padding-top: initial; }\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout p, .editor-block-list__layout span, .editor-block-list__layout ul, .editor-block-list__layout ol, .editor-block-list__layout li, .editor-block-list__layout .wp-block-button__link, .editor-block-list__layout .wp-block-table__cell-content, .editor-block-list__layout figcaption { \";\n\t\t\t\t\t$font = get_option('skudo_p_font'); $skudo_import_fonts[] = $font; $font = explode(\"|\",$font); $font[0] = $font[0].\"', 'Arial', 'sans-serif\"; if (!isset($font[1])) $font[1] = \"\" ;\n\t\t\t\t\t$skudo_style_data .= \"\n\t\t\t\t\tfont-family: '\".wp_kses_post($font[0]).\"' ,sans-serif;\n\t\t\t\t\tfont-weight: \". esc_html( $font[1] != \"\" ? $font[1] : 'normal' ) .\";\n\t\t\t\t\tfont-size: \".esc_html(intval(get_option('skudo_p_size'), 10)).\"px !important;\n\t\t\t\t\tcolor: #\".esc_html(str_replace(\"__USE_THEME_MAIN_COLOR__\", $skudo_color_code, get_option(\"skudo_p_color\"))).\" !important;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout p.wp-block-cover-text{ font-size: 2em !important; }\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout ul, .editor-block-list__layout ol { \n\t\t\t\t\tmargin: 0 !important; padding: 0 !important; \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout ul, .editor-block-list__layout li {\n\t\t\t\t\tlist-style: disc;\n\t\t\t\t\tpadding-left: 0 !important;\n\t\t\t\t\tline-height: 1.5em;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout ul.wp-block-categories__list{ text-align: left; }\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout ul li {\n\t\t\t\t\tmargin-left: 20px;\n\t\t\t\t\tmargin-top: .8em;\n\t\t\t\t\tmargin-bottom: .8em;\n\t\t\t\t\twidth: auto;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout ol li {\n\t\t\t\t\tline-height: 1.5em;\n\t\t\t\t\tmargin-left: 20px;\n\t\t\t\t\tlist-style-type: decimal;\n\t\t\t\t\tmargin-top: 1%;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout .is-grid li{ list-style: none; }\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout a { \";\n\t\t\t\t\t$font = get_option('skudo_links_font'); $skudo_import_fonts[] = $font; $font = explode(\"|\",$font); $font[0] = $font[0].\"', 'Arial', 'sans-serif\"; if (!isset($font[1])) $font[1] = \"\" ;\n\t\t\t\t\t$skudo_style_data .= \"\n\t\t\t\t\tfont-family: '\".wp_kses_post($font[0]).\"' ,sans-serif;\n\t\t\t\t\tfont-weight: \". esc_html( $font[1] != \"\" ? $font[1] : 'normal' ) .\";\n\t\t\t\t\tfont-size: \".esc_html(intval(get_option('skudo_links_size'), 10)).\"px;\n\t\t\t\t\tcolor: #\".esc_html(str_replace(\"__USE_THEME_MAIN_COLOR__\", $skudo_color_code, get_option(\"skudo_links_color\"))).\";\n\t\t\t\t\ttext-decoration: none;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout div.wp-block-button__link:hover{ color: white !important; }\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout pre {\n\t\t\t\t\tbackground: #f2f2f2;\n\t\t\t\t\tpadding: 10px;\n\t\t\t\t\tborder: 1px solid #ededed;\n\t\t\t\t\tfont-family: Menlo, Monaco, Consolas, 'Courier New', monospace;\n\t\t\t\t\tfont-size: 14px !important;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout blockquote {\n\t\t\t\t\tborder: none !important;\n\t\t\t\t\tpadding: 0 !important;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout .wp-block-pullquote{ border:none !important; }\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout blockquote > div{ margin-left: 40px; }\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout blockquote > div:first-child {\n\t\t\t\t\tbackground: #f7f7f7;\n\t\t\t\t\tborder-left: 3px solid #707070 !important;\n\t\t\t\t\tmargin: 60px 40px 0px 40px !important;\n\t\t\t\t}\n\t\t\t\t.editor-block-list__layout blockquote p {\n\t\t\t\t\tcolor: #707070 !important;\n\t\t\t\t\tmargin: 20px 0px !important;\n\t\t\t\t\tfont-size: 1.05em !important;\n\t\t\t\t\tfont-family: Roboto Slab, Georgia;\n\t\t\t\t\tpadding: 40px 40px 40px 30px !important;\n\t\t\t\t\tfont-style: italic;\n\t\t\t\t\tline-height: 1.6;\n\t\t\t\t}\n\t\t\t\t.editor-block-list__layout blockquote .editor-rich-text, .editor-block-list__layout blockquote .wp-block-quote__citation, .editor-block-list__layout .wp-block-pullquote__citation{\n\t\t\t\t\tfont-family: Roboto Slab, Georgia;\n\t\t\t\t\tfont-size: 1.05em !important;\n\t\t\t\t\tcolor: #707070 !important;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout .wp-block-audio figcaption {\n\t\t\t\t\tmargin-top: -.5em !important;\n\t\t\t\t\tmargin-bottom: 1em !important;\n\t\t\t\t\tcolor: #555d66 !important;\n\t\t\t\t\ttext-align: center !important;\n\t\t\t\t\tfont-size: 13px !important;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout hr:not(.is-style-dots) {\n\t\t\t\t\tborder: 1px solid #f2f2f2 !important;\n\t\t\t\t\theight: 0 !important;\n\t\t\t\t\tmargin-top: 20px !important;\n\t\t\t\t\tmargin-bottom: 20px !important;\n\t\t\t\t\tmax-width: none !important;\n\t\t\t\t\twidth: 100%;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout table {\n\t\t\t\t\tborder-collapse: collapse;\n\t\t\t\t\tborder-spacing: 0;\n\t\t\t\t}\n\n\t\t\t\t.editor-block-list__layout table thead th {\n\t\t\t\t\tbackground: #f2f2f2;\n\t\t\t\t\tfont-weight: 700;\n\t\t\t\t}\n\n\t\t\t\t.editor-block-list__layout table td,table th {\n\t\t\t\t\tpadding: 5px 14px;\n\t\t\t\t\tborder: 1px solid #ddd !important;\n\t\t\t\t\ttext-align: left;\n\t\t\t\t}\n\n\t\t\t\t.editor-block-list__layout table tbody tr:nth-child(even) {\n\t\t\t\t\tbackground: #f5f5f5;\n\t\t\t\t}\n\n\t\t\t\t.editor-block-list__layout tbody tr:last-child {\n\t\t\t\t\tborder-bottom: 1px solid #ddd;\n\t\t\t\t\tborder-right: 1px solid #ddd;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout h1{\";\n\t\t\t\t\t$font = get_option('skudo_h1_font'); $skudo_import_fonts[] = $font; $font = explode(\"|\",$font); $font[0] = $font[0].\"', 'Arial', 'sans-serif\"; if (!isset($font[1])) $font[1] = \"\";\n\t\t\t\t\t$skudo_style_data .= \"\n\t\t\t\t\tfont-family: '\".wp_kses_post($font[0]).\"';\n\t\t\t\t\tfont-weight: \". esc_html( $font[1] != \"\" ? $font[1] : 'normal' ) .\";\n\t\t\t\t\tfont-size: \".esc_html(intval(get_option('skudo_h1_size'), 10)).\"px;\n\t\t\t\t\tcolor: #\".esc_html(str_replace(\"__USE_THEME_MAIN_COLOR__\", $skudo_color_code, get_option(\"skudo_h1_color\"))).\";\n\t\t\t\t}\n\t\n\t\t\t\t.editor-block-list__layout h2{\";\n\t\t\t\t\t$font = get_option('skudo_h2_font'); $skudo_import_fonts[] = $font; $font = explode(\"|\",$font); $font[0] = $font[0].\"', 'Arial', 'sans-serif\"; if (!isset($font[1])) $font[1] = \"\";\n\t\t\t\t\t$skudo_style_data .= \"\n\t\t\t\t\tfont-family: '\".wp_kses_post($font[0]).\"';\n\t\t\t\t\tfont-weight: \". esc_html( $font[1] != \"\" ? $font[1] : 'normal' ) .\";\n\t\t\t\t\tfont-size: \".esc_html(intval(get_option('skudo_h2_size'), 10)).\"px;\n\t\t\t\t\tcolor: #\".esc_html(get_option('skudo_h2_color')).\";\n\t\t\t\t}\n\t\n\t\t\t\t.editor-block-list__layout h3{\";\n\t\t\t\t\t$font = get_option('skudo_h3_font'); $skudo_import_fonts[] = $font; $font = explode(\"|\",$font); $font[0] = $font[0].\"', 'Arial', 'sans-serif\"; if (!isset($font[1])) $font[1] = \"\";\n\t\t\t\t\t$skudo_style_data .= \"\n\t\t\t\t\tfont-family: '\".wp_kses_post($font[0]).\"';\n\t\t\t\t\tfont-weight: \". esc_html( $font[1] != \"\" ? $font[1] : 'normal' ) .\";\n\t\t\t\t\tfont-size: \".esc_html(intval(get_option('skudo_h3_size'), 10)).\"px;\n\t\t\t\t\tcolor: #\".esc_html(str_replace(\"__USE_THEME_MAIN_COLOR__\", $skudo_color_code, get_option(\"skudo_h3_color\"))).\";\n\t\t\t\t}\n\t\n\t\t\t\t.editor-block-list__layout h4{\";\n\t\t\t\t\t$font = get_option('skudo_h4_font'); $skudo_import_fonts[] = $font; $font = explode(\"|\",$font); $font[0] = $font[0].\"', 'Arial', 'sans-serif\"; if (!isset($font[1])) $font[1] = \"\";\n\t\t\t\t\t$skudo_style_data .= \"\n\t\t\t\t\tfont-family: '\".wp_kses_post($font[0]).\"';\n\t\t\t\t\tfont-weight: \". esc_html( $font[1] != \"\" ? $font[1] : '300' ) .\";\n\t\t\t\t\tfont-size: \".esc_html(intval(get_option('skudo_h4_size'), 10)).\"px;\n\t\t\t\t\tcolor: #\".esc_html(str_replace(\"__USE_THEME_MAIN_COLOR__\", $skudo_color_code, get_option(\"skudo_h4_color\"))).\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.editor-block-list__layout h5{\";\n\t\t\t\t\t$font = get_option('skudo_h5_font'); $skudo_import_fonts[] = $font; $font = explode(\"|\",$font); $font[0] = $font[0].\"', 'Arial', 'sans-serif\"; if (!isset($font[1])) $font[1] = \"\";\n\t\t\t\t\t$skudo_style_data .= \"\n\t\t\t\t\tfont-family: '\".wp_kses_post($font[0]).\"';\n\t\t\t\t\tfont-weight: \". esc_html( $font[1] != \"\" ? $font[1] : 'normal' ) .\";\n\t\t\t\t\tfont-size: \".esc_html(intval(get_option('skudo_h5_size'), 10)).\"px;\n\t\t\t\t\tcolor: #\".esc_html(str_replace(\"__USE_THEME_MAIN_COLOR__\", $skudo_color_code, get_option(\"skudo_h5_color\"))).\";\n\t\t\t\t}\n\t\n\t\t\t\t.editor-block-list__layout h6{\";\n\t\t\t\t\t$font = get_option('skudo_h6_font'); $skudo_import_fonts[] = $font; $font = explode(\"|\",$font); $font[0] = $font[0].\"', 'Arial', 'sans-serif\"; if (!isset($font[1])) $font[1] = \"\";\n\t\t\t\t\t$skudo_style_data .= \"\n\t\t\t\t\tfont-family: '\".wp_kses_post($font[0]).\"';\n\t\t\t\t\tfont-weight: \". esc_html( $font[1] != \"\" ? $font[1] : 'normal' ) .\";\n\t\t\t\t\tfont-size: \".esc_html(intval(get_option('skudo_h6_size'), 10)).\"px;\n\t\t\t\t\tcolor: #\".esc_html(str_replace(\"__USE_THEME_MAIN_COLOR__\", $skudo_color_code, get_option(\"skudo_h6_color\"))).\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.wp-block {\n\t\t\t\t max-width: 1200px;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t.wp-block-pullquote cite, .wp-block-pullquote footer, .wp-block-pullquote__citation{ text-transform: none; }\n\t\t\t\";\n\t\t\t\n\t\t\twp_add_inline_style('skudo-page-style', $skudo_style_data);\n\t\t}\n\t}\n\n\tif(isset($_GET['page']) && ( $_GET['page']==SKUDO_OPTIONS_PAGE || $_GET['page']==SKUDO_STYLE_OPTIONS_PAGE || $_GET['page']==SKUDO_DEMOS_PAGE)){\n\t\t//enqueue the scripts for the Options page\n\t\twp_enqueue_script('jquery-ui-sortable', array('jquery'));\n\t\twp_enqueue_script('jquery-ui-dialog', array('jquery'));\n\t\twp_enqueue_script('skudo-jquery-co',SKUDO_SCRIPT_URL.'jquery-co.js', array('jquery'));\n\t\twp_enqueue_script('skudo-ajaxupload',SKUDO_SCRIPT_URL.'ajaxupload.js', array('jquery'));\n\t\twp_enqueue_script('skudo-colorpicker',SKUDO_SCRIPT_URL.'colorpicker.js', array('jquery'));\n\t\twp_enqueue_script('skudo-options');\n\t\twp_enqueue_script('skudo-options-des',SKUDO_SCRIPT_URL.'options_upper.js', array('jquery'));\n\t\twp_enqueue_script('skudo-jquery-ui',SKUDO_SCRIPT_URL.'jquery-ui-1.12.1.custom.min.js', array('jquery'));\n\n\t\t//enqueue the styles for the Options page\n\t\twp_enqueue_style('skudo-admin-style',SKUDO_CSS_URL.'admin_style.css');\n\t\twp_enqueue_style('skudo-colorpicker-style',SKUDO_CSS_URL.'colorpicker.css');\n\t\twp_enqueue_style('skudo-jqueryui-style',SKUDO_CSS_URL.'cupertino/jquery-ui-1.12.1.custom.min.css');\n\t\t\n\t\techo \"<div hidden class='skudo_fixed_menu hidden'>\".esc_html(get_option('skudo_fixed_menu')).\"</div>\";\n\t\techo \"<div hidden class='skudo_header_after_scroll hidden'>\".esc_html(get_option('skudo_header_after_scroll')).\"</div>\";\n\t\techo \"<div hidden class='skudo_header_shrink_effect hidden'>\".esc_html(get_option('skudo_header_shrink_effect')).\"</div>\";\n\n\t\tif (get_option(\"skudo_show_sec_footer\") == \"on\"){\n\t\t\tif (get_option(\"skudo_footer_display_logo\") == \"on\"){\n\t\t\t\techo \"<div hidden class='skudo_footer_logo_type hidden'>\".esc_html(get_option('skudo_footer_logo_type')).\"</div>\";\t\n\t\t\t}\n\t\t\tif (get_option(\"skudo_footer_display_social_icons\") == \"on\"){\n\t\t\t\techo \"<div hidden class='skudo_footer_display_social_icons hidden'>\".get_option('skudo_footer_display_social_icons').\"</div>\";\t\n\t\t\t}\n\t\t}\n\t}\n\n\tif(defined('SKUDO_PORTFOLIO_POST_TYPE') && $current_screen->id==SKUDO_PORTFOLIO_POST_TYPE){\n\t\t//enqueue the scripts needed for the add/edit portfolio post\n\t\twp_enqueue_script('skudo-ajaxupload',SKUDO_SCRIPT_URL.'ajaxupload.js', array('jquery'));\n\t\twp_enqueue_script('skudo-options');\n\t\twp_enqueue_media();\n\t\twp_enqueue_script( 'custom-header' );\n\t}\n\n\tif($current_screen->id=='page'){\n\t\t//enqueue the scripts needed for the add/edit page page\n\t\twp_enqueue_script('skudo-page-options');\n\t\twp_enqueue_script('skudo-options');\n\t\twp_enqueue_script('skudo-ajaxupload',SKUDO_SCRIPT_URL.'ajaxupload.js', array('jquery'));\n\t}\n\n\tif(isset($_GET['page']) && defined('SKUDO_PORTFOLIO_POST_TYPE') && $_GET['page']==SKUDO_PORTFOLIO_POST_TYPE){\n\t\t//wp_enqueue_script('jquery-ui-core', array('jquery'));\n\t\twp_enqueue_script('jquery-ui-widget', array('jquery'));\n\t\twp_enqueue_script('jquery-ui-sortable', array('jquery'));\n\t\twp_enqueue_script('jquery-ui-dialog', array('jquery'));\n\t\twp_enqueue_script('skudo-ajaxupload',SKUDO_SCRIPT_URL.'ajaxupload.js', array('jquery'));\n\t\twp_enqueue_script('skudo-options');\n\t\twp_enqueue_script('skudo-custom-page',SKUDO_SCRIPT_URL.'custom-page.js', array('jquery'));\n\t\t//enqueue the styles for the Options page\n\t\twp_enqueue_style('skudo-admin-style',SKUDO_CSS_URL.'custom_page.css');\n\t\twp_enqueue_style('jquery-ui-dialog');\n\t}\n\n}", "function rt_after_setup(){\n\n\t// SUPORTE PARA IMAGENS \n\tadd_theme_support('post-thumbnails');\n\n\t//SUPORTE PARA TITLE DO TEMA\n\tadd_theme_support('title-tag');\n\n\t//LOGO CUSTOMIZADA\n\tadd_theme_support('custom-logo');\n\n\t//SUPORTE PARA MENUS\n\tadd_theme_support('menus');\n\n\tregister_nav_menu('primary', __('Primary Menu','temaOne'));\n\tregister_nav_menu('footer', 'Menu Rodapé');\n\n\t// REMOVENDO A BARRA DO ADMIN\n\tshow_admin_bar(false);\n\n}", "public function wp_loaded()\n {\n }", "function flexiauto_setup() {\n\t\t/* Make theme available for translation. */\n\t\tload_theme_textdomain( 'flexiauto' );\n\t\t// load_theme_textdomain( 'flexiauto', TPL_DIR . '/languages' );\n\n\t\t/* Let WordPress manage the document title. */\n\t\tadd_theme_support( 'title-tag' );\n\n\t\t/* Enable support for Post Thumbnails on posts and pages. */\n\t\tadd_theme_support( 'post-thumbnails' );\n\n\t\t/* Enable support for image sizes. */\n\t\tadd_image_size( 'flexiauto-featured-image', 1920, 1070, true );\n\t\tadd_image_size( 'flexiauto-single-image', 1920, 540, true );\n\t\tadd_image_size( 'flexiauto-article-image', 530, 300, true );\n\n\t\t/* This theme uses wp_nav_menu() in these locations. */\n\t\tregister_nav_menus( array(\n\t\t\t'top' => __( 'Top Menu', 'flexiauto' ),\n\t\t\t'bottom' => __( 'Bottom Menu', 'flexiauto' ),\n\t\t\t'findus' => __( 'Find us Menu', 'flexiauto' ),\n\t\t\t// 'links' => __( 'Bottom links Menu', 'flexiauto' ),\n\t\t\t'quicklinks' => __( 'Quick links Menu', 'flexiauto' ),\n\t\t\t'languges' => __( 'Languages Menu', 'flexiauto' ),\n\t\t) );\n\n\t\t/* Register language switcher sidebar */\n\t\tregister_sidebar(array(\n\t\t\t\t\t\t\t\t\t\t\t'name' => __( 'language', 'quadrimex' ),\n\t\t\t\t\t\t\t\t\t\t\t'id' => 'language',\n\t\t\t\t\t\t\t\t\t\t\t'description' => __( 'widget des langues.', 'flexiauto' ),\n\t\t\t\t\t\t\t\t\t\t\t'before_widget' => '<ul class=\"lang\">',\n\t\t\t\t\t\t\t\t\t\t\t'after_widget' => '</ul>',\n\t\t\t\t\t\t\t\t\t\t\t));\n\n\t\t/*\n\t\t* Switch default core markup for search form,\n\t\t* comment form, and comments\n\t\t* to output valid HTML5.\n\t\t*/\n\t\tadd_theme_support( 'html5', array(\n\t\t\t'comment-form',\n\t\t\t'comment-list',\n\t\t\t'gallery',\n\t\t\t'caption',\n\t\t) );\n\n\t\t/* Enable support for Post Formats. */\n\t\tadd_theme_support( 'post-formats', array(\n\t\t\t'aside',\n\t\t\t'image',\n\t\t\t'video',\n\t\t\t'quote',\n\t\t\t'link',\n\t\t\t'gallery',\n\t\t\t'audio',\n\t\t) );\n\n\t\t/*\n\t\t* This theme styles the visual editor to resemble the theme style,\n\t\t* specifically font, colors, and column width.\n\t\t*/\n\t\tadd_editor_style(\n\t\t\tarray( 'assets/css/editor-style.css', flexiauto_fonts_url())\n\t\t);\n\t}", "function capezzahill_setup(){\r\n add_theme_support('automatic-feed-links');\r\n\r\n // Auto generate title tag without hard-coding\r\n add_theme_support( 'title-tag' );\r\n add_filter( 'wp_title', 'wpdocs_hack_wp_title_for_home' );\r\n\r\n // Post thumbnails \r\n add_theme_support( 'post-thumbnails' );\r\n set_post_thumbnail_size( 1568, 9999 );\r\n\r\n register_nav_menus(\r\n array(\r\n 'top-right' => __( 'Header Area', 'capezzahill'),\r\n 'footer' => __( 'Footer Menu', 'capezzahill'),\r\n 'social' => __( 'Social Links Menu', 'capezzahill'),\r\n )\r\n );\r\n\r\n add_theme_support( \r\n 'html5',\r\n array(\r\n 'search-form',\r\n 'comment-form',\r\n 'comment-list',\r\n 'gallery',\r\n 'caption',\r\n )\r\n );\r\n\r\n add_theme_support(\r\n 'custom-logo',\r\n array(\r\n 'height' => 190,\r\n 'width' => 190,\r\n 'flex-width' => false,\r\n 'flex-height' => false,\r\n 'header-text' => array( 'site-title', 'site-description' ),\r\n )\r\n );\r\n \r\n // language\r\n load_theme_textdomain( 'capezzahill', get_template_directory() . '/languages' );\r\n \r\n // Allows for live refresh when updating widgets in customizer I think\r\n add_theme_support( 'customize-selective-refresh-widgets' );\r\n\r\n // Allow user to decide full with options for editor\r\n add_theme_support( 'align-wide' );\r\n \r\n // Theme support for visual look of blocks on backend only\r\n add_theme_support( 'wp-block-styles' );\r\n\r\n add_theme_support( 'editor-styles' );\r\n add_editor_style( 'custom-editor-style.css' );\r\n\r\n // Add excerpts to page\r\n add_post_type_support( 'page', 'excerpt' );\r\n \r\n add_theme_support( \r\n 'editor-font-sizes',\r\n array(\r\n array(\r\n 'name' => __( 'Small', 'themeLangDomain'),\r\n 'shortName' => __('S', 'capezzahill'),\r\n 'size' => 19.5,\r\n 'slug' => 'small'\r\n ),\r\n array(\r\n 'name' => __('Normal', 'themeLangDomain'),\r\n 'shortName' => __('M', 'capezzahill'),\r\n 'size' => 22,\r\n 'slug' => 'normal'\r\n ),\r\n array(\r\n 'name' => __('Large', 'themeLangDomain'),\r\n 'shortName' => __('L', 'capezzahill'),\r\n 'size' => 36.5,\r\n 'slug' => 'large'\r\n ),\r\n array(\r\n 'name' => __('Huge', 'themeLangDomain'),\r\n 'shortName' => __('XL', 'capezzahill'),\r\n 'size' => 49.5,\r\n 'slug' => 'huge'\r\n )\r\n )\r\n );\r\n\r\n add_theme_support(\r\n 'editor-color-palette',\r\n array(\r\n // Come back to this when you add customizer support for colors ;)\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'name' => 'default' === get_theme_mod( 'primarytop_colortop-right' ) ? __( 'Blue', 'capezzahill' ) : null,\r\n\t\t\t\t\t'slug' => 'primary',\r\n\t\t\t\t\t'color' => capezzahill_hsl_hex( 'default' === get_theme_mod( 'primary_color' ) ? 199 : get_theme_mod( 'primary_color_hue', 199 ), 100, 33 ),\r\n\t\t\t\t),\r\n\t\t\t\tarray(\r\n\t\t\t\t\t'name' => 'default' === get_theme_mod( 'primary_color' ) ? __( 'Dark Blue', 'capezzahill' ) : null,\r\n\t\t\t\t\t'slug' => 'secondary',\r\n 'color' => capezzahill_hsl_hex( 'default' === get_theme_mod( 'primary_color' ) ? 199 : get_theme_mod( 'primary_color_hue', 199 ), 100, 23 ),\r\n ),\r\n array(\r\n 'name' => __( 'Ligh Blue', 'capezzahill'),\r\n 'slug' => 'light-blue',\r\n 'color' => '#0077B6'\r\n ),\r\n array(\r\n 'name' => __( 'Navy', 'capezzahill'),\r\n 'slug' => 'navy',\r\n 'color' => '#10153F'\r\n ),\r\n array(\r\n 'name' => __( 'Dark Gray', 'capezzahill'),\r\n 'slug' => 'dark-gray',\r\n 'color' => '#333333'\r\n ),\r\n array(\r\n 'name' => __( 'Light Gray', 'capezzahill'),\r\n 'slug' => 'light-gray',\r\n 'color' => '#B0B7BB'\r\n ),\r\n array(\r\n 'name' => __( 'White', 'capezzahill'),\r\n 'slug' => 'white',\r\n 'color' => '#fff'\r\n ),\r\n array(\r\n 'name' => __( 'Black', 'capezzahill'),\r\n 'slug' => 'black',\r\n 'color' => '#000'\r\n ),\r\n )\r\n );\r\n \r\n add_theme_support('responsive-embeds');\r\n }", "function adafunc_setup(){\r\n load_plugin_textdomain('wp-ada', true, dirname( plugin_basename( __FILE__ ) ) . '/lang' );\r\n\r\n //Enables Pet and Lost Types\r\n $PETPostType = new PETPostType();\r\n\r\n\t\t//Register the post type\r\n\t\tadd_action('init', array($PETPostType,'register'),3 );\r\n\r\n //Register pet type taxonomies\r\n add_action('init', 'create_type_taxonomies', 5 );\r\n add_action('init', 'create_color_taxonomies', 6 );\r\n add_action('init', 'create_status_taxonomy', 7 );\r\n add_action('init', 'create_state_taxonomy', 8 );\r\n\r\n //Metabox script\r\n add_action ('init', 'meta_box_script', 10);\r\n\r\n //Contextual Help\r\n add_action('admin_head', 'plugin_header');\r\n add_action('contextual_help', 'add_help_text', 10, 3 );\r\n\r\n //Widgets\r\n add_action('widgets_init', create_function('', 'return register_widget(\"ADA_Widget_Tagcloud\");'));\r\n add_action('widgets_init', create_function('', 'return register_widget(\"ADA_Widget_Searchform\");'));\r\n add_action('widgets_init', create_function('', 'return register_widget(\"ADAWidget\");'));\r\n add_shortcode( 'ada', 'ada_shortcode' );\r\n }", "function cbp_display_front_page() {\n\t?>\n\t\t<h2>Chibipaint Integration</h2>\n\t\t<h3>Introduction</h3>\n\t\t<p>This plugin's purpose is to integrate the Chibipaint applet with Wordpress. The code was largely rewritten from the previous version back in 2010. Some of the notable differences are:</p>\n\t\t<ul class=\"ul-disc\">\n\t\t<li>Visibility &amp; Accessibility: Where you had to access the applet via the upload media section, it is now placed in a &quot;metabox&quot; above the WYSIWYG editor of any post type of your choosing</li>\n\t\t<li>Choice of location: You can choose where to place the files you save, but you are restricted to within the upload folder.</li>\n\t\t</ul>\n\t\t<p>If you feel I've missed any, feel free to let me know. The applet itself can be found at http://www.chibipaint.com/.</p>\n\t\t<h3>Known Limitations</h3>\n\t\t<ul class=\"ul-disc\">\n\t\t<li>Currently, you can only change the default dimensions. There are plans to allow users to add dimensions they commonly use and to pick them from a drop down list at the editor.</li>\n\t\t<li>There is currently no implementation of templates. The closest thing to it now is to upload an image to the post, select it in the list of images and click on Edit. There are also plans to implement a template feature for the plugin.</li>\n\t\t<li>The plugin cannot do a recursive search for wp-config.php.</li>\n\t\t<li>This plugin has not been tested with a multiuser wordpress install. It's certain it will not work since there are no filtering based on author, nor is the author of the image saved with the attachment.</li>\n\t\t<li>If the user saves the source file, all edits will be based on the source file. This is particularly troublesome for those who decide to save image only later on.</li>\n\t\t</ul>\n\t<?php\n}", "function modify_left_copyright() {\n \t ?><p>© <?php echo date('Y'); ?> AI Scripts <a href=\"<?php echo admin_url();?>\" title=\"Login to the backend of WordPress.\" />Login.</a></p>\n \t<?php\n }", "function my_admin_page_contents() {\n\t\t?>\n\t\t\t<h1>\n\t\t\t\tPage d'aministration du plugin de création de formulaire\n\t\t\t\t\n\t\t\t</h1>\n\t\t<?php\n\t}", "function daboTheme_setup(){\n\t\t\n\t\t$lang_dir = THEMEROOT . '/languages';\n\t\tload_theme_textdomain( 'daboTheme' , $lang_dir );\n\n\t\t/**\n\t\t * Add support for post formats.\n\t\t */\n\t\t\n\t\tadd_theme_support( 'post-formats', \n\t\t\tarray(\n\t\t\t\t'gallery',\n\t\t\t\t'link',\n\t\t\t\t'image',\n\t\t\t\t'quote',\n\t\t\t\t'video',\n\t\t\t\t'audio'\n\t\t\t\t) \n\t\t);\n\n\t\t/**\n\t\t *\tAdd support for automatic feed links.\n\t\t */\n\t\t\n\t\tadd_theme_support( 'automatic-feed-links' );\n\n\t\t/**\n\t\t * \tAdd support for post thumbnails\n\t\t */\n\t\t\n\t\tadd_theme_support( 'post-thumbnails' );\n\n\t\t/**\n\t\t * \tRegister nav menus\n\t\t */\n\t\t\n\t\tregister_nav_menus(\n\t\t\tarray(\n\t\t\t\t'main-menu' => __( 'Main Menu' , 'daboTheme' )\n\t\t\t)\n\t\t);\n\t}", "function viaggio_setup() {\n\t/*\n\t * Make theme available for translation.\n\t * Translations can be filed in the /languages/ directory.\n\t * If you're building a theme based on viaggio, use a find and replace\n\t * to change 'viaggio' to the name of your theme in all the template files.\n\t */\n\tload_theme_textdomain( 'viaggio', get_template_directory() . '/languages' );\n\n\t// Add default posts and comments RSS feed links to head.\n\tadd_theme_support( 'automatic-feed-links' );\n\n\t/*\n\t * Let WordPress manage the document title.\n\t * By adding theme support, we declare that this theme does not use a\n\t * hard-coded <title> tag in the document head, and expect WordPress to\n\t * provide it for us.\n\t */\n\tadd_theme_support( 'title-tag' );\n\n\t/*\n\t * Enable support for Post Thumbnails on posts and pages.\n\t *\n\t * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/\n\t */\n\tadd_theme_support( 'post-thumbnails' );\n\n\t//POST TYPES\n\tadd_theme_support( 'post-formats', array( 'image', 'audio' , 'gallery' , 'video' ) );\n\n\t// This theme uses wp_nav_menu() in one location.\n\tregister_nav_menus( array(\n\t\t'primary' => esc_html__( 'Primary', 'viaggio' ),\n\t\t'off_canvas_menu' => esc_html__( 'Off Canvas', 'viaggio' ),\n\t) );\n\n\t/*\n\t * Switch default core markup for search form, comment form, and comments\n\t * to output valid HTML5.\n\t */\n\tadd_theme_support( 'html5', array(\n\t\t'search-form',\n\t\t'comment-form',\n\t\t'comment-list',\n\t\t'gallery',\n\t\t'caption',\n\t) );\n\n\t// Set up the WordPress core custom background feature.\n\tadd_theme_support( 'custom-background', apply_filters( 'viaggio_custom_background_args', array(\n\t\t'default-color' => 'ffffff',\n\t\t'default-image' => '',\n\t) ) );\n}", "function sec_conf() {\n\n // Head cleanup\n add_action( 'init', 'sec_head_cleanup' );\n\n // Menu\n add_action( 'init', 'sec_register_nav_menus' );\n add_filter( 'nav_menu_css_class', 'sec_toggle_nav_class', 10, 2 );\n\n // Remove wp version from rss\n add_filter( 'the_generator', 'sec_rss_version' );\n\n // Enqueue scripts & styles\n add_action( 'wp_enqueue_scripts', 'sec_scripts_and_styles', 999 );\n\n // theme support after theme setup\n sec_theme_support();\n\n // change post type query on home page\n add_filter( 'pre_get_posts', 'sec_get_posts' );\n\n // clean up random code around images\n add_filter( 'the_content', 'sec_filter_ptags_on_images' );\n\n add_action( 'admin_menu', 'remove_author_metabox' );\n add_action( 'post_submitbox_misc_actions', 'move_author_to_publish_metabox' );\n\n // ACF Options Page\n initThemeOptions();\n\n // Debugger\n add_filter( 'template_include', 'var_template_include', 1000 );\n}", "function inject_js() {\nglobal $wp;\n$current_url = add_query_arg( $wp->query_string, '', home_url( $wp->request ) );\nif($current_url == 'url zeljene stranice stranice'){\n\techo '<script src=\"'. esc_url( plugins_url( __FILE__ ) ).'/imeJSfajlaGdeSeNalazi.js\"></script>';\n \t }\n}", "function eddenvato_init(){\n\n\t// Load Lang\n\tload_plugin_textdomain( 'eddenvato', false, EDDENVATO_RELPATH . '/languages/' );\n\n\t// Make sure we are not in the admin section\n\tif (!is_admin()){\n\n\t\t// Flush, register, enque CSS\n\t\twp_deregister_style('eddenvato-css');\n\t\twp_register_style('eddenvato-css', EDDENVATO_LOCATION.'/css/eddenvato.css');\n\t\twp_enqueue_style('eddenvato-css');\n\n\t}\n\n\t// Strap tinyMCE\n\teddenvato_mce();\n\n}", "function pd_theme_support()\n{\n\n /* =============== \tAdd language supports =============== */\n load_theme_textdomain('pd', get_template_directory() . '/lang');\n\n\n /* =============== Rss feed support =============== */\n add_theme_support('automatic-feed-links');\n\n\n /* =============== \t Add post formarts supports =============== */\n add_theme_support('post-formats', array('aside', 'gallery', 'link', 'image', 'quote', 'status', 'video', 'audio', 'chat'));\n}", "function setup() : void {\n\t/**\n\t * Make theme available for translation.\n\t * Translations can be filed in the /languages/ directory.\n\t * If you're building a theme based on ALiEMU, use a find and replace\n\t * to change 'aliemu' to the name of your theme in all the template files.\n\t */\n\tload_theme_textdomain( 'aliemu', get_template_directory() . '/languages' );\n\n\t/**\n\t * Let WordPress manage the document title.\n\t * By adding theme support, we declare that this theme does not use a\n\t * hard-coded <title> tag in the document head, and expect WordPress to\n\t * provide it for us.\n\t */\n\tadd_theme_support( 'title-tag' );\n\n\t/**\n\t * Enable support for Post Thumbnails on posts and pages.\n\t *\n\t * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/\n\t */\n\tadd_theme_support( 'post-thumbnails' );\n\n\t/**\n\t * Switch default core markup for search form, comment form, and comments\n\t * to output valid HTML5.\n\t */\n\tadd_theme_support(\n\t\t'html5',\n\t\t[\n\t\t\t'search-form',\n\t\t\t'comment-form',\n\t\t\t'comment-list',\n\t\t\t'gallery',\n\t\t\t'caption',\n\t\t]\n\t);\n\n\t// Add theme support for selective refresh for widgets.\n\tadd_theme_support( 'customize-selective-refresh-widgets' );\n\n\t// This theme uses wp_nav_menu() in one location.\n\tregister_nav_menus(\n\t\t[\n\t\t\t'menu-primary' => esc_html__( 'Primary Navigation', 'aliemu' ),\n\t\t\t'menu-footer' => esc_html__( 'Footer Links', 'aliemu' ),\n\t\t]\n\t);\n}", "function spreadshop_designer()\n{\ninclude(plugin_dir_path(__FILE__).'/spreaddesigner.php');\nadd_filter('wp_head', 'sources');\n}", "function itstar_ahoy() {\n\n //Allow editor style.\n //add_editor_style( get_stylesheet_directory_uri() . '/library/css/editor-style.css' );\n\n // let's get language support going, if you need it\n load_theme_textdomain( 'itstar', get_template_directory() . '/languages' );\n\n // USE THIS TEMPLATE TO CREATE CUSTOM POST TYPES EASILY\n require_once( 'library/custom-post-type.php' );\n\n // launching operation cleanup\n add_action( 'init', 'itstar_head_cleanup' );\n // A better title\n add_filter( 'wp_title', 'rw_title', 10, 3 );\n // remove WP version from RSS\n add_filter( 'the_generator', 'itstar_rss_version' );\n // remove pesky injected css for recent comments widget\n add_filter( 'wp_head', 'itstar_remove_wp_widget_recent_comments_style', 1 );\n // clean up comment styles in the head\n add_action( 'wp_head', 'itstar_remove_recent_comments_style', 1 );\n // clean up gallery output in wp\n add_filter( 'gallery_style', 'itstar_gallery_style' );\n\n // enqueue base scripts and styles\n add_action( 'wp_enqueue_scripts', 'itstar_scripts_and_styles', 999 );\n // ie conditional wrapper\n\n // launching this stuff after theme setup\n itstar_theme_support();\n\n // adding sidebars to Wordpress (these are created in functions.php)\n add_action( 'widgets_init', 'itstar_register_sidebars' );\n\n // cleaning up random code around images\n add_filter( 'the_content', 'itstar_filter_ptags_on_images' );\n // cleaning up excerpt\n add_filter( 'excerpt_more', 'itstar_excerpt_more' );\n\n remove_filter('template_redirect', 'redirect_canonical'); \n}", "function custom_print_script(){\r\r\n\r\r\n ?>\r\r\n\r\r\n <script>\r\r\n var siteUrl = '<?php echo site_url(); ?>';\r\r\n //ajaxUrl = '<?php echo admin_url('admin-ajax.php'); ?>';\r\r\n var templateDirRootUrl = '<?php echo site_url(); ?>/wp-content/plugins/oel-cmp/templates/';\r\r\n var pluginsDirUr = '<?php echo site_url(); ?>/wp-content/plugins/oel-cmp';\r\r\n </script>\r\r\n <?php\r\r\n\r\r\n}", "function sparcwp_setup() {\n global $cap, $content_width;\n\n // This theme styles the visual editor with editor-style.css to match the theme style.\n add_editor_style();\n\n if ( function_exists( 'add_theme_support' ) ) {\n\n\t\t/**\n\t\t * Add default posts and comments RSS feed links to head\n\t\t*/\n\t\tadd_theme_support( 'automatic-feed-links' );\n\t\t\n\t\t/**\n\t\t * Enable support for Post Thumbnails on posts and pages\n\t\t *\n\t\t * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails\n\t\t*/\n\t\tadd_theme_support( 'post-thumbnails' );\n\t\t\n\t\t/**\n\t\t * Enable support for Post Formats\n\t\t*/\n\t\tadd_theme_support( 'post-formats', array( 'aside', 'image', 'video', 'quote', 'link' ) );\n\t\t\n\t\t/**\n\t\t * Setup the WordPress core custom background feature.\n\t\t*/\n\t\tadd_theme_support( 'custom-background', apply_filters( 'sparcwp_custom_background_args', array(\n\t\t\t'default-color' => 'ffffff',\n\t\t\t'default-image' => '',\n\t\t) ) );\n\t\n }\n\n\n\t/**\n\t * This theme uses wp_nav_menu() in one location.\n\t*/ \n register_nav_menus(\n array(\n 'primary' => 'Main Menu',\n 'footer_menu' => 'Footer Menu'\n )\n );\n\n}", "function wpdocs_codex_Gallerie_init() {\r\n $labels = array(\r\n 'name' => _x( 'Mes Galleries', 'Post type general name', 'textdomain' ),\r\n 'singular_name' => _x( 'Gallerie', 'Post type singular name', 'textdomain' ),\r\n 'menu_name' => _x( 'Mes Galleries', 'Admin Menu text', 'textdomain' ),\r\n 'name_admin_bar' => _x( 'Gallerie', 'Ajouter une Gallerie', 'textdomain' ),\r\n 'add_new' => __( 'Ajouter une Gallerie', 'textdomain' ),\r\n 'add_new_item' => __( 'Ajouter une Gallerie', 'textdomain' ),\r\n 'new_item' => __( 'Nouvelle Gallerie', 'textdomain' ),\r\n 'edit_item' => __( 'Editer Gallerie', 'textdomain' ),\r\n 'view_item' => __( 'Voir mes Gallerie', 'textdomain' ),\r\n 'all_items' => __( 'Toutes Mes Galleries', 'textdomain' ),\r\n 'search_items' => __( 'Rechercher des Galleries', 'textdomain' ),\r\n 'parent_item_colon' => __( 'Parent Mes Galleries:', 'textdomain' ),\r\n 'not_found' => __( 'Pas de Galleries trouvé.', 'textdomain' ),\r\n 'not_found_in_trash' => __( 'Pas de Galleries trouvé dans la corbeille.', 'textdomain' ),\r\n 'featured_image' => _x( 'Gallerie Cover Image', 'Overrides the “Featured Image” phrase for this post type. Added in 4.3', 'textdomain' ),\r\n 'set_featured_image' => _x( 'Set cover image', 'Overrides the “Set featured image” phrase for this post type. Added in 4.3', 'textdomain' ),\r\n 'remove_featured_image' => _x( 'Remove cover image', 'Overrides the “Remove featured image” phrase for this post type. Added in 4.3', 'textdomain' ),\r\n 'use_featured_image' => _x( 'Use as cover image', 'Overrides the “Use as featured image” phrase for this post type. Added in 4.3', 'textdomain' ),\r\n 'archives' => _x( 'Gallerie archives', 'The post type archive label used in nav menus. Default “Post Archives”. Added in 4.4', 'textdomain' ),\r\n 'insert_into_item' => _x( 'Insert into Gallerie', 'Overrides the “Insert into post”/”Insert into page” phrase (used when inserting media into a post). Added in 4.4', 'textdomain' ),\r\n 'uploaded_to_this_item' => _x( 'Uploaded to this Gallerie', 'Overrides the “Uploaded to this post”/”Uploaded to this page” phrase (used when viewing media attached to a post). Added in 4.4', 'textdomain' ),\r\n 'filter_items_list' => _x( 'Filter Mes Galleries list', 'Screen reader text for the filter links heading on the post type listing screen. Default “Filter posts list”/”Filter pages list”. Added in 4.4', 'textdomain' ),\r\n 'items_list_navigation' => _x( 'Mes Galleries list navigation', 'Screen reader text for the pagination heading on the post type listing screen. Default “Posts list navigation”/”Pages list navigation”. Added in 4.4', 'textdomain' ),\r\n 'items_list' => _x( 'Mes Galleries list', 'Screen reader text for the items list heading on the post type listing screen. Default “Posts list”/”Pages list”. Added in 4.4', 'textdomain' ),\r\n );\r\n \r\n $args = array(\r\n 'labels' => $labels,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'show_ui' => true,\r\n 'show_in_menu' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array( 'slug' => 'Gallerie' ),\r\n 'capability_type' => 'post',\r\n 'has_archive' => true,\r\n 'hierarchical' => false,\r\n 'menu_position' => null,\r\n 'supports' => array( 'title', 'author', 'thumbnail', 'excerpt', 'comments' ),\r\n );\r\n \r\n register_post_type( 'gallerie', $args );\r\n}", "public function wp_init() {\n\t\n\t\t// (re)load our settings\n\t\t$this->load_settings();\n\n\t\tload_plugin_textdomain('wp-united', false, 'wp-united/languages/');\n\t\t\n\t\trequire_once($this->get_plugin_path() . 'template-tags.php');\n\t\t\n\t\t// some login integration routines may be needed even when user integration is disabled.\t\n\t\trequire_once($this->get_plugin_path() . 'user-integrator.php'); \n\t\t\n\t\tif($this->get_setting('xposting')) {\t\t\n\t\t\trequire_once($this->get_plugin_path() . 'cross-posting.php');\n\t\t\t$this->xPoster = new WPU_Plugin_XPosting($this->settings);\n\t\t}\n\n\n\t\t// add new actions and filters\n\t\t$this->add_actions();\n\t\t$this->add_filters();\n\t\tunset($this->actions, $this->filters);\n\n\t}", "function spreadshop_imprint()\n{\ninclude(plugin_dir_path(__FILE__).'/imprint.php');\nadd_filter('wp_head', 'sources');\n}", "function creativedog_setup() {\n\n\t/*\n\t * Make theme available for translation.\n\t * Translations can be filed in the /languages/ directory.\n\t * If you're building a theme based on CreativeDog, use a find and replace\n\t * to change 'creativedog' to the name of your theme in all the template files\n\t */\n\tload_theme_textdomain( 'creativedog', get_template_directory() . '/languages' );\n\n\t// Add default posts and comments RSS feed links to head.\n\tadd_theme_support( 'automatic-feed-links' );\n\n\t/*\n\t * Let WordPress manage the document title.\n\t * By adding theme support, we declare that this theme does not use a\n\t * hard-coded <title> tag in the document head, and expect WordPress to\n\t * provide it for us.\n\t */\n\tadd_theme_support( 'title-tag' );\n\n\t/*\n\t * Enable support for Post Thumbnails on posts and pages.\n\t *\n\t * @link http://codex.wordpress.org/Function_Reference/add_theme_support#Post_Thumbnails\n\t */\n\tadd_theme_support( 'post-thumbnails' );\n\n\t// This theme uses wp_nav_menu() in one location.\n\tregister_nav_menus( array(\n\t\t'primary' => __( 'Primary Menu', 'creativedog' ),\n\t) );\n\n\t/*\n\t * Switch default core markup for search form, comment form, and comments\n\t * to output valid HTML5.\n\t */\n\tadd_theme_support( 'html5', array(\n\t\t'search-form', 'comment-form', 'comment-list', 'gallery', 'caption',\n\t) );\n\n\t/*\n\t * Enable support for Post Formats.\n\t * See http://codex.wordpress.org/Post_Formats\n\t */\n\tadd_theme_support( 'post-formats', array(\n\t\t'aside', 'image', 'video', 'quote', 'link',\n\t) );\n\n\t// Set up the WordPress core custom background feature.\n\tadd_theme_support( 'custom-background', apply_filters( 'creativedog_custom_background_args', array(\n\t\t'default-color' => 'ffffff',\n\t\t'default-image' => '',\n\t) ) );\n}", "function the_post()\n {\n }", "public static function init() {\n\t\tHeadway::load('admin/admin-meta-boxes');\n\t\t\t\t\n\t\tadd_action('delete_post', array(__CLASS__, 'delete_post'));\n\n\t\tadd_filter('get_sample_permalink_html', array(__CLASS__, 'open_in_visual_editor_button'), 10, 4);\n\t\t\n\t}", "function country_inn_setup()\n {\n /*\n * Make theme available for translation.\n */\n load_theme_textdomain( 'country-inn' );\n\n // Add default posts and comments RSS feed links to head.\n add_theme_support('automatic-feed-links');\n /*\n * Let WordPress manage the document title.\n * By adding theme support, we declare that this theme does not use a\n * hard-coded <title> tag in the document head, and expect WordPress to\n * provide it for us.\n */\n add_theme_support('title-tag');\n /*\n * Enable support for Post Thumbnails on posts and pages.\n *\n * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/\n */\n add_theme_support('post-thumbnails');\n\n //Add Excerpt field in page\n add_post_type_support( 'page', 'excerpt' );\n\n // This theme uses wp_nav_menu() in one location.\n register_nav_menus( array(\n\n 'primary' => esc_html__('Primary', 'country-inn'),\n 'social' => esc_html__('Social Icons', 'country-inn'),\n ));\n\n /*\n * Switch default core markup for search form, comment form, and comments\n * to output valid HTML5.\n */\n add_theme_support('html5', array(\n 'comment-form',\n 'comment-list',\n 'gallery',\n 'caption',\n ));\n\n // Set up the WordPress core custom background feature.\n add_theme_support('custom-background', apply_filters('country_inn_custom_background_args', array(\n 'default-color' => 'ffffff',\n 'default-image' => '',\n )));\n //Add theme support for WooCommerce\n add_theme_support('woocommerce');\n\n // Add theme support for selective refresh for widgets.\n add_theme_support('customize-selective-refresh-widgets');\n }", "function wp_init() \n\t\t{\n\t\t\tif (is_admin()) {\n\t\t\t\tadd_action('admin_init', array($this, 'vmt_init'));\n\t\t\t\tadd_action('admin_menu', array($this, 'vmt_options_page'));\n\t\t\t}\n\t\t\tadd_action('wp_head', array($this, 'vmt_head'));\n\t\t}", "function laadDingenIn()\n{\n wp_enqueue_style('style', get_stylesheet_uri());\n wp_enqueue_style('themeStyle', get_template_directory_uri() . '/css/themeStyle.css');\n\n\n wp_enqueue_script('jqueryNew', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js', array('jquery'), 3.5, true);\n wp_enqueue_style('bootstrap', 'https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css');\n wp_enqueue_script('bootstrapJS', 'https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js', array('jquery'), 4.5, true);\n wp_enqueue_script('PopperJS', 'https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js', array('jquery'), 1.16, true);\n\n wp_enqueue_style('FullPageSliderCSS', 'https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/2.7.4/jquery.fullPage.min.css');\n wp_enqueue_script('fullPageSlider', 'https://cdnjs.cloudflare.com/ajax/libs/fullPage.js/2.7.4/jquery.fullPage.min.js', array('jquery'), 2.7, true);\n \n wp_enqueue_style('owlCarouselCSS', 'https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.min.css');\n wp_enqueue_style('owlCarouselThemeCSS', 'https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.theme.default.min.css');\n wp_enqueue_script('owlCarouselJS', 'https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.2.1/owl.carousel.min.js', array('jquery'), 2.2, true);\n \n wp_enqueue_script('fontAwesome', 'https://kit.fontawesome.com/a82e000026.js', array('jquery'), 1.1, true);\n\n wp_enqueue_script('script', get_template_directory_uri() . '/script.js', array('jquery'), 1.1, true);\n}", "function bones_ahoy() {\n\n //Allow editor style.\n add_editor_style( get_current_revision(get_stylesheet_directory_uri() . '/library/css/editor-style.css' ));\n\n // let's get language support going, if you need it\n load_theme_textdomain( 'bonestheme', get_template_directory() . '/library/translation' );\n\n // USE THIS TEMPLATE TO CREATE CUSTOM POST TYPES EASILY\n //require_once( 'library/custom-post-type.php' );\n\n // launching operation cleanup\n add_action( 'init', 'bones_head_cleanup' );\n // A better title\n add_filter( 'wp_title', 'rw_title', 10, 3 );\n // remove WP version from RSS\n add_filter( 'the_generator', 'bones_rss_version' );\n // remove pesky injected css for recent comments widget\n add_filter( 'wp_head', 'bones_remove_wp_widget_recent_comments_style', 1 );\n // clean up comment styles in the head\n add_action( 'wp_head', 'bones_remove_recent_comments_style', 1 );\n // clean up gallery output in wp\n add_filter( 'gallery_style', 'bones_gallery_style' );\n\n // enqueue base scripts and styles\n add_action( 'wp_enqueue_scripts', 'bones_scripts_and_styles', 999 );\n\n // launching this stuff after theme setup\n bones_theme_support();\n\n // adding sidebars to Wordpress (these are created in functions.php)\n add_action( 'widgets_init', 'bones_register_sidebars' );\n\n // cleaning up random code around images\n add_filter( 'the_content', 'bones_filter_ptags_on_images' );\n // cleaning up excerpt\n //add_filter( 'excerpt_more', 'bones_excerpt_more' );\n add_filter( 'excerpt_length', 'bones_excerpt_length', 999 );\n\n add_action( 'wp_default_scripts', 'remove_jquery_migrate' );\n\n}", "function i18n() {\n\tload_theme_textdomain( 'wpd', WPDOC_HLTR_PATH . '/languages' );\n}", "function add_wp_head() {\n }", "function gt_init() {\n add_theme_support('post-thumbnails');\n // title based on the page and General Settings\n add_theme_support('title-tag');\n // HTML support\n add_theme_support('html5', \n array('comment-list', 'comment-form', 'search-form'));\n}", "function rest_output_link_wp_head()\n {\n }", "function raiseit_setup() {\n/**\n* Make theme available for translation.\n* Translations can be placed in the /languages/ directory.\n*/\nload_theme_textdomain( 'raiseitfast', get_template_directory() . '/languages' );\n/**\n* Add default posts and comments RSS feed links to <head>.\n*/\nadd_theme_support( 'automatic-feed-links' );\n/**\n* Enable support for post thumbnails and featured images.\n*/\nadd_theme_support( 'post-thumbnails' );\n/**\n* Add support for two custom navigation menus.\n*/\nregister_nav_menus( array(\n\t'primary' => __( 'Primary Menu', 'raiseitfast' ),\n\t'secondary' => __('Secondary Menu', 'raiseitfast' )\n) );\n/**\n* Enable support for the following post formats:\n* aside, gallery, quote, image, and video\n*/\nadd_theme_support( 'post-formats', array ( 'aside', 'gallery', 'quote', 'image', 'video' ) );\n}", "function __init__(){\n\tadd_theme_support('menus');\n\tadd_theme_support('post-thumbnails');\n\tadd_theme_support( 'title-tag' );\n\tadd_image_size('homepage', 620);\n\tadd_image_size('homepage-secondary', 540);\n\tadd_image_size('centerpiece-image', 940, 338, true); \t// Crops!\n\tadd_image_size('home-thumb', 110, 110);\n\tadd_image_size('subpage-subimg', 160);\n\tadd_image_size('subpage-studentimg', 115, 280);\n\tregister_nav_menu('header-menu', __('Header Menu'));\n\tregister_nav_menu('ucf-colleges', __('UCF Colleges'));\n\tregister_nav_menu('footer-menu', __('Footer Menu'));\n\tregister_nav_menu('social-links', __('Social Links'));\n\tregister_sidebar(array(\n\t\t'name' => __('Left Sidebar'),\n\t\t'id' => 'sidebar-left',\n\t\t'description' => 'Left-hand Sidebar found on subpages.',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t));\n\tregister_sidebar(array(\n\t\t'name' => __('Right Sidebar'),\n\t\t'id' => 'sidebar-right',\n\t\t'description' => 'Right-hand Sidebar found on subpages.',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t));\n\tforeach(Config::$styles as $style){Config::add_css($style);}\n\tforeach(Config::$scripts as $script){Config::add_script($script);}\n\n\tglobal $timer;\n\t$timer = Timer::start();\n\n\twp_deregister_script('l10n');\n\tset_defaults_for_options();\n}", "function mintshow_theme_setup() {\n \n /**\n * Make theme available for translation.\n * Translations can be placed in the /languages/ directory.\n */\n load_theme_textdomain( 'myfirsttheme', get_template_directory() . '/languages' );\n \n /**\n * Add default posts and comments RSS feed links to <head>.\n */\n add_theme_support( 'automatic-feed-links' );\n \n /**\n * Enable support for post thumbnails and featured images.\n */\n add_theme_support( 'post-thumbnails' );\n \n /**\n * Add support for two custom navigation menus.\n */\n register_nav_menus( array(\n 'primary' => __( 'Primary Menu', 'myfirsttheme' ),\n 'secondary' => __('Secondary Menu', 'myfirsttheme' )\n ) );\n \n /**\n * Enable support for the following post formats:\n * aside, gallery, quote, image, and video\n */\n add_theme_support( 'post-formats', array ( 'aside', 'gallery', 'quote', 'image', 'video' ) );\n}", "function band_theme_support() {\n add_theme_support('title-tag');\n add_theme_support('post-thumbnails');\n //navigacija\n register_nav_menus(array(\n 'primary' => __('Primary Menu')\n ));\n}", "function nwclean_setup() {\n\t\tif ( function_exists( 'register_nav_menu' ) ) {\n\t\t\tregister_nav_menu( 'Main navigation menu', 'Main navigation menu' );\n\t\t}\n\t\t/*\n\t\t * Adding expert capabilities\n\t\t */\n\t\tadd_post_type_support( 'page', 'excerpt' );\n\t\t/* \n\t\t * Localising wordpress\n\t\t */\n\t\t$lang = TEMPLATEPATH . '/lang';\n\t\tload_theme_textdomain('nw-clean', $lang);\n\t\t/* \n\t\t * Adding support for post thumbnails\n\t\t */\n\t\tadd_theme_support( 'post-thumbnails' );\n\t\t/* \n\t\t * disabling adming bar\n\t\t */\n\t\tshow_admin_bar(false);\n\t}", "function bones_ahoy()\n{\n\n //Allow editor style.\n add_editor_style(get_stylesheet_directory_uri() . '/library/css/editor-style.css');\n\n // let's get language support going, if you need it\n load_theme_textdomain('bonestheme', get_template_directory() . '/library/translation');\n\n // launching operation cleanup\n add_action('init', 'bones_head_cleanup');\n // A better title\n add_filter('wp_title', 'rw_title', 10, 3);\n // remove WP version from RSS\n add_filter('the_generator', 'bones_rss_version');\n // remove pesky injected css for recent comments widget\n add_filter('wp_head', 'bones_remove_wp_widget_recent_comments_style', 1);\n // clean up comment styles in the head\n add_action('wp_head', 'bones_remove_recent_comments_style', 1);\n // clean up gallery output in wp\n add_filter('gallery_style', 'bones_gallery_style');\n\n // enqueue base scripts and styles\n add_action('wp_enqueue_scripts', 'bones_scripts_and_styles', 999);\n // ie conditional wrapper\n\n // launching this stuff after theme setup\n bones_theme_support();\n\n // cleaning up random code around images\n add_filter('the_content', 'bones_filter_ptags_on_images');\n // cleaning up excerpt\n add_filter('excerpt_more', 'bones_excerpt_more');\n}", "function zzyy_setup() {\n\t//load_theme_textdomain( 'twentytwelve', get_template_directory() . '/languages' );\n\n\t// This theme styles the visual editor with editor-style.css to match the theme style.\n\tadd_editor_style();\n\n\t// Adds RSS feed links to <head> for posts and comments.\n\tadd_theme_support( 'automatic-feed-links' );\n\n\t// This theme supports a variety of post formats.\n\t//add_theme_support( 'post-formats', array( 'aside', 'image', 'link', 'quote', 'status' ) );\n\n\t// This theme uses wp_nav_menu() in one location.\n\tregister_nav_menu( 'primary', __( 'Primary Menu', 'zzyy' ) );\n\n\t/*\n\t * This theme supports custom background color and image, and here\n\t * we also set up the default background color.\n\t */\n\t/*\nadd_theme_support( 'custom-background', array(\n\t\t'default-color' => 'e6e6e6',\n\t) );\n*/\n\n\t// This theme uses a custom image size for featured images, displayed on \"standard\" posts.\n\tadd_theme_support( 'post-thumbnails' );\n\tset_post_thumbnail_size( 624, 9999 ); // Unlimited height, soft crop\n}", "function blog_way_head_action() {\n ?>\n <meta charset=\"<?php bloginfo( 'charset' ); ?>\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <link rel=\"profile\" href=\"http://gmpg.org/xfn/11\">\n <link rel=\"pingback\" href=\"<?php bloginfo( 'pingback_url' ); ?>\">\n <?php\n }", "function agro_setup() {\n\t\tremove_action( 'wp_head', 'feed_links_extra', 3 );\n\t\tremove_action( 'wp_head', 'feed_links' );\n\t\tremove_action( 'wp_head', 'wp_shortlink_wp_head' );\n\t\tremove_action( 'wp_head', 'rsd_link' );\n\t\tremove_action( 'wp_head', 'rest_output_link_wp_head' );\n\t\tremove_action( 'wp_head', 'wp_oembed_add_discovery_links' );\n\t\tremove_action( 'wp_head', 'wlwmanifest_link' );\n\t\tremove_action( 'wp_head', 'wp_generator' );\n\n\t\t// REMOVE WP EMOJI\n\t\tremove_action( 'wp_head', 'print_emoji_detection_script', 7 );\n\t\tremove_action( 'wp_print_styles', 'print_emoji_styles' );\n\t\tremove_action( 'admin_print_scripts', 'print_emoji_detection_script' );\n\t\tremove_action( 'admin_print_styles', 'print_emoji_styles' );\n\n\t\t// HTML5\n\t\tadd_theme_support( 'html5', array(\n\t\t\t'comment-form',\n\t\t\t'comment-list',\n\t\t\t'gallery',\n\t\t\t'caption',\n\t\t));\n\n\t\t// Logo\n\t\tadd_theme_support( 'custom-logo' );\n\n\t\t// Title Tag\n\t\tadd_theme_support( 'title-tag' );\n\n\t\t// Images\n\n\n\t\t// Shortkoder i widget\n\t\tadd_filter( 'widget_text', 'do_shortcode' );\n\n\t\t// Menu\n\t\tregister_nav_menus(array(\n\t\t\t'main-menu-1' => __( 'Main-Menu 1', 'agroaliancen-domain' ),\n\t\t\t'main-menu-2' => __( 'Main-Menu 2', 'agroaliancen-domain' ),\n\t\t\t'main-menu-3' => __( 'Main-Menu 3', 'agroaliancen-domain' ),\n\t\t\t'footer-menu-1' => __( 'Footer-Menu 1', 'agroaliancen-domain' ),\n\t\t\t'footer-menu-2' => __( 'Footer-Menu 2', 'agroaliancen-domain' ),\n\t\t\t'footer-menu-3' => __( 'Footer-Menu 3', 'agroaliancen-domain' ),\n\t\t));\n\n\t}", "function postcountdown_textdomain() {\n\tload_plugin_textdomain( 'postcountdown', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );\n\t#load_plugin_textdomain( 'postcountdown', false, plugins_url( '/languages/', __FILE__ ) );\n}", "function fikactivationfunction($oldname, $oldtheme = false) {\n // Set front page to fik 2012 home page\n update_option('show_on_front', 'page');\n update_option('page_on_front', get_option('fik_home_page_id'));\n // Apply Store front page template\n update_post_meta(get_option('fik_home_page_id'), '_wp_page_template', 'page-templates/store-front-page.php');\n update_option('page_for_posts', get_option('fik_blog_page_id'));\n}", "function _wp_admin_html_begin()\n {\n }", "function blogar_setup()\r\n {\r\n /*\r\n * Make theme available for translation.\r\n * Translations can be filed in the /languages/ directory.\r\n * If you're building a theme based on blogar, use a find and replace\r\n * to change 'blogar' to the name of your theme in all the template files.\r\n */\r\n load_theme_textdomain('blogar', get_template_directory() . '/languages');\r\n\r\n // Add default posts and comments RSS feed links to head.\r\n add_theme_support('automatic-feed-links');\r\n\r\n /*\r\n * Let WordPress manage the document title.\r\n * By adding theme support, we declare that this theme does not use a\r\n * hard-coded <title> tag in the document head, and expect WordPress to\r\n * provide it for us.\r\n */\r\n add_theme_support('title-tag');\r\n\r\n /*\r\n * Enable support for Post Thumbnails on posts and pages.\r\n *\r\n * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/\r\n */\r\n add_theme_support('post-thumbnails');\r\n\r\n // This theme uses wp_nav_menu() in one location.\r\n register_nav_menus(array(\r\n 'primary' => esc_html__('Primary', 'blogar'),\r\n 'headertop' => esc_html__('Header Top Menu (No depth supported)', 'blogar'),\r\n 'footerbottom' => esc_html__('Footer Bottom Menu (No depth supported)', 'blogar'),\r\n ));\r\n\r\n /*\r\n * Switch default core markup for search form, comment form, and comments\r\n * to output valid HTML5.\r\n */\r\n add_theme_support('html5', array(\r\n 'search-form',\r\n 'comment-form',\r\n 'comment-list',\r\n 'gallery',\r\n 'caption',\r\n ));\r\n\r\n // Add theme support for selective refresh for widgets.\r\n add_theme_support('customize-selective-refresh-widgets');\r\n\r\n /**\r\n * Post Format\r\n */\r\n add_theme_support('post-formats', array('gallery', 'link', 'quote', 'video', 'audio'));\r\n\r\n\r\n add_editor_style( array( 'style-editor.css', axil_fonts_url() ) );\r\n add_theme_support('responsive-embeds');\r\n add_theme_support('wp-block-styles');\r\n add_theme_support('editor-styles');\r\n add_editor_style('style-editor.css');\r\n\r\n // for gutenberg support\r\n add_theme_support( 'align-wide' );\r\n add_theme_support( 'editor-color-palette', array(\r\n array(\r\n 'name' => esc_html__( 'Primary', 'blogar' ),\r\n 'slug' => 'blogar-primary',\r\n 'color' => '#3858F6',\r\n ),\r\n array(\r\n 'name' => esc_html__( 'Secondary', 'blogar' ),\r\n 'slug' => 'blogar-secondary',\r\n 'color' => '#D93E40',\r\n ),\r\n array(\r\n 'name' => esc_html__( 'Tertiary', 'blogar' ),\r\n 'slug' => 'blogar-tertiary',\r\n 'color' => '#050505',\r\n ),\r\n array(\r\n 'name' => esc_html__( 'White', 'blogar' ),\r\n 'slug' => 'blogar-white',\r\n 'color' => '#ffffff',\r\n ),\r\n array(\r\n 'name' => esc_html__( 'Dark Light', 'blogar' ),\r\n 'slug' => 'blogar-dark-light',\r\n 'color' => '#1A1A1A',\r\n ),\r\n ) );\r\n\r\n add_theme_support( 'editor-font-sizes', array(\r\n array(\r\n 'name' => esc_html__( 'Small', 'blogar' ),\r\n 'size' => 12,\r\n 'slug' => 'small'\r\n ),\r\n array(\r\n 'name' => esc_html__( 'Normal', 'blogar' ),\r\n 'size' => 16,\r\n 'slug' => 'normal'\r\n ),\r\n array(\r\n 'name' => esc_html__( 'Large', 'blogar' ),\r\n 'size' => 36,\r\n 'slug' => 'large'\r\n ),\r\n array(\r\n 'name' => esc_html__( 'Huge', 'blogar' ),\r\n 'size' => 50,\r\n 'slug' => 'huge'\r\n )\r\n ) );\r\n\r\n /**\r\n * Add Custom Image Size\r\n */\r\n add_image_size('axil-blog-thumb', 295, 250, true);\r\n add_image_size('axil-single-blog-thumb', 1440, 720, true);\r\n add_image_size('axil-main-slider-thumb', 1230, 615, true);\r\n add_image_size('axil-tab-post-thumb', 390, 260, true);\r\n add_image_size('axil-tab-big-post-thumb', 705, 660, true);\r\n add_image_size('axil-tab-small-post-thumb', 495, 300, true);\r\n add_image_size('axil-grid-big-post-thumb', 600, 500, true);\r\n add_image_size('axil-grid-small-post-thumb', 285, 190, true);\r\n\r\n }", "function init_plugin() : void {\n\n\t// CSS/JS.\n\tadd_action( 'enqueue_block_assets', __NAMESPACE__ . '\\load_block_frontend_assets' );\n\tadd_action( 'enqueue_block_editor_assets', __NAMESPACE__ . '\\load_block_editor_assets' );\n\tadd_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\load_full_assets' );\n\tadd_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\\load_messaging_assets' );\n\n\t// Admin-only CSS/JS.\n\tadd_action( 'admin_enqueue_scripts', __NAMESPACE__ . '\\Admin\\load_admin_assets' );\n\tadd_filter( 'admin_body_class', __NAMESPACE__ . '\\Admin\\add_admin_body_class' );\n\n\t// Modify output.\n\tadd_filter( 'body_class', __NAMESPACE__ . '\\add_body_class' );\n\tadd_filter( 'the_content', __NAMESPACE__ . '\\Gating\\maybe_restrict_content' );\n\tadd_filter( 'the_title', __NAMESPACE__ . '\\Gating\\maybe_add_padlock_to_title', 10, 2 );\n\tadd_action( 'wp_head', __NAMESPACE__ . '\\print_meta_tag' );\n\n\t// Admin screens and settings.\n\tadd_filter( 'plugin_action_links_coil-web-monetization/plugin.php', __NAMESPACE__ . '\\Admin\\add_plugin_action_links' );\n\tadd_filter( 'plugin_row_meta', __NAMESPACE__ . '\\Admin\\add_plugin_meta_link', 10, 2 );\n\tadd_action( 'admin_menu', __NAMESPACE__ . '\\Settings\\register_admin_menu' );\n\tadd_action( 'admin_init', __NAMESPACE__ . '\\Settings\\register_admin_content_settings' );\n\tadd_action( 'admin_notices', __NAMESPACE__ . '\\Settings\\admin_welcome_notice' );\n\tadd_action( 'wp_ajax_dismiss_welcome_notice', __NAMESPACE__ . '\\Settings\\dismiss_welcome_notice' );\n\n\t// Term meta.\n\tadd_action( 'edit_term', __NAMESPACE__ . '\\Admin\\maybe_save_term_meta', 10, 3 );\n\tadd_action( 'create_term', __NAMESPACE__ . '\\Admin\\maybe_save_term_meta', 10, 3 );\n\tadd_action( 'delete_term', __NAMESPACE__ . '\\Admin\\delete_term_monetization_meta' );\n\tadd_term_edit_save_form_meta_actions();\n\n\t// Customizer settings.\n\tadd_action( 'customize_register', __NAMESPACE__ . '\\Admin\\add_customizer_messaging_panel' );\n\tadd_action( 'customize_register', __NAMESPACE__ . '\\Admin\\add_customizer_options_panel' );\n\tadd_action( 'customize_register', __NAMESPACE__ . '\\Admin\\add_customizer_learn_more_button_settings_panel' );\n\n\t// User profile settings.\n\tadd_action( 'personal_options', __NAMESPACE__ . '\\User\\add_user_profile_payment_pointer_option' );\n\tadd_action( 'personal_options_update', __NAMESPACE__ . '\\User\\maybe_save_user_profile_payment_pointer_option' );\n\tadd_action( 'edit_user_profile_update', __NAMESPACE__ . '\\User\\maybe_save_user_profile_payment_pointer_option' );\n\tadd_filter( 'option_coil_payment_pointer_id', __NAMESPACE__ . '\\User\\maybe_output_user_payment_pointer' );\n\n\t// Metaboxes.\n\tadd_action( 'load-post.php', __NAMESPACE__ . '\\Admin\\load_metaboxes' );\n\tadd_action( 'load-post-new.php', __NAMESPACE__ . '\\Admin\\load_metaboxes' );\n\tadd_action( 'save_post', __NAMESPACE__ . '\\Admin\\maybe_save_post_metabox' );\n\n\t// Modal messaging\n\tadd_action( 'wp_footer', __NAMESPACE__ . '\\load_plugin_templates' );\n\n\t// Load order - important.\n\tadd_action( 'init', __NAMESPACE__ . '\\Gating\\register_content_meta' );\n\tadd_action( 'init', __NAMESPACE__ . '\\Gating\\register_term_meta' );\n}", "function my_top_right_help_metabox_content() { ?>\n <p>Assicurati di cliccare sul pulsante 'Pubblica' sottostante per pubblicare la nuova voce del menù, oppure 'Aggiorna' per salvare le modifiche.</p>\n<?php }", "function dt_shortcode_admin() {\r\n $rel_theme_url = explode( $_SERVER['SERVER_NAME'], get_template_directory_uri() );\r\n if( isset($rel_theme_url[1]) )\r\n $rel_theme_url = $rel_theme_url[1];\r\n else\r\n $rel_theme_url = str_replace( site_url(), '', get_template_directory_uri() );\r\n\r\n wp_localize_script(\r\n 'custom_quicktags',\r\n 'dt_admin',\r\n array(\r\n 'themeurl'\t=> $rel_theme_url\r\n )\r\n );\r\n }", "function applique_setup() {\r\n\r\n /* Load theme translation file */\r\n load_theme_textdomain( 'applique', get_template_directory() . '/langs' );\r\n\r\n /* This theme styles the visual editor with editor-style.css to match the theme style. */\r\n add_editor_style();\r\n\r\n /* Add default posts and comments RSS feed links to head. */\r\n add_theme_support( 'automatic-feed-links' );\r\n\r\n /* The get thumbnail/image. */\r\n add_theme_support( 'post-thumbnails' );\r\n\r\n /**\r\n * Let WordPress manage the document title.\r\n * By adding theme support, we declare that this theme does not use a\r\n * hard-coded <title> tag in the document head, and expect WordPress to\r\n * provide it for us.\r\n */\r\n add_theme_support( 'title-tag' );\r\n\r\n /* Adds core WordPress HTML5 support. */\r\n add_theme_support( 'html5', array( 'caption', 'comment-form', 'comment-list', 'gallery', 'search-form' ) );\r\n\r\n /**\r\n * Enable support for Post Formats.\r\n * See http://codex.wordpress.org/Post_Formats\r\n */\r\n add_theme_support( 'post-formats', array( 'audio', 'gallery', 'video' ) );\r\n\r\n /* This theme uses wp_nav_menu() in one location. */\r\n register_nav_menus( array(\r\n 'primary-menu' => esc_attr__( 'Primary Menu', 'applique' ),\r\n 'footer-menu' => esc_attr__( 'Footer Menu', 'applique' )\r\n ) );\r\n\r\n /**\r\n * Woocommerce compatibilty\r\n */\r\n add_theme_support( 'woocommerce' );\r\n\r\n }", "function misetes_setup() {\n\n\t/*\n\t * Make theme available for translation.\n\t * Translations can be filed in the /languages/ directory.\n\t * If you're building a theme based on Misetes, use a find and replace\n\t * to change 'misetes' to the name of your theme in all the template files\n\t */\n\tload_theme_textdomain( 'misetes', get_template_directory() . '/languages' );\n\n\t// Add default posts and comments RSS feed links to head.\n\tadd_theme_support( 'automatic-feed-links' );\n\n\t// This theme uses wp_nav_menu() in one location.\n\tregister_nav_menus( array(\n\t\t'footer' \t=> __( 'Footer Menu', 'misetes'),\n\t\t'primary' => __( 'Primary Menu', 'misetes' ),\n\t) );\n\n\t// Enable support for Post Formats.\n\tadd_theme_support( 'post-formats', array('video'));# array( 'aside', 'image', 'video', 'quote', 'link' ) );\n\n\t// Setup the WordPress core custom background feature.\n\t// add_theme_support( 'custom-background', apply_filters( 'misetes_custom_background_args', array(\n\t// \t'default-color' => 'ffffff',\n\t// \t'default-image' => '',\n\t// ) ) );\n\n\t// Enable support for HTML5 markup.\n\tadd_theme_support( 'html5', array(\n\t\t'comment-list',\n\t\t'search-form',\n\t\t'comment-form',\n\t\t'gallery',\n\t\t'caption',\n\t) );\n\n\n\tadd_theme_support('post-thumbnails');\n\tset_post_thumbnail_size(300,300, true);\n}", "public static function admin_init() {\n // oexchange to wordpress mapping\n if (isset($_GET['url']))\n $_GET['u'] = $_GET['url'];\n\n if (isset($_GET['title']))\n $_GET['t'] = $_GET['title'];\n\n if (isset($_GET['description']))\n $_GET['s'] = $_GET['description'];\n\n if (isset($_GET['ctype'])) {\n if ($_GET['ctype'] == \"image\") {\n $_GET['i'] = $_GET['imageurl'];\n }\n }\n }", "function init_setup() {\n require get_template_directory() . '/includes/navwalker.php';\n require get_template_directory() . '/includes/widget.php';\n require get_template_directory() . '/includes/options.php';\n require get_template_directory() . '/includes/plugin.php';\n add_filter('show_admin_bar', '__return_false');\n /**\n * Make theme available for translation.\n * Translations can be placed in the /languages/ directory.\n */\n load_theme_textdomain( 'initializr', get_template_directory() . '/languages' );\n \n /**\n * Add default posts and comments RSS feed links to <head>.\n */\n add_theme_support( 'automatic-feed-links' );\n \n /**\n * Enable support for post thumbnails and featured images.\n */\n add_theme_support( 'post-thumbnails' );\n \n /**\n * Add support for two custom navigation menus.\n */\n register_nav_menus( array(\n 'primary' => __( 'Primary Menu', 'initializr' ),\n 'secondary' => __('Secondary Menu', 'initializr' )\n ) );\n \n /**\n * Enable support for the following post formats:\n * aside, gallery, quote, image, and video\n */\n add_theme_support( 'post-formats', array ( 'aside', 'gallery', 'quote', 'image', 'video' ) );\n }", "function sec_init() {\n\tload_plugin_textdomain(EVNT_TEXTDOMAIN, false, dirname( plugin_basename( __FILE__ ) ) );\n}", "function uds_ads_admin()\n{\n\tglobal $wpdb;\n\tinclude \"ads-admin.php\";\n}", "function wp_welcome_panel()\n {\n }", "function ajoute_le_titre()\n{\n if (!is_admin()) {\n add_theme_support(\"title-tag\");\n } \n}", "function flexfour_setup(){\n\nload_theme_textdomain( 'twentytwelve', get_template_directory() . '/lang' );\nadd_theme_support( 'automatic-feed-links' );\n\tadd_theme_support( 'custom-background', array(\n\t\t'default-color' => 'e6e6e6',\n\t) );\n\tadd_theme_support( 'custom-header' );\n\t// This theme uses a custom image size for featured images, displayed on \"standard\" posts.\n\tadd_theme_support( 'post-thumbnails' );\n\tset_post_thumbnail_size( 624, 9999 ); // Unlimited height, soft crop\n\t\tadd_theme_support( 'menus' ); // wp menus\n}", "function WidgetMeteo($vars) {\n\t\t\tglobal $wpdb;\n\t\t\tglobal $wpdb_query;\n\t\t\tglobal $wp_rewrite;\n\t\t\textract($vars);\n\n\t\t\t$options = get_option('widget_trebimeteo');\n\n\t\t\t$trebimeteotitle = $options['trebimeteotitle'];\n\t\t\t$trebiregione = urlencode($options['trebiregione']);\n\t\t\t$trebilocalita = urlencode($options['trebilocalita']);\n\t\t\t$trebicuno = urlencode($options['trebicuno']);\n\t\t\t$trebicdue = urlencode($options['trebicdue']);\n\t\t\t$trebictre = urlencode($options['trebictre']);\n\t\t\t$trebibuno = urlencode($options['trebibuno']);\n\t\t\t$trebibdue = urlencode($options['trebibdue']);\n\t\t\t$trebibtre = urlencode($options['trebibtre']);\n\t\t\t$trebilarghezza = urlencode($options['trebilarghezza']);\n\t\t\t$trebialtezza = urlencode($options['trebialtezza']);\n\t\t\t$trebitipo = urlencode($options['trebitipo']);\n\t\t\t\n\t\t\t$before_widget='<div class=\"textwidget\">';\n\t\t\t$after_widget='</div>';\n\t\t\techo $before_widget;\n\t\t\techo $before_title; echo $trebimeteotitle; echo $after_title;\n\t\t\t$site_base = get_bloginfo('url');\n\t\n\t\t\tswitch ($trebitipo) {\n\t\t\t\tcase 'xssmall':\n\t\t\t\t\t$trebiurl = 'loc='.$trebilocalita.'&tm=xssmall&c1='.$c1.'&b1='.$trebibuno.'&b2='.$trebibdue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'lsmall':\n\t\t\t\t\t$trebiurl = 'loc='.$trebilocalita.'&tm='.$trebitipo.'&new=1&c1='.$trebicuno.'&c2='.$trebicdue.'&b1='.$trebibuno.'&b2='.$trebibdue.'&b3='.$trebibtre;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'lbigor':\n\t\t\t\t\t$trebiurl = 'loc='.$trebilocalita.'&tm='.$trebitipo.'&new=1&c1='.$trebicuno.'&c2='.$trebicdue.'&b1='.$trebibuno.'&b2='.$trebibdue.'&b3='.$trebibtre;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'treale':\n\t\t\t\t\t$trebiurl = 'loc='.$trebilocalita.'&tm='.$trebitipo.'&c1='.$trebicuno.'&b1='.$trebibuno.'&b2='.$trebibdue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ssmall':\n\t\t\t\t\t$trebiurl = 'loc='.$trebilocalita.'&p=1&tm='.$trebitipo.'&new=1&c1='.$trebicuno.'&c2='.$trebicdue.'&b1='.$trebibuno.'&b2='.$trebibdue.'&b3='.$trebibtre;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'lbig':\n\t\t\t\t\t$trebiurl = 'loc='.$trebilocalita.'&tm='.$trebitipo.'&new=1&c1='.$trebicuno.'&c2='.$trebicdue.'&c3='.$trebictre.'&b1='.$trebibuno.'&b2='.$trebibdue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'oraxora':\n\t\t\t\t\t$trebiurl = 'loc='.$trebilocalita.'&tm='.$trebitipo.'&c1='.$trebicuno.'&c2='.$trebicdue.'&c3='.$trebictre.'&b1='.$trebibuno.'&b2='.$trebibdue;\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'msmall':\n\t\t\t\t\t$trebiurl = 'idreg='.$trebiregione.'&tm='.$trebitipo.'&new=1&c1='.$trebicuno.'&b1='.$trebibuno.'&b2='.$trebibdue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'msmacro': \n\t\t\t\t\t$trebiurl = 'idreg='.$trebiregione.'&tm='.$trebitipo.'&c1='.$trebicuno.'&c2='.$trebicdue.'&c3='.$trebictre.'&b1='.$trebibuno.'&b2='.$trebibdue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'lsmari':\n\t\t\t\t\t$trebiurl = 'loc='.$trebilocalita.'&tm='.$trebitipo.'&c1='.$trebicuno.'&b1='.$trebibuno.'&b2='.$trebibdue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'lmari':\n\t\t\t\t\t$trebiurl = 'loc='.$trebilocalita.'&tm='.$trebitipo.'&c1='.$trebicuno.'&c3='.$trebictre.'&b1='.$trebibuno.'&b2='.$trebibdue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'mmari':\n\t\t\t\t\t$trebiurl = 'idreg='.$trebiregione.'&tm='.$trebitipo.'&c1='.$trebicuno.'&c2='.$trebicdue.'&b1='.$trebibuno.'&b2='.$trebibdue.'&c3='.$trebictre;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'lsneve':\n\t\t\t\t\t$trebiurl = 'loc='.$trebilocalita.'&tm='.$trebitipo.'&c1='.$trebicuno.'&b1='.$trebibuno.'&b2='.$trebibdue;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'lneve':\n\t\t\t\t\t$trebiurl = 'loc='.$trebilocalita.'&tm='.$trebitipo.'&c1='.$trebicuno.'&c3='.$trebictre.'&b1='.$trebibuno.'&b2='.$trebibdue;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\techo '<iframe src=\"https://portali.3bmeteo.com/3bm_meteo.php?'.$trebiurl.'\" width=\"'.$trebilarghezza.'\" height=\"'.$trebialtezza.'\" frameborder=\"0\"></iframe>';\n\t\t\tif ($trebitipo=='mmari' || $trebitipo=='msmacro' || $trebitipo=='msmall') { echo trebi_getUrlRegione($trebiregione); }\n\t\t\telse { echo trebi_getUrlLoc($trebilocalita); }\n\t\t\t//echo '<br/><a href=\"http://www.3bmeteo.com/meteo/abbateggio\" >Meteo Abbateggio</a>'\n\t\t\techo $after_widget;\n\t\t}", "function bones_ahoy() {\n\n\t// let's get language support going, if you need it\n\tload_theme_textdomain( 'bonestheme', get_template_directory() . '/library/translation' );\n\n\t// launching operation cleanup\n\tadd_action( 'init', 'bones_head_cleanup' );\n\t// remove WP version from RSS\n\tadd_filter( 'the_generator', 'bones_rss_version' );\n\t// remove pesky injected css for recent comments widget\n\tadd_filter( 'wp_head', 'bones_remove_wp_widget_recent_comments_style', 1 );\n\t// clean up comment styles in the head\n\tadd_action( 'wp_head', 'bones_remove_recent_comments_style', 1 );\n\t// clean up gallery output in wp\n\tadd_filter( 'gallery_style', 'bones_gallery_style' );\n\n\t// enqueue base scripts and styles\n\tadd_action( 'wp_enqueue_scripts', 'bones_scripts_and_styles', 999 );\n\t// ie conditional wrapper\n\n\t// launching this stuff after theme setup\n\tbones_theme_support();\n\n\t// adding sidebars to Wordpress (these are created in functions.php)\n\tadd_action( 'widgets_init', 'bones_register_sidebars' );\n\n\t// cleaning up random code around images\n\tadd_filter( 'the_content', 'bones_filter_ptags_on_images' );\n\t// cleaning up excerpt\n\tadd_filter( 'excerpt_more', 'bones_excerpt_more' );\n\n}", "function wpmu_menu()\n {\n }", "function wp_upgrade()\n {\n }", "function liquidchurch_setup() {\n /*\n * Make theme available for translation\n *\n * Translations are field in the /languages/ directory.\n */\n\tload_theme_textdomain( 'liquidchurch', get_template_directory() . '/languages' );\n\n\t// Add default posts and comments RSS feed links to head.\n\tadd_theme_support( 'automatic-feed-links' );\n\n\t/*\n\t * Let WordPress manage the document title.\n\t * By adding theme support, we declare that this theme does not use a\n\t * hard-coded <title> tag in the document head, and expect WordPress to\n\t * provide it for us.\n\t */\n\tadd_theme_support( 'title-tag' );\n\n\t/*\n\t * Enable support for Post Thumbnails on posts and pages.\n\t *\n\t * @link https://developer.wordpress.org/themes/functionality/featured-images-post-thumbnails/\n\t */\n\tadd_theme_support( 'post-thumbnails' );\n\tset_post_thumbnail_size( 1200, 9999 );\n\n\t// This theme uses wp_nav_menu() in two locations.\n\tregister_nav_menus( array(\n\t\t'primary' => __( 'Primary Menu', 'liquidchurch' ),\n\t\t'locations' => __( 'Locations Menu', 'liquidchurch' ),\n\t) );\n\n\t/*\n\t * Switch default core markup for search form, comment form, and comments\n\t * to output valid HTML5.\n\t */\n\tadd_theme_support(\n\t 'html5',\n array(\n 'search-form',\n 'comment-form',\n 'comment-list',\n 'gallery',\n 'caption',\n )\n );\n\n\t/*\n\t * Enable support for Post Formats.\n\t */\n\tadd_theme_support( 'post-formats', array(\n\t\t'aside',\n\t\t'image',\n\t\t'video',\n\t\t'quote',\n\t\t'link',\n\t\t'gallery',\n\t\t'status',\n\t\t'audio',\n\t\t'chat',\n\t) );\n\n\t/*\n\t * This theme DOESN'T style the visual editor to resemble the theme style, but it should,\n\t * specifically font, colors, icons, and column width.\n\t */\n\tadd_editor_style( array( 'css/editor-style.css', liquidchurch_fonts_url() ) );\n\n\t// Indicate widget sidebars can use selective refresh in the Customizer.\n\tadd_theme_support( 'customize-selective-refresh-widgets' );\n}", "function jpst_create_menu() {\nadd_menu_page('Twitter Widget with Cache', 'Twitter Widget','administrator', __FILE__, 'jpst_settings_page',plugins_url('/twitterbrd.png', __FILE__));\n\n//call register settings function \nadd_action( 'admin_init', 'jpst_register_settings' );\n\n}", "function IDL_install() {\n\tglobal $wp_version;\n\tif (version_compare($wp_version, \"2.6\", \"<\"))\n\t\tdie(__(\"This Plugin requires WordPress version 2.6 or higher\"));\n}", "public function __construct(){\n\t\tigk_wp_registerlib(IGK_CGT_PLUGIN_DIR.\"/\");\t\n\t}", "function gtpress_admin_menu() {\r\n\t$gtpress_ico = get_option('siteurl').'/wp-content/plugins/'.basename(dirname(__FILE__)).'/';\r\n\tadd_options_page('GT Press', 'GT Press Setup', 8, basename(__FILE__), 'gtpressMenu_options_page', '', $gtpress_ico.'gtpress.png');\r\n}", "function wpbm_plugin_text_domain(){\n load_plugin_textdomain( 'wp-blog-manager', false, basename( dirname( __FILE__ ) ) . '/languages/' );\n }", "function emc_setup() {\r\n\t/**\r\n\t * Make theme available for translation\r\n\t * Translations can be filed in the /languages/ directory\r\n\t */\r\n\tload_theme_textdomain( 'emc', get_template_directory() . '/languages' );\r\n\t$locale = get_locale();\r\n $locale_file = get_template_directory() . '/languages/$locale.php';\r\n if ( is_readable( $locale_file ) ) require_once( $locale_file );\r\n\r\n\t/**\r\n\t * Add default posts and comments RSS feed links to head\r\n\t */\r\n\tadd_theme_support( 'automatic-feed-links' );\r\n\r\n\t/**\r\n\t * Enable support for Post Thumbnails\r\n\t */\r\n\tadd_theme_support( 'post-thumbnails' );\r\n\r\n\t/**\r\n\t * Add image sizes\r\n\t */\r\n\tadd_image_size( 'emc-featured', 646, 363, true ); // 16:9\r\n\r\n\t/**\r\n\t * This theme uses wp_nav_menu() in one location.\r\n\t */\r\n\tregister_nav_menus( array(\r\n\t\t'primary' => __( 'Primary Menu', 'emc' ),\r\n\t) );\r\n}", "function gt_setup(){\n wp_enqueue_style('style',get_stylesheet_uri(),NULL, microtime(),'all');\n wp_enqueue_script(\"main\",get_theme_file_uri('/js/main.js'),NULL,microtime(),true);\n\n\n // if (is_page(11)) {\n // wp_register_style('dhaniya', get_theme_file_uri() . '/style/dhaniya.css');\n // wp_enqueue_style('dhaniya', get_theme_file_uri() . '/style/dhaniya.css');\n // }\n \n}", "function nicdark_shortcodes_load_textdomain()\r\n{\r\n\tload_plugin_textdomain(\"nicdark-shortcodes\", false, dirname(plugin_basename(__FILE__)) . '/languages');\r\n}", "function gs_theme_setup() {\r\n\r\n\t/**\r\n\t * Load the theme functions library\r\n\t */\r\n\trequire_once('inc/library.php');\r\n\r\n\t/**\r\n\t * Load custom post types\r\n\t */\r\n\trequire_once('inc/cpt.slides.php'); \r\n\r\n\t/**\r\n\t * Load custom widgets\r\n\t */\r\n\trequire_once('inc/widget.feature-box/widget.feature-box.php'); \r\n\trequire_once('inc/widget.gs-recent-posts/widget.gs-recent-posts.php'); \r\n\r\n\t/**\r\n\t * Load custom admin features\r\n\t */\r\n\trequire_once('inc/admin/admin-branding.php'); \r\n\trequire_once('inc/admin/admin-menu.php'); \r\n\trequire_once('inc/admin/dashboard.recent-drafts.php'); \r\n\trequire_once('inc/admin/remove-dashboard-widgets.php'); \r\n\trequire_once('inc/admin/remove-default-widgets.php'); \r\n\trequire_once('inc/admin/tinymce-editor.php'); \r\n\trequire_once('inc/admin/user-capabilities.php'); \r\n\r\n \t/**\r\n * Removes WordPress version number from the document head (for security).\r\n\t *\r\n */\t\r\n\tremove_action('wp_head', 'wp_generator');\r\n\r\n \t/**\r\n * Registers theme menus.\r\n */\t\r\n\tregister_nav_menu('main', 'Main Navigation Menu');\r\n\t//register_nav_menu('Your Menu Name', 'Your Menu Description');\r\n\r\n \t/**\r\n * Registers thumbnail and featured image sizes.\r\n */\t\r\n\tadd_theme_support( 'post-thumbnails' );\r\n\tset_post_thumbnail_size( 150, 150, true ); // Normal post thumbnails\r\n\tadd_image_size( 'slide', 960, 300, true );\r\n\t//add_image_size( 'custom-thumb-name', 150, 150, true ); \r\n\r\n}", "function microsite_setup() {\n add_theme_support( 'title-tag' );\n\n //agregando la imagen destacada para un post\n add_theme_support('post-thumbnails');\n\n //soporte para personalizar el logotipo del sitio\n add_theme_support( 'custom-logo' );\n\n //soporte para imagen de fondo del tema\n add_theme_support( 'custom-background' );\n\n //soporte para imagen del heroe/header\n add_theme_support( 'custom-header' );\n }", "function rusticmodern_setup() {\n\n\t// This theme styles the visual editor with editor-style.css to match the theme style.\n\tadd_editor_style();\n\n\t// Post Format support. You can also use the legacy \"gallery\" or \"asides\" (note the plural) categories.\n\tadd_theme_support( 'post-formats', array( 'aside', 'gallery' ) );\n\n\t// This theme uses post thumbnails\n\tadd_theme_support( 'post-thumbnails' );\n\n\t// Add default posts and comments RSS feed links to head\n\tadd_theme_support( 'automatic-feed-links' );\n\n\t/*\n\t * Make theme available for translation.\n\t * Translations can be filed in the /languages/ directory\n\t */\n\tload_theme_textdomain( 'rusticmodern', get_template_directory() . '/languages' );\n\n\t/*\n\t * Let WordPress manage the document title.\n\t * By adding theme support, we declare that this theme does not use a\n\t * hard-coded <title> tag in the document head, and expect WordPress to\n\t * provide it for us.\n\t */\n\tadd_theme_support( 'title-tag' );\n\n\t// This theme uses wp_nav_menu() in one location.\n\tregister_nav_menus( array(\n\t\t'primary' => __( 'Primary Navigation', 'rusticmodern' ),\n\t\t'footer' => __( 'Footer Navigation', 'rusticmodern' ),\n\t) );\n\n\t// This theme allows users to set a custom background.\n\tadd_theme_support( 'custom-background', array(\n\t\t// Let WordPress know what our default background color is.\n\t\t'default-color' => 'f1f1f1',\n\t) );\n\n\n\n\n\n\tadd_image_size( 'rusticmodern-medium', 550, 550, true );\n\n}", "function pu_theme_menu()\n{\n add_theme_page( 'Theme Option', 'Edycja danych motywu', 'manage_options', 'pu_theme_options.php', 'pu_theme_page'); \n}" ]
[ "0.6991671", "0.6966877", "0.6913092", "0.6771859", "0.67608917", "0.6721401", "0.6555129", "0.6499211", "0.6468201", "0.6460197", "0.6395117", "0.6385336", "0.63603663", "0.6344462", "0.63347316", "0.6331872", "0.6320001", "0.6311932", "0.6295982", "0.629503", "0.62888885", "0.6274487", "0.62709486", "0.6266794", "0.62652797", "0.6263295", "0.62603194", "0.6255233", "0.62538075", "0.6246097", "0.62450665", "0.62366384", "0.622847", "0.62244475", "0.62158155", "0.62092674", "0.6206475", "0.6204443", "0.6198108", "0.6195927", "0.6180132", "0.6168547", "0.616773", "0.6166261", "0.61616784", "0.6155344", "0.6151593", "0.61495423", "0.6149335", "0.6139951", "0.61387616", "0.6136532", "0.6131013", "0.6114691", "0.6111399", "0.61054695", "0.6104763", "0.61010873", "0.6099971", "0.6099694", "0.60951555", "0.60948163", "0.60929185", "0.60923845", "0.60838765", "0.608332", "0.6076682", "0.6074221", "0.607155", "0.6070844", "0.6070252", "0.6068904", "0.6065957", "0.60619247", "0.6057166", "0.60562897", "0.60556126", "0.6054364", "0.6050281", "0.6049926", "0.6048126", "0.60451806", "0.6042579", "0.6042212", "0.60421467", "0.60414386", "0.604117", "0.604085", "0.6039958", "0.6033688", "0.60265946", "0.602258", "0.6018614", "0.60124326", "0.60123193", "0.6009162", "0.6005822", "0.6005485", "0.6005267", "0.5998292" ]
0.6481885
8
/ dependencias cargar css js
function assets() { /* Registro de estilos de depeendencias */ wp_register_style('boostrap','https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css', '', '5.0.1', 'all'); wp_register_style('font_primary', 'https://fonts.googleapis.com/css2?family=Montserrat&display=swap', '', '1.0', 'all'); /* Cargar las depencias de css */ wp_enqueue_style( 'stylesAll', get_stylesheet_uri(), array('boostrap', 'font_primary'), '1.0', 'all' ); /* true: que se ejecute en el footer */ wp_register_script( 'validate', plugins_url( '/validate.js', __FILE__ ), array( 'jquery' ) ); wp_enqueue_script('validate'); wp_register_script('popper', 'https://cdn.jsdelivr.net/npm/@popperjs/core@2.6.0/dist/umd/popper.min.js', '', '1.16.0', true); wp_enqueue_script('b5','https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.min.js', array('popper'), '1.0', true ); wp_enqueue_script('custom', get_template_directory_uri().'/assets/js/custom.js', '', '1.0', true ); /* enviar informacion de js a una funcions, uso de apirest */ wp_localize_script('custom', 'ajar', array( 'ajaxurl' => admin_url('admin-ajax.php'), 'apiurl' => home_url('wp-json/ajar/v1/'), )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dt_testimonial_simple_loadCssAndJs() {\n wp_register_style( 'dt_extend_style', plugins_url('assets/droit-wbpakery-addons.css', __FILE__) );\n }", "protected function loadCss() {}", "function load_js_css() {\n\n\t\t\twp_register_script( 'fontawesome-all', get_stylesheet_directory_uri() . '/js/fontawesome-all.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'owl', get_stylesheet_directory_uri() . '/js/owl.carousel.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'selectric', get_stylesheet_directory_uri() . '/js/jquery.selectric.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'select', get_stylesheet_directory_uri() . '/js/select.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'jquery-ui', get_stylesheet_directory_uri() . '/js/jquery-ui.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'tab_menu', get_stylesheet_directory_uri() . '/js/tab_menu.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'aos', get_stylesheet_directory_uri() . '/js/aos.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'rangeslider', get_stylesheet_directory_uri() . '/js/rangeslider.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'bootstrap', get_stylesheet_directory_uri() . '/js/bootstrap.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'easymap', get_stylesheet_directory_uri() . '/js/easymap.plugin.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'markerclusterer', get_stylesheet_directory_uri() . '/js/markerclusterer.min.js', array(), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'customscrollbar', get_stylesheet_directory_uri() . '/js/jquery.mCustomScrollbar.concat.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'ddslick', get_stylesheet_directory_uri() . '/js/jquery.ddslick.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\t\t\twp_register_script( 'project045-main', get_stylesheet_directory_uri() . '/js/main.min.js', array( 'jquery' ), Project045_Definitions::$scripts_version, true );\n\n\t\t\twp_enqueue_script( 'fontawesome-all' );\n\t\t\twp_enqueue_script( 'owl' );\n\t\t\twp_enqueue_script( 'selectric' );\n\t\t\twp_enqueue_script( 'select' );\n\t\t\twp_enqueue_script( 'jquery-ui' );\n\t\t\twp_enqueue_script( 'tab_menu' );\n\t\t\twp_enqueue_script( 'aos' );\n\t\t\twp_enqueue_script( 'rangeslider' );\n\t\t\twp_enqueue_script( 'bootstrap' );\n\t\t\twp_enqueue_script( 'easymap' );\n\t\t\twp_enqueue_script( 'markerclusterer' );\n\t\t\twp_enqueue_script( 'customscrollbar' );\n\t\t\twp_enqueue_script( 'ddslick' );\n\t\t\twp_enqueue_script( 'project045-main' );\n\n\t\t}", "protected function addSystemCssJs()\n\t{\n\t\tglobal $cWebPath;\n\t\t\t\t\n\t\t$this->mStyles[] = $cWebPath . '/style/mainstyle.css';\n\t\t$this->mStyles[] = $cWebPath . '/style/svwp_style.css';\n\t\t\n\t\t$this->mScripts[] = $cWebPath . '/scripts/jquery.slideViewerPro.1.5.js';\n\t\t$this->mScripts[] = $cWebPath . '/scripts/jquery.timers-1.2.js';\n\t\t$this->mScripts[] = $cWebPath . '/scripts/imageslider.js';\n\t}", "public function dt_icon_list_loadCssAndJs() {\n wp_register_style( 'dt_extend_style', plugins_url('assets/droit-wbpakery-addons.css', __FILE__) );\n // If you need any javascript files on front end, here is how you can load them.\n //wp_enqueue_script( 'droit-wbpakery-addons_js', plugins_url('assets/droit-wbpakery-addons.js', __FILE__), array('jquery') );\n }", "private function _initJsCss(){\n\t\t$cs = Yii::app()->clientScript;\n\t\t$cs->registerCssFile(Yii::app()->baseUrl . '/css/admin/admin.css');\n\n\t}", "public function loadScripts() {\n $graphcss = $this->getProperty('graphcss');\n $customcss = $this->getProperty('customcss');\n $loadjquery = $this->getProperty('loadjquery');\n\n $cssUrl = $this->sekug->config['cssUrl'].'web/';\n $jsUrl = $this->sekug->config['jsUrl'].'web/';\n\n if($loadjquery == 1){\n $this->modx->regClientStartupScript($jsUrl.'libs/'.$this->sekug->config['jqueryFile']);\n }\n if($customcss>''){\n $this->modx->regClientCSS($this->modx->getOption('assets_url').$customcss);\n } else {\n $this->modx->regClientCSS($cssUrl.'gallery.structure.css');\n }\n if($graphcss>''){\n $this->modx->regClientCSS($this->modx->getOption('assets_url').$graphcss);\n } else {\n $this->modx->regClientCSS($cssUrl.'directory.graph.css');\n }\n }", "public function js_css_public(){\n\n wp_enqueue_style('asRange', plugin_dir_url(__FILE__). 'libs/assets/css/asRange.min.css', false, $this->version());\n wp_enqueue_style('select2', plugin_dir_url(__FILE__). 'libs/assets/css/select2.min.css', false, $this->version());\n wp_enqueue_style('flatpickr', plugin_dir_url(__FILE__). 'libs/assets/css/flatpickr.min.css', false, $this->version());\n wp_enqueue_style('metform-ui', plugin_dir_url(__FILE__). 'libs/assets/css/metform-ui.css', false, $this->version());\n wp_enqueue_style('font-awesome', plugin_dir_url(__FILE__). 'libs/assets/css/font-awesome.min.css', false, $this->version());\n wp_enqueue_style('metform-style', plugin_dir_url(__FILE__). 'libs/assets/css/style.css', false, $this->version());\n \n wp_enqueue_script('asRange', plugin_dir_url(__FILE__) . 'libs/assets/js/jquery-asRange.min.js', array(), $this->version(), true);\n wp_enqueue_script('select2', plugin_dir_url(__FILE__) . 'libs/assets/js/select2.min.js', array(), $this->version(), true);\n wp_enqueue_script('flatpickr', plugin_dir_url(__FILE__) . 'libs/assets/js/flatpickr.js', array(), $this->version(), true);\n \n wp_register_script('recaptcha', 'https://www.google.com/recaptcha/api.js?onload=onloadMetFormCallback&render=explicit', array(), $this->version(), true);\n wp_enqueue_script('metform-submission', plugin_dir_url(__FILE__) . 'libs/assets/js/submission.js', array(), $this->version(), true);\n \n\n }", "function excalibur_css_js() {\n\tglobal $wp_styles;\n\t\t// register main stylesheet\n\t\twp_register_style('excalibur-stylesheet', get_stylesheet_directory_uri() . '/assets/css/styles.css', array(), '', 'all');\n\t\t\n\t\twp_enqueue_style( 'excalibur-stylesheet' );\n}", "function perusecretland_css_js() {\n wp_enqueue_style( 'perusecretland-fonts', get_stylesheet_directory_uri() . '/css/fonts.css');\n wp_enqueue_style( 'perusecretland-responsive', get_stylesheet_directory_uri() . '/css/responsive.css');\n wp_enqueue_style( 'jquery-chosen', get_stylesheet_directory_uri() . '/css/chosen.min.css');\n wp_enqueue_script( 'perusecretland-easing', get_stylesheet_directory_uri() . '/js/jquery.easing.1.3.js', array('jquery'));\n wp_enqueue_script( 'jquery-chosen', get_stylesheet_directory_uri() . '/js/chosen.jquery.min.js', array('jquery'));\n wp_enqueue_script( 'perusecretland-scripts', get_stylesheet_directory_uri() . '/js/scripts.js', array('jquery'));\n wp_enqueue_script( 'perusecretland-footer-scripts', get_stylesheet_directory_uri() . '/js/footer.scripts.js', array('jquery', 'jquery-chosen'), false, true );\n }", "function kmz_gr_css_js(){\n wp_enqueue_style('kmz_gr_style', plugin_dir_url(__FILE__) . 'css/style.css');\n wp_enqueue_script('kmz_gr_script', plugin_dir_url(__FILE__) . 'js/script.js', array('jquery'), '0.0.1', true);\n}", "public function css() {\r\n\t\tif ($this->cssLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.BASE_REQUEST.'/default/skin/'.pzk_app()->name.'/css/'.$this->cssLink.'.css\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page())\r\n\t\t\t\t\t$page->addObjCss($this->cssLink);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tif ($this->cssExternalLink != false) {\r\n\t\t\tif($this->scriptTo) {\r\n\t\t\t\t$elem = pzk_element($this->scriptTo);\r\n\t\t\t\t$elem->append(pzk_parse('<html.css src=\"'.$this->cssExternalLink.'\" />'));\r\n\t\t\t} else {\r\n\t\t\t\tif($page = pzk_page()) {\r\n\t\t\t\t\t$page->addExternalCss($this->cssExternalLink);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}", "public function frontEndStyleScripts(): void\n {\n wp_enqueue_style('users-data-bootstrap', plugin_dir_url(dirname(__FILE__)) . 'assets/css/bootstrap.min.css', [], UsersListing::getVersion());\n wp_enqueue_style('users-data-fontawsome', plugin_dir_url(dirname(__FILE__)) . 'assets/css/font-awesome.min.css', [], UsersListing::getVersion());\n wp_enqueue_style('users-data-styles', plugin_dir_url(dirname(__FILE__)) . 'assets/css/users-data.css', [], UsersListing::getVersion());\n //\n wp_enqueue_script('jquery-min', plugin_dir_url(dirname(__FILE__)) . 'assets/js/jquery.min.js', ['jquery'], UsersListing::getVersion(), false);\n wp_enqueue_script('jquery-popper', plugin_dir_url(dirname(__FILE__)) . 'assets/js/popper.min.js', ['jquery'], UsersListing::getVersion(), false);\n wp_enqueue_script('bootstrap-min', plugin_dir_url(dirname(__FILE__)) . 'assets/js/bootstrap.min.js', ['jquery'], UsersListing::getVersion(), false);\n }", "function add_css_js()\n\t{\n\t\tif (!defined('CSS_JS_PARSED'))\n\t\t{\n\t\t\tdefine('CSS_JS_PARSED', true);\n\t\t}\n\n\t\t// Include custom CSS from templates/CURRENT_TPL folder\n\t\tif(is_array($this->css_style_include) && !empty($this->css_style_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->css_style_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('css_style_include', array(\n\t\t\t\t\t'CSS_FILE' => $this->css_style_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Include custom CSS from templates/common folder\n\t\tif(is_array($this->css_include) && !empty($this->css_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->css_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('css_include', array(\n\t\t\t\t\t'CSS_FILE' => $this->css_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Include custom JS from templates/common folder\n\t\tif(is_array($this->js_include) && !empty($this->js_include))\n\t\t{\n\t\t\tfor ($i = 0; $i < sizeof($this->js_include); $i++)\n\t\t\t{\n\t\t\t\t$this->assign_block_vars('js_include', array(\n\t\t\t\t\t'JS_FILE' => $this->js_include[$i],\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "private static function defCssLoader() {\n\n\t\t$loadedResources = Yii::app()->user->getState('nlsLoadedResources');\n\t\tif (!isset($loadedResources))\n\t\t\t$loadedResources = array();\t\t\n\t\t\n\t\t$hk = '__defCssLoader';\n\t\t$inCache = isset($loadedResources[$hk]);\n\n\t\tif ($inCache)\n\t\t\treturn '';\n\t\n\t\t$loadedResources[$hk] = $hk;\n\t\tYii::app()->user->setState('nlsLoadedResources', $loadedResources);\n\n\t\treturn CHtml::script('\n//css loader\n__loadCss = function(f, media) {\n\tvar a = document.createElement(\"link\");\n\ta.rel=\"stylesheet\";\n\ta.type=\"text/css\";\n\ta.media=media||\"screen\";\n\ta.href=f;\n\t(document.getElementsByTagName(\"head\"))[0].appendChild(a);\n};\n');\n\t\t\t\n\t}", "function onemax_vc_js_css()\n{\n if (!is_admin()) {\n wp_enqueue_style('onemax-interactive', ONEMAX_URI.'/css/interactive.css');\n wp_enqueue_script('onemax-aos', ONEMAX_URI.'/js/library/aos.js');\n wp_enqueue_script('onemax-owl-carousel', ONEMAX_URI.'/js/component/portfolio_carousel/owl.carousel.js');\n wp_enqueue_script('onemax-image-setting', ONEMAX_URI.'/js/component/image/image.js');\n wp_enqueue_script('onemax-conter', ONEMAX_URI.'/js/component/counters/conter.js', '', '', true);\n }\n}", "public function init()\n{\n//'assets/js/cssrefresh.js'\n// ];\n parent::init();\n}", "function loadJSCSS() {\n\tif (!is_admin()) {\n\t\twp_enqueue_script( 'jquery' );\n\t\n\t// Load Theme Options\n\t\t$themeoptions = array_merge(get_option(\"tb_longwave_theme_general_options\"),get_option(\"tb_longwave_theme_header_options\"));\t\n\t\t\n\t\n\t// Enqueue the Theme Styles\n\n\t\t \n\t\t//Basic \n\t\twp_enqueue_style( 'tb_base_style',get_stylesheet_directory_uri().'/style.css');\n\t\t\n\t\t//Responsive?\n\t\tif(isset($themeoptions[\"tb_longwave_responsive_active\"])){\n\t\t\twp_enqueue_style( 'tb_mediaquery_style',T_CSS.'/media-queries.css');\n\t\t}\n\t\t\n\n\t\t//Google Font\n\t\t$google_font = $themeoptions[\"tb_longwave_main_font\"];\n\t if(!empty($google_font)) wp_enqueue_style( 'tb_googlefont_style',$google_font);\n\t \n\t //Fontello Icons\n\t wp_enqueue_style( 'tb_fontello_style',T_TYPE.'/fontello.css');\n\t \n\t //Main Color Style\n\t\tif(!empty($themeoptions[\"tb_longwave_main_style\"])) wp_enqueue_style( 'tb_longwave_main_style',T_CSS.\"/\".$themeoptions[\"tb_longwave_main_style\"].\".css\");\n\t\t \n\t \n\t// Enqueue the Theme JS \n\t\t\n\t\t//Navigation\n\t\twp_enqueue_script('tb_ddsmoothmenu_script', T_JS.\"/ddsmoothmenu.js\", array('jquery'),false,true);\n\t\twp_enqueue_script('tb_selectnav_script', T_JS.\"/selectnav.js\", array('jquery'),false,true);\n\t\t\n\t\t//Basics\n\t\twp_enqueue_script('tb_easytabs_script', T_JS.\"/jquery.easytabs.min.js\", array('jquery'),false,true);\n\t\twp_enqueue_script('tb_hoverdir_script', T_JS.\"/jquery.hoverdir.min.js\", array('jquery'),false,true);\n\t\twp_enqueue_script('tb_isotope_script', T_JS.\"/jquery.isotope.min.js\", array('jquery'),false,true);\n\t\twp_enqueue_script('tb_twitter_script', T_JS.\"/twitter.min.js\", array('jquery'),false,true);\n\t\twp_enqueue_script('tb_fitvids_script', T_JS.\"/jquery.fitvids.js\", array('jquery'),false,true);\n\t\twp_enqueue_script('tb_jribble_script', T_JS.\"/jquery.jribbble-0.11.0.ugly.js\", array('jquery'),false,true);\t\t\n\t\twp_enqueue_script('tb_sharrre_script', T_JS.\"/jquery.sharrre-1.3.3.php\", array('jquery'),false,true);\t\t\n\t\twp_enqueue_script('tb_portfolio_script', T_JS.\"/jquery.sliderportfolio.js\", array('jquery'),false,true);\n\t\twp_enqueue_script('tb_retina_script', T_JS.\"/retina.js\", array('jquery'),false,true);\t\n\t\t\t\t\t\n\t\t//Main Script\n\t\twp_enqueue_script('tb_longwave_script', T_JS.\"/scripts.js\", array('jquery'),false,true);\n\t\t\n\t\t//Comments\n\t\tif(is_singular() && get_option(\"thread_comments\")) wp_enqueue_script(\"comment-reply\");\n\t\t\n\t}\n}", "function wiki_api_import_css() {\n\twp_enqueue_style('style-name', get_stylesheet_uri());\n\twp_enqueue_script('script-name', get_template_directory_uri() . '/js/example.js', array(), '1.0.0', true);\n}", "public function loadConfigAssets()\r\n {\r\n $this->app->document->addScript('elements:imagebox/assets/js/myimage.js');\r\n $this->app->document->addStylesheet('elements:imagebox/assets/css/editoption.css');\r\n $this->app->document->addScript('elements:imagebox/assets/js/myoption.js');\r\n $this->app->document->addStylesheet('elements:option/option.css');\r\n }", "public function enqueue_css_js() {\n\t\twp_enqueue_style('wp-pointer');\n\t\twp_enqueue_script('wp-pointer');\n\t}", "function add_js() {\n // È possibile aggiungere un file js presente nella cartella del tema\n wp_register_script('main_js', get_template_directory_uri() . '/js/main.js', array('jquery'), null, true);\n wp_enqueue_script('main_js');\n\n // È possibile aggiungere un url remoto (es. CDN)\n // wp_register_script('select2', 'https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.5/js/select2.min.js', array('jquery'), null, true);\n // wp_enqueue_script('select2');\n\n // Inoltre è possibile aggiungere un css solo se una determinata condizione è vera\n // In questo esempio aggiungiamo il file home.css solo se ci troviamo sulla pagina di home\n // if(is_home()) {\n // wp_register_script('home_js', get_template_directory_uri() . '/js/home.js', array('jquery'), null, true);\n // wp_enqueue_script('home_js');\n // }\n}", "public function add_scripts_and_styles()\n {\n // Estilos css \n wp_register_style( 'wiAjustesStyles', WI_PLUGIN_URL . '/style.css', null, WI_VERSION );\n wp_enqueue_style( 'wiAjustesStyles' );\n\n // Scripts de javascript\n wp_enqueue_script('wiAjustesStylesJs', WI_PLUGIN_URL . '/script.js' , array('jquery'));\n }", "function init() {\r\n $this->load_upcss();\r\n }", "private function load_css () {\n $buffer = '';\n if (count($this->css_files)) {\n foreach ($this->css_files as $file) {\n $file = explode('/', $file);\n // TODO: use $this->config->item('modules_locations') for modules path\n $file = 'application/modules/'.$file[0].'/views/'.$this->get_skin().'/skin/'.implode('/',array_slice($file, 1));\n $buffer .= \"\\n\".'<link rel=\"stylesheet\" href=\"'.base_url($file).'\">';\n }\n return $buffer.\"\\n\";\n } else {\n return \"\\n\";\n }\n }", "public function loadCss()\n {\n wp_register_style(\n 'fortytwo_two_factor_style_intl',\n plugin_dir_url(__FILE__) . '../Css/intlTelInput.css',\n false,\n '1.0.0'\n );\n wp_register_style(\n 'fortytwo_two_factor_style_plugin',\n plugin_dir_url(__FILE__) . '../Css/plugin.css',\n false,\n '1.0.0'\n );\n wp_enqueue_style('fortytwo_two_factor_style_intl');\n wp_enqueue_style('fortytwo_two_factor_style_plugin');\n }", "static function include_scripts(){\n\t\t//self::include_css();\n\t\tself::include_js();\n\t}", "public function wcufd_load_styles_scripts() {\n //main script file of the plugin\n wp_register_script( 'wcufd-front-end-js', plugins_url( 'js/wcufd-script.js',__FILE__ ), array('jquery'), '', true );\n wp_localize_script( 'wcufd-front-end-js', 'wcufd_vars', array(\n 'ajaxurl' => admin_url('admin-ajax.php'),\n 'current_user_can' => current_user_can('administrator')\n )\n );\n wp_register_style( 'wcufd-front-end-style', plugins_url( 'css/wcufd-style.css',__FILE__ ) );\n }", "public function build_css() {\n\t\t\t\n\t\t}", "function add_style_script(){\r\n wp_enqueue_style('glv-style', plugins_url(\"GLV-Prospectos/admin/include/css/\").'glv-style.css');\r\n wp_enqueue_style('select2-style', plugins_url(\"GLV-Prospectos/admin/include/css/\").'select2.css');\r\n wp_enqueue_script('select-script', plugins_url(\"GLV-Prospectos/admin/include/js/\").'select2.js');\r\n wp_enqueue_script('glv-script', plugins_url(\"GLV-Prospectos/admin/include/js/\").'function.js');\r\n \r\n }", "function barjeel_css_loader() {\n\n wp_enqueue_style('barjeel', get_template_directory_uri().'/stylesheets/barjeel.css', false ,'0.90', 'all' );\n\n if (ICL_LANGUAGE_CODE == \"ar\") {\n\t wp_enqueue_style('barjeel-ar', get_template_directory_uri().'/stylesheets/barjeel-rtl.css', false ,'0.90', 'all' );\n\t}\n\n }", "function XT_load_css($params){\n if($params['media'] == \"\"){\n $params['media']= \"screen\";\n }\n if(empty($params['file'])) {\n return false;\n } else {\n if(empty($GLOBALS['loadedcss'][$params['file']])){\n // js ausgeben und als geladen merken\n $GLOBALS['loadedcss'][$params['file']] = '<link rel=\"stylesheet\" type=\"text/css\" href=\"' . STYLES_DIR . 'live/' . $params['file'] . '\" media=\"' . $params['media'] . '\" />';\n return NULL;\n }else{\n return false;\n }\n }\n}", "function assets(){\n\t\t\twp_enqueue_style( 'sp-2020-styles', get_template_directory_uri() .'/assets/css/main.css', array(), SPUTZNIK_2020_THEME_VERSION );\n\t\t\twp_enqueue_script( 'sp-2020-js', get_template_directory_uri() . '/assets/js/main.js', array('jquery'), SPUTZNIK_2020_THEME_VERSION, true );\n\n\t\t}", "protected function renderJavaScriptAndCss() {}", "function cap_vc_extend_js_css() {\n //wp_enqueue_style( 'cap_vc_extend_style' );\n // If you need any javascript files on front end, here is how you can load them.\n //wp_enqueue_script( 'cap_vc_extend_js', plugins_url('cap_vc_extend.js', __FILE__), array('jquery') );\n}", "function upcode_loadCSS(){\n\t$css = get_template_directory_uri() . '/assets/css/';\n\twp_enqueue_style( 'offcanvas', \t\t\t$css . '_bootstrap.offcanvas.css' );\n\twp_enqueue_style( 'fancybox', \t\t\t'//cdn.rawgit.com/fancyapps/fancybox/60c37246/dist/jquery.fancybox.min.css' );\n\twp_enqueue_style( 'slick', \t\t\t\t\t'//cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.7.1/slick.min.css' );\n\twp_enqueue_style( 'slick-theme', \t\t'//cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.7.1/slick-theme.min.css' );\n\twp_enqueue_style( 'slick-loader', \t'//cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.7.1/ajax-loader.gif' );\n\twp_enqueue_style( 'awesome', \t\t\t\t'//use.fontawesome.com/releases/v5.0.6/css/all.css' );\n}", "private function _addCss() {\r\n JHtml::styleSheet( Sh404sefHelperGeneral::getComponentUrl() . '/assets/css/list.css');\r\n }", "public function init()\n\t{\n//\t\t$this->js[] = YII_DEBUG ? 'js/jquery.Jcrop.js' : 'js/jquery.Jcrop.min.js';\n $this->css[]=\"css/imgareaselect-animated.css\";\n $this->css[]=\"css/imagestyle.css\";\n\n $this->js[]=\"js/script.js\";\n $this->js[]=\"js/jquery.imgareaselect.pack.js\";\n $this->js[]=\"//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\";\n \n \n // $this->js[]=\"js/myjs.js\";\n \n\t\n\t}", "static function enqueue_scripts(){\n\t\tself::include_css();\n\t\tself::include_js();\n\t}", "function allLoadJs($path){\n \n $diretorio = dir($path);\n\n while($arquivo = $diretorio -> read()){\n //verifica apenas as extenções do css \n if(strpos($arquivo, '.js')!==FALSE)\n echo (\"<script src='\".BARRA.url_base.BARRA.$path.$arquivo.\"' type='text/javascript'></script>\\n\");\n }\n $diretorio -> close();\n\n }", "function cjpopups_frontend_scripts(){\n\t$wp_version = get_bloginfo('version');\n\t$item_version = cjpopups_item_info('item_version');\n\tif(!is_admin()){\n\t\twp_register_style( 'cj-frontend-css', cjpopups_item_path('framework_url').'/assets/frontend/css/cj-global.css', null, $item_version, 'screen' );\n\t\twp_enqueue_style( 'cj-frontend-css' );\n\t}\n}", "function wpcom_referral_footer_admin_css_js() { \n\t\twp_enqueue_script( 'scripts', plugins_url( 'scripts.js', __FILE__ ), array( 'jquery', 'wp-color-picker' ), '', true );\n\t\twp_enqueue_style( 'wp-color-picker' );\n\t}", "function cssAndJs() {\r\n\t\t$siteurl = get_bloginfo('wpurl');\r\n\t\t// include css in any case. e.g. for widget\r\n\t\tprint '<link rel=\"stylesheet\" type=\"text/css\" href=\"'.$siteurl.'/wp-content/plugins/uwr1results/uwr1results.css\" />'.\"\\n\";\r\n\t\tif (!defined('IS_UWR1RESULTS_VIEW')) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$siteurlPath = substr($siteurl, strlen('http://'.$_SERVER['HTTP_HOST']));\r\n\t\tif ('/' != $siteurlPath{0}) {\r\n\t\t\t$siteurlPath = '/'.$siteurlPath;\r\n\t\t}\r\n\t\t//print '<script type=\"text/javascript\" src=\"'.$siteurl.'/wp-content/plugins/uwr1results/uwr1results.js.php?siteurl='.urlencode($siteurlPath)./*($https?'ssl=1':'').*/'\"></script>'.\"\\n\";\r\n\t}", "function hugomitoire_scripts() {\n wp_enqueue_style( 'appStyles', get_template_directory_uri() . '/dist/css/style.min.css' );\n wp_enqueue_script( 'Js', get_template_directory_uri() . '/dist/js/all.js', array(), '1.0.0', true );\n wp_enqueue_script( 'Swiper', get_template_directory_uri() . '/dis/js/all.js', array(), '4.4.2', true);\n}", "function cs_style_and_scripts() {\n \n\t\twp_enqueue_style( 'bootstrap-css', get_stylesheet_directory_uri() .'/public/css/vendor.css' );\n\t\twp_enqueue_style( 'bootstrap-css', get_stylesheet_directory_uri() .'/public/css/app.css' );\n wp_enqueue_style( 'main-css', get_stylesheet_uri() );\n\n /*wp_enqueue_script( 'myscripts', get_stylesheet_directory_uri() . '/assets/js/app.js', '', '1.0.0', true );\n wp_localize_script('myscripts', 'cs_obj', array(\n 'ajax_url' => admin_url('admin-ajax.php'),\n ));*/\n\n }", "function chroma_load_custom_market_css()\n{\n \n wp_enqueue_style (\n 'chroma_market_css',\n plugin_dir_url(__DIR__) . '/css/market.css'\n );\n\n \n wp_enqueue_script (\n 'chroma_market_js',\n plugin_dir_url(__DIR__) . '/js/market.js'\n );\n\n\n\n\n}", "private function fn_load_scripts() {\n\n\t\t/**\n\t\t * Load Common CSS and JS for a blank Page\n\t\t */\n\n\t\t$fixed_version = $this->fixed_version;\n\t\t$common_css_version = '0.3';\n\t\t$common_js_version = '0.1';\n\t\t$custom_css_version = '0.4';\n\t\t$custom_js_version = '0.4';\n\n\t\t$registered_styles = $this->registered_css;\n\t\t$registered_scripts = $this->registered_js;\n\n\t\t/**\n\t\t * Load CSS--------------------------------------------------------------\n\t\t */\n\n /** Load Google Fonts */\n\t\t$this->google_fonts['google_opensans'] = $registered_styles['google_opensans'];\n\n\t\t/** Load CSS Assets @todo Move the components in their containers */\n\t\t\n\t\t$this->css_assets['bootstrap'] = $registered_styles['bootstrap'].\"?ver=\".$fixed_version;\n\t\t$this->css_assets['fontawesome'] = $registered_styles['fontawesome'].\"?ver=\".$fixed_version;\n\t\t\n\t\t/**\n\t\t * Load JS--------------------------------------------------------------\n\t\t */\n\t\t\n\t\t/** Load footer js **/\n\t\t$this->footer_js['jquery'] = $registered_scripts['jquery'].\"?ver=\".$fixed_version;\t\t\n\t\t$this->footer_js['jquery-ui'] = $registered_scripts['jquery-ui'].\"?ver=\".$fixed_version;\n\n\t\t$this->footer_js['bootstrap'] = $registered_scripts['bootstrap'].\"?ver=\".$fixed_version;\n\t\t/**let other controllers load their own css/js files **/\n\t}", "function css_files() {\n\t\twp_enqueue_style('escalate_network-admin-global', $this->plugin_url .'/css/styles-admin-global.css');\n\t}", "function nameless_sheep_scripts() {\n\t\t// Get the theme data.\n\t\t$the_theme = wp_get_theme();\n\t\t$theme_version = $the_theme->get( 'Version' );\n\n\t\t$css_version = $theme_version . '.' . filemtime( get_template_directory() . '/css/theme.min.css' );\n\t\twp_enqueue_style( 'nameless_sheep-styles', get_template_directory_uri() . '/css/theme.min.css', array(), $css_version );\n\n\t\twp_enqueue_script( 'jquery' );\n\t}", "function flexiauto_scripts_loader() {\n\t\t/* Load custom styles */\n\t\twp_enqueue_style('reset', TPL_DIR . '/assets/css/vendor/reset.css');\n\t\twp_enqueue_style('bootstrap-styles', TPL_DIR . '/assets/css/vendor/bootstrap.min.css');\n\t\twp_enqueue_style('flexi-styles', TPL_DIR . '/assets/css/flexi.min.css');\n\n\t\t/* Load custom scripts */\n\t\twp_deregister_script('jquery');\n\t\twp_register_script('jquery', TPL_DIR . '/assets/js/vendor/jquery.min.js', array(), false, true);\n\t\twp_enqueue_script('jquery');\n\n\t\twp_enqueue_script('bootstrap-scripts', TPL_DIR . '/assets/js/vendor/bootstrap.min.js', array(), false, true);\n\t\twp_enqueue_script('nicescroll', TPL_DIR . '/assets/js/vendor/jquery.nicescroll.min.js', array(), false, true);\n\t\twp_enqueue_script('jquery-validate', TPL_DIR . '/assets/js/vendor/jquery.validate.min.js', array(), false, true);\n\t\twp_enqueue_script('match-height', TPL_DIR . '/assets/js/vendor/jquery.matchHeight.min.js', array(), false, true);\n\t\twp_enqueue_script('flexi-scripts', TPL_DIR . '/assets/js/flexi.min.js', array(), false, true);\n\n\t}", "public function addDependencies()\n {\n $this->Html->script('/attachments/js/vendor/jquery.ui.widget.js', ['block' => true]);\n $this->Html->script('/attachments/js/vendor/jquery.iframe-transport.js', ['block' => true]);\n $this->Html->script('/attachments/js/vendor/jquery.fileupload.js', ['block' => true]);\n $this->Html->script('/attachments/js/app/lib/AttachmentsWidget.js', ['block' => true]);\n $this->Html->css('/attachments/css/attachments.css', ['block' => true]);\n }", "private function __register_scripts() {\n\t\t// Load all the registered scripts\n\t\t$assets_loader = new SwpmvcAssetsLoader();\n\t\t$assets = $assets_loader->fn_load_scripts();\n\n\t\t//Extract CSS Assets and put them into Registered CSS Container\n\t\t$this->registered_css = $assets[ 'css' ];\n\n\t\t//Extract JS Assets and put them into Registered JS Container\n\t\t$this->registered_js = $assets[ 'js' ];\n\n\t\t//Some cleanup\n\t\tunset($assets_loader);\n\t\tunset($assets);\n\n\t\t//Load all the common CSS and JS which will be required for all the pages.\n\t\t$this->fn_load_scripts();\n\t}", "public function load_admin_scripts_styles(){\n\t\t\n\t}", "protected function _css()\n\t{\n\t\tif ( !self::$_firstRun ) return '';\n\t\tself::$_firstRun = FALSE;\n\n\t\t$dir = KINT_DIR . 'view/' . ( self::$devel ? 'src/' : '' ); // load uncompressed sources if in devel mode\n\n\t\treturn '<script>' . file_get_contents( $dir . 'kint.js' ) . '</script>'\n\t\t\t. '<style>' . file_get_contents( $dir . 'kint.css' ) . '</style>';\n\t}", "function admin_include_scripts() {\n\n\t\t\twp_register_style('wa_wcc_admin',get_template_directory_uri().'/plugin/collapse/assets/css/admin.css');\n\t\t\twp_enqueue_style('wa_wcc_admin');\n\n\t}", "function include_css_js_files()\n{\n\twp_register_style('css_file1','https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css');\n\twp_enqueue_style('css_file1');\n\n\n\twp_register_script('js_file1','https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js');\n\twp_enqueue_script('js_file1');\n\twp_register_script('js_file2','https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.0/umd/popper.min.js');\n\twp_enqueue_script('js_file2');\n\twp_register_script('js_file3','https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js');\n\twp_enqueue_script('js_file3');\n\n}", "function webbusiness_scripts() {\n\twp_enqueue_style('webbusiness-style', get_stylesheet_uri());\n\twp_enqueue_style('webbusiness-framework', get_template_directory_uri() . '/css/framework.css');\n\t$style = get_theme_mod(\"style\");\n\tif (!$style || $style == \"default\") {\n\t\t$style = \"dark\";\n\t}\n\t$wp_customize = \"\";\n\tif (isset($_POST[\"wp_customize\"])) $wp_customize = $_POST[\"wp_customize\"];\n\tif ($wp_customize == \"on\") {\n\t\twp_enqueue_style('webbusiness-color-dynamic', get_template_directory_uri() . '/css/dynamic-css-customizer.php');\n\t} else {\n\t\twebbusiness_save_css();\n\t\t$uploads = wp_upload_dir();\n\t\t$uploads_dir = trailingslashit($uploads[\"basedir\"]);\n\t\t$uploads_path = trailingslashit($uploads[\"baseurl\"]);\n\t\tif (file_exists($uploads_dir . \"webbusiness.css\") /* && !$save_custom_css */) {\n\t\t\twp_enqueue_style('webbusiness-color-dynamic', $uploads_path . \"webbusiness.css\");\n\t\t} else {\n\t\t\twp_enqueue_style('webbusiness-color-dynamic', get_template_directory_uri() . '/css/dynamic-css.php');\n\t\t}\n\t}\n\n\twp_enqueue_style('webbusiness-layout', get_template_directory_uri() . '/css/webbusiness.css');\n\t\n\tif (!get_theme_mod(\"googlefonts_link\")) {\n\t\twp_enqueue_style('webbusiness-googlefonts', \"http://fonts.googleapis.com/css?family=Ubuntu\");\n\t}\n\t\n\twp_enqueue_script('webbusiness-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true);\n\n\twp_enqueue_script('webbusiness-jquery-cycle', get_template_directory_uri() . '/js/jquery.cycle.all.js', array(), '20120206', true);\n\twp_enqueue_script('webbusiness-superfish', get_template_directory_uri() . '/js/superfish.js', array(), '20120206', true);\n\twp_enqueue_script('webbusiness-tinynav', get_template_directory_uri() . '/js/tinynav.min.js', array(), '20120206', true);\n\twp_enqueue_script('webbusiness-script', get_template_directory_uri() . '/js/script.js', array(), '20120206', true);\n\twp_enqueue_script('webbusiness-retina', get_template_directory_uri() . '/js/retina-1.1.0.min.js', array(), '20120206', true);\n\twp_enqueue_script('webbusiness-modernizr', get_template_directory_uri() . '/js/modernizr-2.0.6.min.js', array(), '20120206', false);\n\n\tif (is_singular() && comments_open() && get_option('thread_comments')) {\n\t\twp_enqueue_script('comment-reply');\n\t}\n\n\tif (is_singular() && wp_attachment_is_image()) {\n\t\twp_enqueue_script('webbusiness-keyboard-image-navigation', get_template_directory_uri() . '/js/keyboard-image-navigation.js', array('jquery'), '20120202');\n\t}\n}", "function eventos_carrega_script() {\n\twp_enqueue_style( \"eventos_css\",plugins_url( \"/css/eventos.css\", __FILE__ ));\n\twp_enqueue_style( \"datetimepickerCSS\",plugins_url( \"/css/jquery.datetimepicker.css\", __FILE__ ));\n\twp_enqueue_script( \"datetimepicker\",plugins_url( \"/js/jquery.datetimepicker.js\", __FILE__ ));\n\twp_enqueue_script( \"eventos_scripts\",plugins_url( \"/js/scripts.js\", __FILE__ ));\n}", "public function trad_load_css_and_jss() {\n\t\tif ( ! $this->trad_ioy_shortcodes_activated ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// this tells us if we want to load the .min versions of css and js when available\n\t\t$trad_use_min_js = $this->get_setting( 'trad_use_min_js' );\n\n\t\t// load our plugin-specific css\n\t\tif ( $this->get_setting( 'trad_load_trad_ioy_css' ) ) {\n\t\t\twp_enqueue_style( 'trad-ioy', plugins_url(\n\t\t\t\t'css/stylesheet.css', dirname( __FILE__ ) ) );\n\t\t}\n\n\t\t// load our custom css\n\t\tif ( $this->get_setting( 'trad_ioy_local_css_file' ) ) {\n\t\t\twp_enqueue_style( 'trad-ioy-custom', $this->get_setting( 'trad_ioy_local_css_file' ) );\n\t\t}\n\n\t\tif ( $this->get_setting( 'trad_ioy_local_css' ) ) {\n\t\t\tadd_action( 'wp_head', array( $this, 'trad_ioy_add_custom_css' ) );\n\t\t}\n\t\t// we definitely need jQuery\n\t\twp_enqueue_script( 'jquery' );\n\n\t\tif ( $this->get_setting( 'trad_load_cookie_js' ) ) {\n\t\t\twp_enqueue_script( 'trad-cookie-js', plugins_url(\n\t\t\t\t\t$this->min_or_full( 'js/jquery/jquery.cookie', 'js', false ), dirname( __FILE__ ) ), array( 'jquery' ),\n\t\t\t\tfalse, true );\n\t\t}\n\n\t\tif ( $this->get_setting( 'trad_load_scrollto_js' ) ) {\n\t\t\twp_enqueue_script( 'trad-scrollto-js', plugins_url(\n\t\t\t\t\t$this->min_or_full( 'js/jquery/jquery.scrollTo-1.4.3.1', 'js', $trad_use_min_js ), dirname( __FILE__ ) ),\n\t\t\t\tarray( 'jquery' ), false, true );\n\t\t}\n\n\t\t// add our special javascipt\n\t\tadd_action( 'wp_footer', array( $this, 'trad_ioy_js' ) );\n\t}", "function ft_hook_add_css() {}", "public function load_assets() {\n\t\t\t//only load styles and js when needed\n\t\t\tif ( $this->is_edit_page() ) {\n\t\t\t\t//styles\n\t\t\t\twp_enqueue_style( 'thickbox' );\n\t\t\t\twp_enqueue_style( 'fancybox' );\n\t\t\t\twp_enqueue_style( 'wm-options-panel-white-label' );\n\t\t\t\tif ( ! wm_option( 'branding-panel-logo' ) && ! wm_option( 'branding-panel-no-logo' ) )\n\t\t\t\t\twp_enqueue_style( 'wm-options-panel-branded' );\n\t\t\t\twp_enqueue_style( 'color-picker' );\n\n\t\t\t\t//scripts\n\t\t\t\twp_enqueue_script( 'jquery-ui-core' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-tabs' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-datepicker' );\n\t\t\t\twp_enqueue_script( 'jquery-ui-slider' );\n\t\t\t\twp_enqueue_script( 'thickbox' );\n\t\t\t\twp_enqueue_script( 'fancybox' );\n\t\t\t\twp_enqueue_script( 'wm-options-panel' );\n\t\t\t\twp_enqueue_script( 'color-picker' );\n\t\t\t}\n\t\t}", "function load_dev_styles_scripts() {\n // Theme styles\n wp_enqueue_style( 'themename', CHILD_SS_URI . '/assets/dev/style.css', false, null, 'all' );\n\n // Header Scripts\n wp_enqueue_script( 'header_scripts', CHILD_SS_URI . '/assets/dev/header.js', array(), null, false );\n\n // Footer Scripts\n wp_enqueue_script( 'footer_scripts', CHILD_SS_URI . '/assets/dev/footer.js', array( 'jquery' ), null, true );\n\n // Single Scripts\n if ( is_single() ) {\n wp_enqueue_script( 'single_scripts', CHILD_SS_URI . '/assets/dev/single.js', array( 'jquery' ), null, true );\n }\n}", "private function register_scripts_and_styles()\n\t\t\t{\n\n\t\t\t\tif( is_admin() )\n\t\t\t\t{\n\n\t\t \t\t//$this->load_file('friendly_widgets_admin_js', '/themes/'.THEMENAME.'/admin/js/widgets.js', true);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \n\n\t\t \t\t//$this->load_file('friendly_widgets', '/themes/'.THEMENAME.'/theme_assets/js/widgets.js', true);\n\n\t\t\t\t}\n\n\t\t\t}", "private function register_scripts_and_styles()\n\t\t\t{\n\n\t\t\t\tif( is_admin() )\n\t\t\t\t{\n\n\t\t \t\t//$this->load_file('friendly_widgets_admin_js', '/themes/'.THEMENAME.'/admin/js/widgets.js', true);\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ \n\n\t\t \t\t//$this->load_file('friendly_widgets', '/themes/'.THEMENAME.'/theme_assets/js/widgets.js', true);\n\n\t\t\t\t}\n\n\t\t\t}", "function tn_sh_loadcss() {\n\n wp_enqueue_style('tn_sh_obsidian', plugin_dir_url(__FILE__) . '/lib/highlight/styles/obsidian.css');\n}", "function _barony_base_file_additions() {\n // Add Font Awesome\n drupal_add_js('//use.fontawesome.com/76948938e9.js', 'external');\n // Add Google Fonts\n drupal_add_css('//fonts.googleapis.com/css?family=Uncial+Antiqua|Metamorphous', array('group' => CSS_THEME));\n\n // Custom additions\n drupal_add_js(drupal_get_path('theme', 'barony_base') . '/js/header-movement.js', array('type' => 'file', 'scope' => 'footer'));\n}", "function wpdocs_theme_name_scripts() {\n wp_enqueue_style('pva-style', get_stylesheet_uri());\n wp_enqueue_style('pva-bootstrap', get_stylesheet_directory_uri() . '/css/bootstrap.min.css', array(), '1.0.0', 'all');\n wp_enqueue_script('pva-script', get_template_directory_uri() . '/js/sitescript.js', array(), '1.0.0', true);\n}", "function estilos_scripts() { \n wp_enqueue_style('googlefonts', '//fonts.googleapis.com/css?family=PT+Sans:400,400i,700,700i|Yanone+Kaffeesatz:400,700', array(), '' , 'screen', false);\n wp_enqueue_style('fontawesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css', array(), '' , 'screen', false);\n wp_enqueue_style('layout', get_template_directory_uri() . '/css/layout.css', array(), '', 'all', null);\n\n wp_enqueue_script( 'canvas', get_template_directory_uri() . '/js/canvas.js', array('jquery'), '', true);\n wp_enqueue_script( 'bx', get_template_directory_uri() . '/js/bx.js', array('jquery'), '', true);\n wp_enqueue_script( 'scripts', get_template_directory_uri() . '/js/scripts.js', array('bx'), '', true);\n}", "function load_css() {\n wp_register_style('main', get_template_directory_uri() . '/css/main.css', array(), false, 'all');\n wp_enqueue_style('main');\n }", "protected function loadJavascript() {}", "function escort_files() {\n wp_enqueue_script('adding-js', get_theme_file_uri('/script.js'), array(), false, true );\n wp_register_style('add-bx-css1', get_stylesheet_directory_uri() . '/css/style.css', array(), '1', 'all');\n wp_register_style('add-bx-css2', get_stylesheet_directory_uri() . '/css/bootstrap.css', array(), '1', 'all');\n wp_register_style('add-bx-css3', get_stylesheet_directory_uri() . '/css/flexslider.css', array(), '1', 'all');\n wp_register_style('add-bx-css4', get_stylesheet_directory_uri() . '/css/popuo-box.css', array(), '1', 'all');\n wp_register_style('font-awesome', get_stylesheet_directory_uri() . '/css///netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css', array(), '1', 'all');\n\n /* wp_enqueue_script('add-bx-js1');\n wp_enqueue_script('add-bx-js2');\n wp_enqueue_script('add-bx-js3');\n wp_enqueue_script('add-bx-js4');\n wp_enqueue_script('add-bx-js5');\n wp_enqueue_script('add-bx-js6');*/\n wp_enqueue_style('add-bx-css1');\n wp_enqueue_style('add-bx-css2');\n wp_enqueue_style('add-bx-css3');\n wp_enqueue_style('add-bx-css4');\n wp_enqueue_style('font-awesome');\n}", "function studeon_vc_frontend_scripts() {\n\t\tif (studeon_exists_visual_composer()) {\n\t\t\tif (studeon_is_on(studeon_get_theme_option('debug_mode')) && studeon_get_file_dir('plugins/js_composer/js_composer.css')!='')\n\t\t\t\twp_enqueue_style( 'studeon-js-composer', studeon_get_file_url('plugins/js_composer/js_composer.css'), array(), null );\n\t\t}\n\t}", "public function editor_scripts() {\n\t\tadd_filter( 'script_loader_tag', [ $this, 'editor_scripts_as_a_module' ], 10, 2 );\n\n\t\twp_enqueue_style( 'elementor-editor-style', plugins_url( '/assets/editor.css', __FILE__ ) ); // Editor Style\n\t\t\n\t}", "protected function addAssets(): void\n {\n $this->enqueue('assets/dashifen-2022.js');\n $font1 = $this->enqueue('//fonts.googleapis.com/css2?family=El+Messiri&display=swap');\n $font2 = $this->enqueue('//fonts.googleapis.com/css2?family=Roboto&display=swap');\n $css = $this->enqueue('assets/dashifen-2022.css', [$font1, $font2]);\n \n $dir = trailingslashit($this->getStylesheetDir());\n if (file_exists($dir . 'assets/dashifen-2022-components.css')) {\n $this->enqueue('assets/dashifen-2022-components.css', [$css]);\n }\n }", "public function init()\n {\n $this->_helper->layout->setLayout('layout_admin_geral');\n $this->view->headScript()->appendFile($this->view->baseUrl('dist/js/promocao.js'));\n }", "function wm_customizer_panel_enqueue_assets() {\n $ctime = filemtime( get_template_directory() . '/customizer/css/wm-customizer-panel.css' );\n wp_enqueue_style( 'wm-customizer-panel-css', get_template_directory_uri() . '/customizer/css/wm-customizer-panel.css', array( 'customize-controls' ), $ctime );\n $ctime = filemtime( get_template_directory() . '/customizer/js/wm-customizer-panel.js' );\n wp_enqueue_script( 'wm-customizer-panel-js', get_template_directory_uri() . '/customizer/js/wm-customizer-panel.js', array( 'jquery', 'customize-controls' ), $ctime, true );\n }", "function mgr_add_scripts(){\n wp_enqueue_style('mgr-main-style',plugins_url().'/includes/my-github-repos/css/style.css');\n wp_enqueue_script('mgr-main-script',plugins_url().'/includes/my-github-repos/js/main.js');\n}", "public function loadAssets()\r\n {\r\n $this->app->document->addStylesheet('elements:imagebox/assets/css/edit.css');\r\n return parent::loadAssets();\r\n }", "public function loadAssets() {\r\n\t\tparent::loadAssets();\r\n\t\t$this->app->document->addScript('elements:download/assets/js/download.js');\r\n\t}", "protected function loadJavaScripts() {}", "public function myScripts()\n {\n //wp_register_script('angularjs',plugins_url('bower_components/angular/angular.min.js', __FILE__));\n wp_enqueue_style('grimagecss', plugins_url('style.css', __FILE__));\n //wp_enqueue_script('grimagescripts',plugins_url('/app.js',__FILE__));\n }", "public function css();", "function autodidact_script_enqueue() {\n wp_enqueue_style('customstyle', get_template_directory_uri() . '/css/auto.css', array(), '1.0.0', 'all');\n wp_enqueue_script('customjs', get_template_directory_uri() . '/js/auto.js', array(), '1.0.0', true);\n}", "function tm_regenerate_all_css_js(){\n\t\n\t/* ----- Now regenerating CSS files ----- */\n\t\n\t// Getting all CSS files in /css/ directory.\n\t$css_dir = get_template_directory().'/css/';\n\t$css_files = scandir($css_dir);\n\t\n\t// Fontiocn Library\n\t$ficon_css_dir = get_template_directory().'/css/fonticon-library/';\n\t$ficon_css_list = scandir($ficon_css_dir);\n\t\n\t$css_array = array();\n\t$css_array[get_template_directory().'/style.css'] = get_template_directory().'/style.min.css'; // style.css\n\t$css_array[get_template_directory().'/rtl.css'] = get_template_directory().'/rtl.min.css'; // rtl.css\n\t$css_array[get_template_directory().'/style-login.css'] = get_template_directory().'/style-login.min.css'; // style-login.css\n\t\n\tforeach($css_files as $css){\n\t\tif ($css != \".\" && $css != \"..\" && substr($css, -4)=='.css' && substr($css, -8)!='.min.css' ) {\n\t\t\t$newfileame = str_replace('.css','.min.css',$css);\n\t\t\t$currentfile = $css_dir.$css;\n\t\t\t$newfile = $css_dir.$newfileame;\n\t\t\t$css_array[$currentfile] = $newfile;\n\t\t}\n\t}\n\t\n\tforeach($ficon_css_list as $library){\n\t\tif ($library != \".\" && $library != \"..\" && is_dir($ficon_css_dir.$library) ) {\n\t\t\t$currentfile = $ficon_css_dir.$library.'/css/thememount-'.$library.'.css';\n\t\t\t$newfile = $ficon_css_dir.$library.'/css/thememount-'.$library.'.min.css';\n\t\t\t$css_array[$currentfile] = $newfile;\n\t\t}\n\t}\n\t\n\t// processing all CSS fles\n\ttm_minifier('css',$css_array);\n\t\n\t\n\t\n\t/* ----- Now regenerating JS files ----- */\n\n\t// Getting all JS files in /js/ directory.\n\t$js_dir = get_template_directory().'/js/';\n\t$js_files = scandir($js_dir);\n\t$js_array = array();\n\tforeach($js_files as $js){\n\t\tif ($js != \".\" && $js != \"..\" && substr($js, -3)=='.js' && substr($js, -7)!='.min.js' ) {\n\t\t\t$newfileame = str_replace('.js','.min.js',$js);\n\t\t\t$currentfile = $js_dir.$js;\n\t\t\t$newfile = $js_dir.$newfileame;\n\t\t\t$js_array[$currentfile] = $newfile;\n\t\t}\n\t}\n\t\n\t// Now processing the files\n\ttm_minifier('js',$js_array);\n\t\n\t\n\t\n\t\n}", "function achilles_scripts() {\n\t\n\t//main stylesheet for now\n\twp_enqueue_style('achilles_style', get_template_directory_uri() . '/style.css', false, '1.0');\n\t\n\t//Foundations stylesheet\n\twp_register_style( 'achilles_main', get_template_directory_uri(). '/css/app.css', false, '1.0');\n\t\n\t\n\twp_enqueue_style( 'achilles_main' );\n\t\n\t//Load built in jQuery from WordPress \n\t// @TODO: Load jQuery from CDN or Google\n\twp_enqueue_script( 'jquery' );\n}", "function _s_scripts() {\n\twp_enqueue_style( 'main.css', get_stylesheet_directory_uri() . '/dist/src/style.css', false, '6.9' );\n\twp_enqueue_script( 'main.js', get_stylesheet_directory_uri() . '/dist/main.js', false, false, true );\n}", "function beaver_extender_fe_style_editor_load_scripts() {\n\n\twp_enqueue_style( 'dashicons' );\n\twp_enqueue_style( 'beaver_extender_fe_style_editor_styles' );\n\twp_enqueue_style( 'beaver_extender_jquery_ui_css', '//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/themes/smoothness/jquery-ui.css', false, BBEXT_VERSION, false );\n\twp_enqueue_script( 'jquery-ui-resizable' );\n\twp_enqueue_script( 'beaver_extender_fe_style_editor' );\n\twp_enqueue_script( 'beaver_extender_ace' );\n\twp_enqueue_script( 'beaver_extender_ace_autocomplete' );\n\t\t\n}", "function load_theme_scripts() {\n\n // UCITAJ GOOGLE FONTOVE\n wp_enqueue_style( 'material-icons', 'http://fonts.googleapis.com/icon?family=Material+Icons');\n wp_enqueue_style( 'dosis-font', 'https://fonts.googleapis.com/css?family=Dosis:400,700&subset=latin,latin-ext');\n\n // UCITAJ CSS STILOVE\n // Dodaj Bootstrap 3 CSS >> Bootstrap framework CSS\n wp_enqueue_style( 'materialize', get_template_directory_uri() .'/css/materialize.css');\n\n // Dodaj SWIPER CSS\n wp_enqueue_style( 'swiper', get_template_directory_uri() .'/css/swiper/swiper.min.css');\n\n // Dodaj glavni Style CSS\n wp_enqueue_style( 'xception', get_stylesheet_uri() );\n\n // UCITAJ JAVASKRIPTE\n // Dodaj JQuery 1.11.3 JS\n wp_enqueue_script( 'theme-jquery', 'https://code.jquery.com/jquery-2.1.1.min.js', array(), '', true);\n\n // Dodaj Masonry\n wp_enqueue_script('masonry-js', get_template_directory_uri() .'/js/masonry/masonry.pkgd.min.js', array(),'theme-jquery', true);\n\n // Dodaj Materialize JS\n wp_enqueue_script('materialize-js', get_template_directory_uri() .'/js/materialize/materialize.min.js', array(),'theme-jquery', true);\n\n // Dodaj CLASSIE JS\n wp_enqueue_script( 'classie-js', get_template_directory_uri() .'/js/classie/classie.js', array(), 'theme-jquery', true);\n\n // Dodaj SWIPER JS\n wp_enqueue_script('swiper-js', get_template_directory_uri() .'/js/swiper/swiper.min.js', array(),'theme-jquery', true);\n\n // Add theme JS file\n wp_enqueue_script('xception-js', get_template_directory_uri() .'/js/theme.js', array(),'theme-jquery', true);\n\n }", "function wa_wcc_load_scripts($jquery_true) {\n\n\t\twp_register_style('wa_wcc_mtree_css_file', get_template_directory_uri().'/plugin/collapse/assets/css/mtree.css');\n\t\twp_enqueue_style('wa_wcc_mtree_css_file');\n\n\n\t\tif($this->options['configuration']['load_velocity'] === TRUE) {\n\n\t wp_register_script('wa_wcc_velocity',get_template_directory_uri().'/plugin/collapse/assets/js/jquery.velocity.min.js',array('jquery'),'',($this->options['configuration']['loading_place'] === 'header' ? false : true));\n\t wp_enqueue_script('wa_wcc_velocity'); \n\n\t\t}\n\n\t}", "function wagw_scripts() {\n\t\t$theme = wp_get_theme();\n\t\t$ver = $theme->get( 'Version' );\n\t$themecsspath = get_stylesheet_directory() . '/style.css';\n\t$style_ver = filemtime( $themecsspath );\n\twp_enqueue_style( 'wagw-style', get_stylesheet_uri(),array(),$style_ver );\n\n\twp_enqueue_script( 'wagw-navigation', get_template_directory_uri() . '/js/navigation.js', array(), '20120206', true );\n\n\twp_enqueue_script( 'wagw-skip-link-focus-fix', get_template_directory_uri() . '/js/skip-link-focus-fix.js', array(), '20130115', true );\n\n\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\twp_enqueue_script( 'comment-reply' );\n\t}\n\n\twp_enqueue_script( 'thickbox', true );\n\twp_enqueue_style( 'thickbox' );\n\n\tif ( is_page_template( 'slider-page.php' ) ) {\n\t\twp_enqueue_style( 'flexslider-css', get_stylesheet_directory_uri() . '/flexslider/flexslider.css' );\n\t}\n\n}", "function add_scripts_to_front() {\n $media = get_option('smfn_option_3') ? get_option('smfn_option_3') : \"1023\";\n wp_register_style('smfn-dynamic-css', plugin_dir_url(SMFN_FILE).'assets/css/dynamic.css.php?media=' . $media);\n wp_enqueue_style( 'smfn-dynamic-css');\n wp_enqueue_script('smfn-actions', plugin_dir_url(SMFN_FILE) . 'assets/js/smfnfunctions.js', array(), '1.0.0', true);\n }", "function theme_scripts() {\n wp_enqueue_style('main', CSS . '/main.css');\n wp_enqueue_style('my', CSS . '/my.css');\n wp_enqueue_script('scripts', JS . '/main.js', array('jquery'), null, true);\n }", "function assets() {\n\t\tif ( ! is_admin() ) {\n\t\t\twp_enqueue_style( '_yourthemename-style', get_theme_file_uri( '/dist/css/bundle.css' ), array(), _YOURTHEMENAME_VER );\n\n\t\t\twp_deregister_script( 'jquery' );\n\t\t\twp_enqueue_script( '_yourthemename-scripts', get_theme_file_uri( '/dist/js/bundle.min.js' ), array(), _YOURTHEMENAME_VER, true );\n\t\t}\n\t\tif ( is_singular() && comments_open() && get_option( 'thread_comments' ) ) {\n\t\t\twp_enqueue_script( 'comment-reply' );\n\t\t}\n\t}", "function wpgrade_noversion_css_js( $src ) {\r\n if ( strpos( $src, 'ver=' ) )\r\n $src = remove_query_arg( 'ver', $src );\r\n return $src;\r\n}", "function head_css()\n\t{\n\t\tqa_html_theme_base::head_css();\n\t\t// if if already added widgets have a css file activated\n\t\t$styles = array();\n\t\tforeach ($this->content['widgets'] as $region_key => $regions) {\n\t\t\tforeach ($regions as $template_key => $widgets) {\n\t\t\t\t$position = strtoupper(substr($region_key,0,1) . substr($template_key,0,1) );\n\t\t\t\tforeach ($widgets as $key => $widget) {\n\t\t\t\t\t$widget_name = get_class ($widget);\n\t\t\t\t\t$widget_key = $widget_name.'_'.$position;\n\t\t\t\t\t$file = get_widget_option($widget_key, 'uw_styles');\n\t\t\t\t\t// if file existed then put it into an array to prevent duplications\n\t\t\t\t\tif($file)\n\t\t\t\t\t\t$styles[$widget_name][$file]=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// add styling files to theme\n\t\tif($styles)\n\t\t\tforeach ($styles as $widget_name => $files)\n\t\t\t\tforeach ($files as $file => $verified)\n\t\t\t\t\tif( $file != 'none' )\n\t\t\t\t\t\t$this->output('<link rel=\"stylesheet\" href=\"'.UW_URL.'widgets/'.$widget_name.'/styles/'.$file.'\"/>');\n\t}", "public function get_cssAdmin(){\n \n return BASE_URL.\"wear/\".$this->back.\"/\".\"css/\";\n \n }", "function PluginUpdateIgnoreJsCss() {\n\t\t$this->__construct();\n\t}", "function gymfitness_scripts_styles(){\n //handle= nombre del archivo, debe ser unico, el nombre debe ser relaiconado con lo que se esta cargando\n //src= ruta get_stylesheet_uri()\n //$deps= por el momento arreglo vacio\n //$ver= version\n //$media= de donde se va a cargar esta hoja de estilos\n wp_enqueue_style('normalize', get_template_directory_uri().'/css/normalize.css', array(), '8.0.1');\n \n wp_enqueue_style('slicknavCSS ', get_template_directory_uri().'/css/slicknav.min.css', array(), '1.0.0');\n \n //cargamos la ruta de google fonts con los estilos seleccionados\n wp_enqueue_style('googleFont', 'https://fonts.googleapis.com/css2?family=Berkshire+Swash&family=Germania+One&family=Kumar+One&family=Notable&family=Open+Sans:wght@300&family=Playball&family=Raleway:wght@100&family=Staatliches&display=swap', array(), '1.0.0');\n\n //ligthbox solo lo necesitamos en la galeria\n if(is_page('galeria')):\n wp_enqueue_style('lightboxCSS', get_template_directory_uri().'/css/lightbox.min.css', array(), '2.11.0');\n endif;\n \n //la hoja de estilo principal \n //el array lleva una dependencia, es decir, que necesita del archivo normalize para cargar nuestro estilo\n wp_enqueue_style('style', get_stylesheet_uri(), array('normalize', 'googleFont'), '1.0.0');\n\n /*cargar scrips\n true= para que se carga al final\n */\n wp_enqueue_script( 'slicknavJS', get_template_directory_uri().'/js/jquery.slicknav.min.js', array\n ('jquery'), '1.0.0', TRUE);\n\n //ligthbox solo lo necesitamos en la galeria\n if(is_page('galeria')):\n wp_enqueue_script( 'ligthboxJS', get_template_directory_uri().'/js/lightbox.min.js', array('jquery'), '2.11.0', TRUE);\n endif;\n\n wp_enqueue_script( 'scripts', get_template_directory_uri().'/js/scripts.js', array('jquery', 'slicknavJS'), '1.0.0', true); \n \n\n}", "function aitEnqueueScriptsAndStyles(){\r\n\tif(!is_admin()){\r\n\t\t// just shortcuts\r\n\t\t$s = THEME_CSS_URL;\r\n\t\t$j = THEME_JS_URL;\r\n\r\n\t\taitAddStyles(array(\r\n\t\t\t'ait-colorbox' => array('file' => \"$s/libs/colorbox.css\"),\r\n\t\t\t'ait-fancybox' => array('file' => \"$s/libs/fancybox.css\"),\r\n\t\t\t'jquery-ui' \t => array('file' => \"$s/libs/jquery-ui.css\"),\r\n\t\t\t'prettysociable' => array('file' => \"$s/libs/prettySociable.css\"),\r\n\t\t\t'hoverzoom' \t => array('file' => \"$s/libs/hoverZoom.css\"),\r\n\t\t));\r\n\r\n\t\taitAddScripts(array(\r\n\t\t\t'jquery-ui-tabs' \t\t\t=> true,\r\n\t\t\t'jquery-ui-accordion' \t\t\t=> true,\r\n\t\t\t'jquery-infieldlabel' \t\t\t=> array('file' => \"$j/libs/jquery-infieldlabel.js\", 'deps' => array('jquery'), 'inFooter' => true),\r\n\t\t\t'jquery-iconmenu' \t\t\t\t=> array('file' => \"$j/libs/jquery-iconmenu.js\", 'deps' => array('jquery'), 'inFooter' => true),\r\n\t\t\t'jquery-plugins'\t \t\t\t=> array('file' => \"$j/libs/jquery-plugins.js\", 'deps' => array('jquery')),\r\n\t\t\t'modernizr'\t\t\t\t\t\t=> array('file' => \"$j/libs/modernizr-2.6.1-custom.js\", 'deps' => array('jquery'), 'inFooter' => true),\r\n\r\n\t\t\t'ait-gridgallery' \t\t\t=> array('file' => \"$j/gridgallery.js\", 'deps' => array('jquery', 'jquery-plugins'), 'inFooter' => true),\r\n\t\t\t'ait-testimonials' \t\t\t=> array('file' => \"$j/testimonials.js\", 'deps' => array('jquery'), 'inFooter' => true),\r\n\t\t\t'ait-script' \t\t\t=> array('file' => \"$j/script.js\", 'deps' => array('jquery', 'jquery-infieldlabel', 'jquery-iconmenu', 'jquery-plugins', 'modernizr'), 'inFooter' => true),\r\n\t\t));\r\n\t}\r\n}", "function neuron_css_js() {\t\n\twp_enqueue_style( 'font-awesome', get_template_directory_uri() .'/assets/fonts/font-awesome/css/font-awesome.min.css', array(), '4.7.0', 'all' );\n\twp_enqueue_style( 'bootstrap', get_template_directory_uri() . '/assets/bootstrap/css/bootstrap.min.css', array(), '3.3.6', 'all' );\t\n\twp_enqueue_style( 'animate', get_template_directory_uri() . '/assets/css/animate.min.css', array(), '1.0.0', 'all' );\t\n\twp_enqueue_style( 'boots_nav', get_template_directory_uri() . '/assets/css/bootsnav.css', array(), '1.2.0', 'all');\n\twp_enqueue_style( 'owl_carousel', get_template_directory_uri() . '/assets/css/owl.carousel.min.css', array(), '2.2.0', 'all' );\n\twp_enqueue_style( 'neuron_style', get_stylesheet_uri() );\n\n\t\n//Enqueue Js Files\t \n\twp_enqueue_script( 'bootstrap_js', get_template_directory_uri() . '/assets/bootstrap/js/bootstrap.min.js', array('jquery'), '1.0.0', true ); \t\n\twp_enqueue_script( 'bootsnav_js', get_template_directory_uri() . '/assets/js/bootsnav.js', array('jquery'), '1.0.0', true );\n\twp_enqueue_script( 'carousel_js', get_template_directory_uri() . '/assets/js/owl.carousel.min.js', array('jquery'), '1.0.0', true );\n\twp_enqueue_script( 'wow', get_template_directory_uri() . '/assets/js/wow.min.js', array('jquery'), '1.1.3', true );\n\twp_enqueue_script( 'neuron_script', get_template_directory_uri() . '/assets/js/script.js', array('jquery'), '1.0.0', true );\n\t\n\tif ( is_singular() ) wp_enqueue_script( 'comment-reply' );\n}", "public function DefineJsResources()\n {\n $this->carabiner->js('https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js');\n $this->carabiner->js('https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js');\n $this->carabiner->js('https://cdn.jsdelivr.net/npm/chart.js@2.9.3/dist/Chart.min.js');\n // an array of arrays\n $this->carabiner->js(array(\n array('assets/js/Chart.min.js'),\n array('assets/js/Chart.bundle.min.js'),\n array('assets/js/jquery.js')\n ));\n }" ]
[ "0.77054214", "0.7556686", "0.7474683", "0.74055046", "0.7363797", "0.7342659", "0.7315555", "0.7282999", "0.72654414", "0.72224385", "0.7210172", "0.71380895", "0.70715946", "0.7047119", "0.70180416", "0.6983813", "0.6965448", "0.6957079", "0.69054085", "0.69014263", "0.6897916", "0.6825645", "0.6815841", "0.68096864", "0.68039775", "0.67850053", "0.6784902", "0.67768586", "0.67644775", "0.6752102", "0.674406", "0.6739611", "0.6733914", "0.67306006", "0.6728154", "0.67217284", "0.6716089", "0.67134225", "0.67020625", "0.6697458", "0.669199", "0.6690063", "0.6687111", "0.6683834", "0.66837054", "0.66781044", "0.6668979", "0.6663743", "0.663777", "0.66341066", "0.66227955", "0.6617742", "0.6611943", "0.66109526", "0.6607937", "0.6597738", "0.6593946", "0.65937287", "0.65889907", "0.65889287", "0.6587115", "0.6569716", "0.6568709", "0.6568709", "0.6566876", "0.6564225", "0.6562858", "0.6556908", "0.65567786", "0.65554494", "0.6546973", "0.6541306", "0.65392756", "0.6537437", "0.6534235", "0.6532608", "0.65279603", "0.65255886", "0.6524267", "0.6522463", "0.65222865", "0.6521514", "0.6518016", "0.6516015", "0.65075606", "0.6503893", "0.6503103", "0.6502079", "0.64916307", "0.64865315", "0.64818406", "0.6477864", "0.646455", "0.6463652", "0.6463046", "0.64540803", "0.6453895", "0.64530134", "0.6450774", "0.6450687", "0.6449612" ]
0.0
-1
/ Creacion de widget: sidebar
function sidebar() { register_sidebar( array( 'name' => 'Pie de Pagina', 'id' => 'footer', 'description' => 'Zona de widget para el footer', 'before_title' => '<p>', 'after_title' => '</p>', 'before_widget' => '<div id="%1$s" class="%2$s">', 'after_widget' => '</div>', ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function phoenix_widget_setup() {\n register_sidebar(array(\n 'name' => 'Sidebar',\n 'id' => 'sidebar-1',\n 'class' => 'custom',\n 'description' => 'Single post of blog sidebar',\n ));\n}", "function iiess_widgets(){\n register_sidebar(array(\n 'name' => 'Sidebar Eventos',\n 'id' => 'sidebar',\n 'before_widget' => '<div class=\"widget\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"text-center texto-primario\">',\n 'after_title' => '</h3>'\n ));\n}", "function mintshow_sidebar_widget_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Left Sidebar',\n\t\t'id' => 'left_sidebar_1',\n\t\t// 'before_widget' => '<div>',\n\t\t// 'after_widget' => '</div>',\n\t\t// 'before_title' => '<h2 class=\"rounded\">',\n\t\t// 'after_title' => '</h2>',\n\t) );\n\n}", "function mocca_main_sidebar() {\n register_sidebar(array(\n 'name' => 'Mocca Sidebar',\n 'id' => 'mocca-sidebar', \n 'description' => 'Wordpress Apper SideBar',\n 'class' => 'sidebar-wordpress',\n 'before_widget' => '<div class=\"widget-content\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>'\n ));\n }", "function gymfitness_widgets(){\n register_sidebar( array(\n 'name'=>'Sidebar 1',\n 'id' => 'sidebar_1',\n 'before-widget' => '<div class=\"widget\">', \n 'after-widget' => '</div>', \n 'before_title' => '<h3 class=\"text-center texto-primario\">',\n 'after_title' => '</h3>'\n\n\n ));\n register_sidebar( array(\n 'name'=>'Sidebar 2',\n 'id' => 'sidebar_2',\n 'before-widget' => '<div class=\"widget\">', \n 'after-widget' => '</div>', \n 'before_title' => '<h3 class=\"text-center texto-primario\">',\n 'after_title' => '</h3>'\n\n\n ));\n}", "function jn_widgets_init() {\n register_sidebar( array(\n 'name' => __('Main Sidebar', 'jn'),\n 'id' => 'sidebar-1',\n 'description' => __('The default sidebar to be used on pages','jn'),\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</aside>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>'\n ));\n}", "function studio_widgets_init() {\n register_sidebar( array(\n 'name' => __( 'Sidebar', 'studio' ),\n 'id' => 'sidebar-1',\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</aside>',\n 'before_title' => '<h1 class=\"widget-title\">',\n 'after_title' => '</h1>',\n ) );\n}", "function add_widget_sidebar()\r\n{\r\n register_sidebar(\r\n array(\r\n 'name' => 'Sidebar',\r\n 'id' => 'main-sidebar',\r\n )\r\n );\r\n register_sidebar(\r\n array(\r\n 'name' => 'Sidebar du footer',\r\n 'id' => 'footer-sidebar',\r\n )\r\n );\r\n}", "function inxboilerplate_widgets_init() {\n register_sidebar( array(\n \"name\" => __( \"Sidebar\", \"inxboilerplate\" ),\n \"id\" => \"r_sidebar\",\n \"before_widget\" => '<section id=\"%1$s\" class=\"widget %2$s\">',\n \"after_widget\" => \"</section>\",\n \"before_title\" => '<h3 class=\"wigtitle\">',\n \"after_title\" => \"</h3>\",\n ) );\n}", "function rb_sidebar_init()\n{\n register_sidebar( array(\n 'name' => __( 'Top Sidebar' ),\n 'id' => 'sidebar-top',\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => \"</div>\",\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n}", "function arphabet_widgets_init() {\n\n register_sidebar( array(\n 'name' => 'Home right sidebar',\n 'id' => 'home_right_1',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"rounded\">',\n 'after_title' => '</h2>',\n ) );\n }", "function elhero_sidebar()\r\n{\r\n register_sidebar( array(\r\n 'name' => 'MainSidebar',\r\n 'id' => 'main-sidebar',\r\n 'description' => 'appear evry were',\r\n 'class' => 'main_sidebar',\r\n 'before_widget' => '<div class=\"widget-content\">',\r\n 'after_widget' => '</div>',\r\n 'before_title' => '<h3 class=\"widget-title\">',\r\n 'after_title' => '</h3>'\r\n ));\r\n}", "function gymfitness_widgets(){\n\n register_sidebar(array(\n 'name' => 'Sidebar 1', \n 'id' => 'sidebar_1',\n 'before_widget' => '<div class=\"\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"widget-title\">',\n 'after_title' => '</h2>'\n ));\n register_sidebar(array(\n 'name' => 'Sidebar 2', \n 'id' => 'sidebar_2',\n 'before_widget' => '<div class=\"\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"widget-title\">',\n 'after_title' => '</h2>'\n ));\n\n}", "function control_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar', 'control' ),\n\t\t'id' => 'sidebar-1',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h1 class=\"widget-title\">',\n\t\t'after_title' => '</h1>',\n\t) );\n}", "function wpdocs_theme_slug_widgets_init() {\n register_sidebar( array(\n 'name' => __( 'Main Sidebar', 'webino' ),\n 'id' => 'sidebar-1',\n 'description' => __( 'Widgets in this area will be shown on all posts and pages.', 'webino' ),\n 'before_widget' => '<li id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</li>',\n 'before_title' => '<h2 class=\"widgettitle\">',\n 'after_title' => '</h2>',\n ) );\n}", "function ourWidgetsInit(){\n\n register_sidebar(array(\n 'name' => 'Sidebar',\n 'id' => 'sidebar1',\n 'before_widget' => '<div class=\"widget-item\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4 class=\"my-special-class\">',\n 'after_title' => '</h4>'\n\n ));\n}", "function wpdocs_theme_slug_widgets_init() {\nregister_sidebar( array(\n'name' => __( 'Main Sidebar' ),\n'id' => 'sidebar_1',\n'description' => __( 'aprafiq is a man' ),\n'before_widget' => '<aside id=\"main_sidebar\">',\n'after_widget' => '</aside>',\n'before_title' => '<h2>',\n'after_title' => '</h2>',\n) );\n}", "function wp_widget_control($sidebar_args)\n {\n }", "function add_widget_Support() {\n register_sidebar( array(\n 'name' => 'Sidebar',\n 'id' => 'sidebar',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>',\n ) );\n}", "function sidebar() {\n\t\t}", "function add_widgets() {\n\n register_sidebar( array(\n 'name' => 'Right Sidebar',\n 'id' => 'right_sidebar',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>',\n ) );\n}", "function russianroulette_widgets_init() {\n \tregister_sidebar( array(\n \t\t'name' => __( 'Sidebar', 'russianroulette' ),\n \t\t'id' => 'sidebar-1',\n \t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n \t\t'after_widget' => '</aside>',\n \t\t'before_title' => '<h1 class=\"widget-title\">',\n \t\t'after_title' => '</h1>',\n \t) );\n }", "function mythemepost_widgets(){ \n register_sidebar( array(\n 'name' => 'Lavel Up New Widget Area',\n 'id' => 'level_up_new_widget_area',\n 'before_widget' => '<aside>',\n 'after_widget' => '</aside>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n \n ));\n}", "function cd_do_sidebar() {\n\n\tadd_filter( 'wp_generate_tag_cloud_data', 'bf_lyrics_glossary_tag_cloud_data', 99, 1 );\n\n\tgenesis_widget_area( 'lyrics', array(\n\t\t'before' => '<div class=\"lyrics widget-area\"><div class=\"wrap\">',\n\t\t'after' => '</div></div>',\n\t) );\n\n}", "function adelle_widgets_init() {\r\n register_sidebar(array(\r\n 'name' => __( 'Right Widget', 'adelle-theme' ),\r\n 'id' => 'right-widget',\r\n 'description' => 'Right side widget area',\r\n 'before_widget' => '<article id=\"%1$s\" class=\"side-widget %2$s\">',\r\n 'after_widget' => '</article>',\r\n 'before_title' => '<h3>',\r\n 'after_title' => '</h3>',\r\n ));\r\n}", "function news_sidebar_widget() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'subscribe',\n\t\t'id' => 'subscribe',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\" role=\"complementary\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h2 class=\"widget-title\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\n}", "function register_my_sidebar(){\n \n register_sidebar( array(\n\t\t\"name\" => \"Sidebar widget\",\n \"id\" => \"sidebar1\", \n ));\n\n}", "function shiftr_posts_sidebar() {\n register_sidebar([\n 'id' => 'the_blog_sidebar',\n 'name' => 'The Blog Sidebar',\n 'description' => 'The primary Sidebar for the blog',\n 'before_widget' => '<div class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4>',\n 'after_title' => '</h4>',\n ]);\n}", "function YWR_2020_widgets_init()\n{\n register_sidebar(array(\n 'name' => __('General Page Sidebar', 'YWR_2020'),\n 'id' => 'sidebar-1',\n 'description' => __('Add widgets here to appear in your sidebar on standard pages.', 'YWR_2020'),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget clearfix %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<div class=\"fancy-title title-bottom-border\"><h2>',\n 'after_title' => '</h2></div>',\n ));\n\n}", "function arphabet_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Page Sidebar',\n\t\t'id' => 'page-sidebar',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2>',\n\t\t'after_title' => '</h2>',\n\t) );\n\n}", "function ft_hook_sidebar() {}", "function ptoys_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar', 'ptoys' ),\n\t\t'id' => 'sidebar-1',\n\t\t'description' => __( 'Add widgets here to appear in your sidebar.', 'ptoys' ),\n\t\t'before_widget' => '<section id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</section>',\n\t\t'before_title' => '<h2 class=\"widget-title\">',\n\t\t'after_title' => '</h2>',\n\t) );\n}", "function iodd_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => esc_html__( 'Sidebar', 'iodd' ),\n\t\t'id' => 'standard-sidebar',\n\t\t'description' => esc_html__( 'Add widgets here.', 'iodd' ),\n\t\t'before_widget' => '<section id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</section>',\n\t\t'before_title' => '<h2 class=\"widget-title\">',\n\t\t'after_title' => '</h2>',\n\t) );\n}", "public function widgets_init() {\n\t\tregister_sidebar(\n\t\t\tarray(\n\t\t\t\t'name' => __( 'Sidebar', 'hellish-simplicity' ),\n\t\t\t\t'id' => 'sidebar',\n\t\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"%2$s\">',\n\t\t\t\t'after_widget' => '</aside>',\n\t\t\t\t'before_title' => '<h1 class=\"widget-title\">',\n\t\t\t\t'after_title' => '</h1>',\n\t\t\t)\n\t\t);\n\t}", "public function sidebar() {\n $args = func_get_args();\n $sidebar = $args[0];\n\n if (!is_array($sidebar)) {\n $sidebar = array('label' => $sidebar);\n }\n\n if (isset($args[1]) && is_string($args[1])) {\n $sidebar['action'] = $args[1];\n }\n\n $sidebar = array_merge(array(\n 'tab' => $this->tab(),\n 'action' => null,\n 'flag' => true,\n 'id' => $this->id(),\n ), $sidebar);\n\n $this->hook($sidebar['tab'] . '-sidebar', 'createSideMenu', array(\n $sidebar['id'],\n $sidebar['label'],\n $sidebar['action'],\n $sidebar['flag'])\n );\n }", "function urbanfitness_widgets()\n{\n //registering widget must write php code to show it\n register_sidebar([\n 'name' => 'Sidebar', //widget name on wordpress panel\n 'id' => 'sidebar', //we are passing this id to dynamic_widget('sidebar') must be unique for wordpress to identify\n 'before_widget' => '<div class=\"widget\">', //html before widget\n 'after_widget' => '</div>', //html after widget\n 'before_title' => '<h3 class=\"text-primary\">', //html before title\n 'after_title' => '</h3>', //html after title\n ]);\n}", "function uwmadison_widgets_init() {\n\n\t\tregister_sidebar( array(\n\t\t\t'name' => __( 'Main Sidebar', 'uw-madison-160' ),\n\t\t\t'id' => 'sidebar-1',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => \"</aside>\",\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t) );\n\n\t}", "function yellow_widgets_init() {\n\n\tregister_sidebar( array(\n\t 'name' => 'Sidebar',\n\t 'id' => 'sidebar',\n\t 'before_widget' => '<div class=\"media-body\">',\n\t 'after_widget' => '</div>',\n\t 'before_title' => '<div class=\"card-header\">',\n\t 'after_title' => '</div>',\n\t));\n\tregister_sidebar( array(\n\t\t'name' => 'Footer',\n\t\t'id' => 'footer',\n\t\t'before_widget' => '',\n\t\t'after_widget' => '',\n\t\t'before_title' => '',\n\t\t'after_title' => '',\n\t ));\n\t\n \n }", "function add_some_widgets()\r\n{\r\n register_sidebar( array(\r\n 'name' => __( 'Sidebar', 'sidebar' ),\r\n 'id' => 'sidebar',\r\n 'description' => __( 'This will be displayed followed by the regular sidebar', 'spd' ),\r\n 'before_widget' => '<div id=\"sidebar-%i\" class=\"widget\"><div class=\"widgetcontent\">',\r\n 'after_widget' => '</div></div>',\r\n 'before_title' => '<h5>',\r\n 'after_title' => '</h5>',\r\n ) );\r\n}", "function arphabet_widgets_init() {\r\n register_sidebar( array(\r\n 'name' => 'Below main content',\r\n 'id' => 'home_right_1',\r\n 'before_widget' => '<div class=\"widget\">',\r\n 'after_widget' => '</div>',\r\n 'before_title' => '<h2 class=\"widget-title\">',\r\n 'after_title' => '</h2>',\r\n ) );\r\n //gallery side bar\r\n register_sidebar( array(\r\n 'name' => 'Gallery Main Page',\r\n 'id' => 'home_right_2',\r\n 'before_widget' => '<div class=\"gallery-widget\">',\r\n 'after_widget' => '</div>',\r\n 'before_title' => '<h2 class=\"gallery-widget-title\">',\r\n 'after_title' => '</h2>',\r\n ) );\r\n}", "function gon_products_sidebar_init(){\n\tregister_sidebar(array(\n 'name' => __('Products Sidebar Widget', 'gon_carrollton'),\n 'id' => 'products-premium-sidebar-widget',\n 'description' => 'Sidebar will appear on products pages',\n 'before_widget' => '<aside id=\"sidebar\"><div id=\"%1$s\" class=\"widget-container %2$s\">',\n 'after_widget' => \"</div></aside>\",\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>'\n ));\n}", "function doddy_child_register_sidebars() {\n register_sidebar(\n array(\n 'id' => 'cover-sidebar',\n 'name' => __( 'Widget para cover' ),\n 'description' => __( 'Widget para capa da front-page' ),\n 'class' => 'nav',\n 'before_widget' => '<div id=\"%1$s\" class=\"d-inline-flexd %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '',\n 'after_title' => '',\n ));\n}", "function kopparpannan_widgets_init() {\n register_sidebar( array(\n 'name' => __( 'Left Sidebar', 'kopparpannan' ),\n 'id' => 'left',\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s grid-sidebar-left\">',\n 'after_widget' => '</aside>',\n 'before_title' => '<h1 class=\"widget-title\">',\n 'after_title' => '</h1>',\n ) );\n \n register_sidebar( array(\n 'name' => __( 'Right Sidebar', 'kopparpannan' ),\n 'id' => 'right',\n 'before_widget' => '<ul><li id=\"%1$s\" class=\"widget %2$s grid-sidebad-right\">',\n 'after_widget' => '</li></ul>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n}", "function arphabet_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Home right sidebar',\n\t\t'id' => 'home_right_1',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 class=\"rounded\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\n}", "function widgets_init_now() {\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Текст вверху шапки'\n\t\t\t,'id' => 'header_top'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Несколько виджетов будут расположены в строчку. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Блок для виджета рассылки в подвале'\n\t\t\t,'id' => 'footer_mailings'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Блок контактов в подвале'\n\t\t\t,'id' => 'footer_contacts'\n\t\t\t,'description' => 'Добавьте сюда виджет \"Текст\" из левой части страницы. Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => 'Подробнее о системе обучения в Linguamore'\n\t\t\t,'id' => 'homepage_education-feats'\n\t\t\t,'description' => 'Блок, расположенный на странице \"Преимущества\". Добавьте сюда виджет \"Rich Text\" из левой части страницы. Иконки можно добавить кнопкой \"Add Media\". Названия виджетов на сайте не отобразятся'\n\t\t) );\n\t}", "function arphabet_widgets_init() {\r\n\r\n\tregister_sidebar( array(\r\n\t\t'name' => 'left sidebar',\r\n\t\t'id' => 'left_1',\r\n\t\t'before_widget' => '<div id=\"genres_box\">',\r\n\t\t'after_widget' => '</div>',\r\n\t\t'before_title' => '',\r\n\t\t'after_title' => '',\r\n\t) );\r\n\r\n}", "function twentyten_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar', 'twentyten' ),\n\t\t'id' => 'sidebar-principal',\n\t\t'description' => __( 'Arraste os itens desejados até aqui. ', 'twentyten' ),\n\t\t'before_widget' => '<div class=\"widget %2$s\" id=\"%1$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2>',\n\t\t'after_title' => '</h2>',\n\t) );\n}", "function arphabet_widgets_init() {\n\n register_sidebar(array(\n 'name' => esc_html__( 'Property side bar', 'wpestate'),\n 'id' => 'property_side_bar',\n 'description' => esc_html__( 'Property side bar widget area', 'wpestate'),\n 'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n 'after_widget' => '</li>',\n 'before_title' => '<h3 class=\"widget-title-sidebar\">',\n 'after_title' => '</h3>',\n ));\n\n register_sidebar(array(\n 'name' => esc_html__( 'Blog side bar', 'wpestate'),\n 'id' => 'blog_side_bar',\n 'description' => esc_html__( 'Blog side bar widget area', 'wpestate'),\n 'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n 'after_widget' => '</li>',\n 'before_title' => '<h3 class=\"widget-title-sidebar\">',\n 'after_title' => '</h3>',\n ));\n\n register_sidebar(array(\n 'name' => esc_html__( 'Blog Post side bar', 'wpestate'),\n 'id' => 'blog_post_side_bar',\n 'description' => esc_html__( 'Blog Post side bar widget area', 'wpestate'),\n 'before_widget' => '<li id=\"%1$s\" class=\"widget-container %2$s\">',\n 'after_widget' => '</li>',\n 'before_title' => '<h3 class=\"widget-title-sidebar\">',\n 'after_title' => '</h3>',\n ));\n\n}", "function themeName_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Main Sidebar',\n\t\t'id' => 'sidebar-1',\n\t\t'description' => __( 'Main theme sidebar.', 'themeDomain' ),\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t) );\n\n}", "function pickleplease_sidebars_init() {\n\n // Register the New Footer Sidebar\n register_sidebar(array(\n \n // Title for the Widget Dashboard\n 'name' => 'New Sidebar',\n \n // ID for the XHTML Markup\n 'id' => 'new-sidebar',\n\n // Description for the Widget Dashboard Box\n 'description' => __('This is a right column widget area.', 'thematic'),\n\n // Do not edit these. It keeps Headers and lists consistent for Thematic\n 'before_widget' => thematic_before_widget(),\n 'after_widget' => thematic_after_widget(),\n 'before_title' => thematic_before_title(),\n 'after_title' => thematic_after_title(),\n ));\n\n\n // Unregister and sidebars you donŐt need based on its ID.\n // For a full list of Thematic sidebar IDs, look at /thematc/library/extensions/widgets-extensions.php\n //unregister_sidebar('primary-aside');\n unregister_sidebar('secondary-aside');\n unregister_sidebar('index-top');\n unregister_sidebar('index-insert');\n unregister_sidebar('index-bottom');\n unregister_sidebar('single-top');\n unregister_sidebar('single-insert');\n unregister_sidebar('single-bottom');\n unregister_sidebar('page-top');\n unregister_sidebar('page-bottom');\n }", "function shape_widgets_init() {\n register_sidebar( array(\n 'name' => __( 'Primary Widget Area', 'shape' ),\n 'id' => 'sidebar-1',\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</aside>',\n 'before_title' => '<h1 class=\"widget-title\">',\n 'after_title' => '</h1>',\n ) );\n \n register_sidebar( array(\n 'name' => __( 'Secondary Widget Area', 'shape' ),\n 'id' => 'sidebar-2',\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</aside>',\n 'before_title' => '<h1 class=\"widget-title\">',\n 'after_title' => '</h1>',\n ) );\n}", "public function sidebarAction();", "function _s_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar', '_s' ),\n\t\t'id' => 'sidebar-1',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h1 class=\"widget-title\">',\n\t\t'after_title' => '</h1>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => 'Right Sidebar',\n\t\t'id' => 'sidebar-2',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h1 class=\"widget-title\">',\n\t\t'after_title' => '</h1>',\n\t) );\n}", "function __construct(){\n\t\t\t$this->stored\t= 'qode_sidebars';\n\t\t\t$this->title = esc_html__('Custom Widget Area','bridge');\n\n\t\t\tadd_action('load-widgets.php', array(&$this, 'load_assets') , 5 );\n\t\t\tadd_action('widgets_init', array(&$this, 'register_custom_sidebars') , 1000 );\n\t\t\tadd_action('wp_ajax_qode_ajax_delete_custom_sidebar', array(&$this, 'delete_sidebar_area') , 1000 );\n\n\t\t\t// Migrate old custom sidebars to new\n\t\t\tadd_action( 'after_setup_theme', array( $this, 'migrate_custom_sidebars' ) );\n\t\t}", "function thefold_widgets_init() {\n register_sidebar( array(\n 'name' => __( 'Main Sidebar', 'thefold' ),\n 'id' => 'sidebar-1',\n 'description' => __( 'Default sidebar that will appear on most pages', 'thefold' ),\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</aside>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n\n register_sidebar( array(\n 'name' => __( 'Footer', 'thefold' ),\n 'id' => 'footer',\n 'description' => __( 'Global Footer area', 'thefold' ),\n 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</aside>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ) );\n}", "function ncc_widget_areas_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Dekstop Flyout (Left)',\n\t\t'id' => 'desktop_flyout_left',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2>',\n\t\t'after_title' => '</h2>',\n\t));\n register_sidebar( array(\n\t\t'name' => 'Dekstop Flyout (Center)',\n\t\t'id' => 'desktop_flyout_center',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2>',\n\t\t'after_title' => '</h2>',\n\t));\n register_sidebar( array(\n 'name' => 'Dekstop Flyout (Right)',\n 'id' => 'desktop_flyout_right',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>',\n ));\n register_sidebar( array(\n 'name' => 'Sidebar (Pages)',\n 'id' => 'sidebar_pages',\n 'before_widget' => '<div class=\"widget-class__blog\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>',\n ));\n register_sidebar( array(\n 'name' => 'Sidebar (Blog)',\n 'id' => 'sidebar_blog',\n 'before_widget' => '<div class=\"widget-class__blog\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2>',\n 'after_title' => '</h2>',\n ));\n}", "function twentyten_widgets_init() {\n\t// Area 1, located at the top of the sidebar.\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar', 'pp' ),\n\t\t'id' => 'sidebar-principal',\n\t\t'description' => __( 'Arraste os itens desejados até aqui. ', 'pp' ),\n\t\t'before_widget' => '<div class=\"widget %2$s\" id=\"%1$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 style=\"display:none;\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\n}", "function ccac_2020_new_widgets_init() {\n /* Pinegrow generated Register Sidebars Begin */\n\n /* Pinegrow generated Register Sidebars End */\n}", "function udemy_widget_setup(){\n\tregister_sidebar(\n\t\tarray(\n\t\t\t'name' \t=> 'Sidebar',\n\t\t\t'id' \t=> 'sidebar-1',\n\t\t\t'class' => 'custom',\n\t\t\t'description' => 'Standard Sidebar',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => '</aside>',\n\t\t\t'before_title' => '<h1 class=\"widget-title\">',\n\t\t\t'after_title' => '</h1>',\n\t\t)\n\t);\n}", "function widget_init() {\n if ( function_exists('register_sidebar') )\n \n register_sidebar(\n array(\n 'name' => 'Footer',\n 'before_widget' => '<div class = \"footer\">',\n 'after_widget' => '</div>',\n 'before_title' => '',\n 'after_title' => '',\n ));\n\n register_sidebar(\n array(\n 'name' => 'Event Navigation',\n 'before_widget' => '<div class=\"custom-widget top-round card slight-shadow card_container flex-column-reverse\">',\n 'after_widget' => '</div>',\n 'before_title' => '<div class=\"card_title\">',\n 'after_title' => '</div>',\n ));\n\n register_sidebar(\n array(\n 'name' => 'Frontpage News',\n 'before_widget' => '<div class=\"custom-widget card top-round slight-shadow card_container flex-column-reverse\">',\n 'after_widget' => '</div>',\n 'before_title' => '<div class=\"card_title\">',\n 'after_title' => '</div>',\n ));\n\n }", "function travomath_sidebar_init()\n{\n register_sidebar(\n array(\n 'name' => esc_html__('TravOMath News Letter', 'travomath'),\n 'id' => 'travomath-newsletter-widget',\n 'description' => 'Widgets For News Letter',\n 'before_widget' => '<section id=\"%1$s\" class=\"travomath-newsletter-widget %2$s\">',\n 'after_widget' => '</section>',\n 'before_title' => '<h2 class=\"travomath-newsletter-widget-title\">',\n 'after_title' => '</h2>',\n )\n\t);\n\t\n\t\n register_sidebar(\n array(\n 'name' => esc_html__('TravOMath Travel By Location', 'travomath'),\n 'id' => 'travomath-travelbylocation-widget',\n 'description' => 'Widgets For Travel By Location',\n 'before_widget' => '<section id=\"%1$s\" class=\"travomath-travelbylocation-widget %2$s\">',\n 'after_widget' => '</section>',\n 'before_title' => '<h2 class=\"link-title\">',\n 'after_title' => '</h2>',\n )\n\t);\n\t\n register_sidebar(\n array(\n 'name' => esc_html__('TravOMath Tips & Tricks', 'travomath'),\n 'id' => 'travomath-tipsandtricks-widget',\n 'description' => 'Widgets For Tips & Tricks',\n 'before_widget' => '<section id=\"%1$s\" class=\"travomath-tipsandtricks-widget %2$s\">',\n 'after_widget' => '</section>',\n 'before_title' => '<h2 class=\"link-title\">',\n 'after_title' => '</h2>',\n )\n\t);\n\t\n register_sidebar(\n array(\n 'name' => esc_html__('TravOMath Travel Shops', 'travomath'),\n 'id' => 'travomath-travelshops-widget',\n 'description' => 'Widgets For Tips & Tricks',\n 'before_widget' => '<section id=\"%1$s\" class=\"travomath-travelshops-widget %2$s\">',\n 'after_widget' => '</section>',\n 'before_title' => '<h2 class=\"link-title\">',\n 'after_title' => '</h2>',\n )\n\t);\n\t\n register_sidebar(\n array(\n 'name' => esc_html__('TravOMath Videos', 'travomath'),\n 'id' => 'travomath-videos-widget',\n 'description' => 'Widgets For Tips & Tricks',\n 'before_widget' => '<section id=\"%1$s\" class=\"travomath-videos-widget %2$s\">',\n 'after_widget' => '</section>',\n 'before_title' => '<h2 class=\"link-title\">',\n 'after_title' => '</h2>',\n )\n );\n}", "function init_custom_widgets() {\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-top',\n\t\t'name' => __('Sidebar top', 'bonestheme'),\n\t\t'description' => __('Top sidebar area, present on all pages (default: Main Menu)', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>'\n\t));\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-projects',\n\t\t'name' => __('Projects sidebar', 'bonestheme'),\n\t\t'description' => __('Active on single project pages only (default: Related People, Grants & Publications)', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>'\n\t));\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-people',\n\t\t'name' => __('People sidebar', 'bonestheme'),\n\t\t'description' => __('Active on single people pages only.', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>'\n\t));\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-homepage',\n\t\t'name' => __('Homepage sidebar', 'bonestheme'),\n\t\t'description' => __('Active on homepage, lower side bar area.', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h4 class=\"widget-title\">',\n\t\t'after_title' => '</h4>'\n\t));\n\t\n\tregister_sidebar(array(\n\t\t'id' => 'sidebar-homepage-content',\n\t\t'name' => __('Homepage main', 'bonestheme'),\n\t\t'description' => __('Active on homepage, below main content area.', 'bonestheme'),\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 class=\"widget-title\">',\n\t\t'after_title' => '</h2>'\n\t));\n\t\n\t\n\n\t/* Custom widget's */\n\t\n\tregister_widget( 'All_People_Widget' );\n\tregister_widget( 'Related_People_Widget' );\n\n\tregister_widget( 'All_Projects_Widget' );\n\tregister_widget( 'Related_Projects_Widget' );\n\tregister_widget( 'Related_Grants_Widget' );\n\tregister_widget( 'Related_Publications_Widget' );\n\n}", "function Task_widgets_init() {\n \n // The SideBar\n register_sidebar( array(\n 'name' => esc_html__( 'SideBar', 'Task' ),\n 'id' => 'sidebar-1',\n 'description' => esc_html__( 'Add widgets here.', 'Task' ),\n 'before_widget' => '',\n 'after_widget' => '',\n ) );\n \n // The Banner Above The Navigation Bar In The Header\n register_sidebar( array(\n 'name' => esc_html__( 'Banner Above Navigation Bar', 'Task' ),\n 'id' => 'sidebar-2',\n 'description' => esc_html__( 'Add widgets here.', 'Task' ),\n 'before_widget' => '',\n 'after_widget' => '',\n ) );\n \n // The Square Banner Next To The 3 Main Posts\n register_sidebar( array(\n 'name' => esc_html__( 'The Square Banner Next To The 3 Main Posts', 'Task' ),\n 'id' => 'sidebar-3',\n 'description' => esc_html__( 'Add widgets here.', 'Task' ),\n 'before_widget' => '',\n 'after_widget' => '',\n ) );\n \n // The Side Banner In The Left\n register_sidebar( array(\n 'name' => esc_html__( 'The Side Banner In The Left', 'Task' ),\n 'id' => 'sidebar-4',\n 'description' => esc_html__( 'Add widgets here.', 'Task' ),\n 'before_widget' => '',\n 'after_widget' => '',\n ) );\n \n }", "function register_sidebar_init() {\n\n\t}", "function boiler_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar', 'boiler' ),\n\t\t'id' => 'sidebar-1',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h1 class=\"widget-title\">',\n\t\t'after_title' => '</h1>',\n\t) );\n}", "function accelerate_theme_child_widget_init() {\r\n\tregister_sidebar( array(\r\n\t 'name' =>__( 'Homepage sidebar', 'accelerate-theme-child'),\r\n\t 'id' => 'sidebar-2',\r\n\t 'description' => __( 'Appears on the static front page template', 'accelerate-theme-child' ),\r\n\t 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\r\n\t 'after_widget' => '</aside>',\r\n\t 'before_title' => '<h3 class=\"widget-title\">',\r\n\t 'after_title' => '</h3>',\r\n\t) );\r\n}", "function sbc_widgets_init() {\n\n register_sidebar( array(\n 'name' => 'Left Column',\n 'id' => 'left-col',\n 'before_widget' => '<div class=\"left-col widget\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4 class=\"head widget-head\">',\n 'after_title' => '</h4>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Center Column',\n 'id' => 'center-col',\n 'before_widget' => '<div class=\"center-col widget\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4 class=\"head widget-head\">',\n 'after_title' => '</h4>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Right Column',\n 'id' => 'right-col',\n 'before_widget' => '<div class=\"right-col widget\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4 class=\"head widget-head\">',\n 'after_title' => '</h4>',\n ) );\n\n register_sidebar( array(\n 'name' => 'Service Sidebar',\n 'id' => 'service-sidebar',\n 'before_widget' => '<div class=\"sidebar service-sidebar\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4 class=\"head service-widget-head\">',\n 'after_title' => '</h4>',\n ) );\n\n}", "function dl_widget_init() {\n\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Página de Contacto',\n\t\t'id'\t\t\t=> 'contact-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Barra Lateral',\n\t\t'id'\t\t\t=> 'sidebar-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\tregister_sidebar( array(\n\t\t'name'\t\t\t=> 'Search Menu',\n\t\t'id'\t\t\t=> 'menu-widget',\n\t\t'before_widget'\t=> '',\n\t\t'after_widget'\t=> '',\n\t\t'before_title'\t=> '',\n\t\t'after_title'\t=> '',\n\t));\n\n}", "function naked_register_sidebars() {\n register_sidebar(array( // Start a series of sidebars to register\n 'id' => 'sidebar', // Make an ID\n 'name' => 'Sidebar', // Name it\n 'description' => 'Take it on the side...', // Dumb description for the admin side\n 'before_widget' => '<div>', // What to display before each widget\n 'after_widget' => '</div>', // What to display following each widget\n 'before_title' => '<h1 class=\"title\">', // What to display before each widget's title\n 'after_title' => '</h1>', // What to display following each widget's title\n 'empty_title'=> '', // What to display in the case of no title defined for a widget\n // Copy and paste the lines above right here if you want to make another sidebar,\n // just change the values of id and name to another word/name\n ));\n}", "function health_access2017_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar Top', 'health-access2017' ),\n\t\t'id' => 'sidebar-1',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '<span class=\"widget-cta\"><a href=\"http://healthaccess.flywheelsites.com/get-involved/\">View More Ways to Get Involved >></a></span></aside>',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar Middle', 'health-access2017' ),\n\t\t'id' => 'sidebar-2',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '<span class=\"widget-cta\"><a href=\"http://healthaccess.flywheelsites.com/blog/\">More on the Blog>></a></span></aside>',\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => __( 'Sidebar Bottom', 'health-access2017' ),\n\t\t'id' => 'sidebar-3',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => \"</aside>\",\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\n\t) );\n\n\tregister_sidebar( array(\n\t\t'name' => __( 'Top Bar', 'health-access2017' ),\n\t\t'id' => 'top-bar',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => \"</aside>\",\n\t\t'before_title' => '',\n\t\t'after_title' => '',\n\t\t\n\t) );\n\n\tregister_sidebar( array(\n\t\t'name' => __( 'Top Nav Search', 'health-access2017' ),\n\t\t'id' => 'top-nav-search',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => \"</aside>\",\n\t\t'before_title' => '',\n\t\t'after_title' => '',\n\t\t\n\t) );\n\n\tregister_sidebar( array(\n\t\t'name' => __( 'Footer Right', 'health-access2017' ),\n\t\t'id' => 'footer-right',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => \"</aside>\",\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t\t\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => __( 'Footer Left', 'health-access2017' ),\n\t\t'id' => 'footer-left',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => \"</aside>\",\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t\t\n\t) );\n\n\tregister_sidebar( array(\n\t\t'name' => __( 'Page Header Image', 'health-access2017' ),\n\t\t'id' => 'page-header-image',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s s_span_4 col\">',\n\t\t'after_widget' => \"</aside>\",\n\t\t\n\t) );\n\n\tregister_sidebar( array(\n\t\t'name' => __( 'Newsroom Publications Sidebar', 'health-access2017' ),\n\t\t'id' => 'newsroom-publications-sidebar',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => \"</aside>\",\n\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t'after_title' => '</h3>',\n\t\t\n\t) );\n}", "function wp_list_widget_controls_dynamic_sidebar($params)\n {\n }", "function theme_register_sidebar(){\n\n\n register_sidebar(array(\n 'name' => 'Main Sidebar',\n 'id' => 'main_sidebar',\n 'description' => 'Sidebar Principal',\n 'before_widget' => '',\n 'after_widget' => '',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ));\n register_sidebar(array(\n 'name' => 'Sidebar Secundario',\n 'id' => 'second_sidebar',\n 'description' => ' Side bar secundario',\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h3 class=\"widget-title\">',\n 'after_title' => '</h3>',\n ));\n\n}", "function wpb_widgets_init()\n{\n\n register_sidebar(array(\n 'name' => 'Custom Header Widget Area',\n 'id' => 'custom-header-widget',\n 'before_widget' => '<div class=\"chw-widget\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h2 class=\"chw-title\">',\n 'after_title' => '</h2>',\n ));\n}", "function register_widget_areas()\n {\n register_sidebar(array(\n 'name' => 'Latest Tweets',\n 'id' => 'latest_tweets',\n 'description' => 'latest tweets',\n 'before_widget' => '<section class=\"widget-area latest-tweets\">',\n 'after_widget' => '</section>',\n 'before_title' => '<h4>',\n 'after_title' => '</h4>',\n ));\n }", "function MyPenandPantry_WidgetInit()\n{\n\tregister_sidebar(array(\n\t\t'name' => 'Social-icon-bar',\n\t\t'id' => 'sidebar1',\n\t\t'before_widget' => '<div class=\"widget-item\">',\n\t\t'after_widget' => '</div>'\n\t));\n}", "function gs_widgets_init() {\r\n\tregister_sidebar(\r\n\t array(\r\n\t 'name' => 'Homepage Widgets',\r\n\t 'id' => 'homepage-widgets',\r\n\t 'description' => '',\r\n\t 'before_widget' => '<div id=\"%1$s\" class=\"home-widget %2$s four columns\"><div class=\"widget-container\">',\r\n\t 'after_widget' => '</div></div>',\r\n\t 'before_title' => '<h4>',\r\n\t 'after_title' => '</h4>', \r\n\t ));\r\n\r\n\tregister_sidebar(\r\n\t array(\r\n\t 'name' => 'Page Sidebar',\r\n\t 'id' => 'page-sidebar',\r\n\t 'description' => '',\r\n\t 'before_widget' => '<div id=\"%1$s\" class=\"%2$s side-widget\">',\r\n\t 'after_widget' => '</div>',\r\n\t 'before_title' => '<h4>',\r\n\t 'after_title' => '</h4>', \r\n\t ));\r\n\r\n\tregister_sidebar(\r\n\t array(\r\n\t 'name' => 'Blog Sidebar',\r\n\t 'id' => 'blog-sidebar',\r\n\t 'description' => '',\r\n\t 'before_widget' => '<div id=\"%1$s\" class=\"%2$s side-widget\">',\r\n\t 'after_widget' => '</div>',\r\n\t 'before_title' => '<h4>',\r\n\t 'after_title' => '</h4>', \r\n\t ));\r\n}", "function anipics_add_widget_area(){\n register_sidebar(array(\n 'id' => 'projet',\n 'name' => 'Photo gallery',\n 'description' => ' Apparait au centre',\n 'before_widget' => '<div>',\n 'after_widget' => '</div>',\n 'before_title' => '<h1>',\n 'after_title' => '</h1>'\n ));\n register_sidebar(array(\n 'id' => 'footer',\n 'name' => 'footer',\n 'description' => ' Apparait bas',\n 'before_widget' => '<div class=\"col s4\" style=\"margin: 0 18em 0 3em \" >',\n 'after_widget' => '</div>',\n 'before_title' => '<h1>',\n 'after_title' => '</h1>'\n ));\n register_sidebar(array(\n 'id' => 'footer2',\n 'name' => 'footer2',\n 'description' => ' Apparait bas',\n 'before_widget' => '<div class=\"col s6\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h1>',\n 'after_title' => '</h1>'\n ));\n}", "function brideliness_widgets_init() {\n\t// Default Sidebars\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Blog Sidebar', 'brideliness' ),\n\t\t\t'id' => 'sidebar-blog',\n\t\t\t'description' => esc_html__( 'Appears on single blog posts and on Blog Page', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\"><span>',\n\t\t\t'after_title' => '</span></h3>',\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Pages Sidebar', 'brideliness' ),\n\t\t\t'id' => 'sidebar-pages',\n\t\t\t'description' => esc_html__( 'Appears on Pages', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\"><span>',\n\t\t\t'after_title' => '</span></h3>',\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Header Top Panel Sidebar', 'brideliness' ),\n\t\t\t'id' => 'top-sidebar',\n\t\t\t'description' => esc_html__( 'Located at the top of site', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"%2$s left-aligned\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<!--',\n\t\t\t'after_title' => '-->',\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Aside Logo Left sidebar(Standart Header)', 'brideliness' ),\n\t\t\t'id' => 'aside-logo-left-sidebar',\n\t\t\t'description' => esc_html__( 'Located to the left from header', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '',\n\t\t\t'after_title' => '',\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Aside Logo Right sidebar(Standart Header)', 'brideliness' ),\n\t\t\t'id' => 'aside-logo-right-sidebar',\n\t\t\t'description' => esc_html__( 'Located to the right from header', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '',\n\t\t\t'after_title' => '',\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t\t'name' => esc_html__( 'Aside Logo Sidebar(Fixed Header)' , 'brideliness' ),\n\t\t\t\t'id' => 'fixed-header',\n\t\t\t\t'description' => esc_html__( 'Located to the right of the Header', 'brideliness' ),\n\t\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t\t'after_widget' => '</div>',\n\t\t\t\t'before_title' => '',\n\t\t\t\t'after_title' => '',\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Menu Sidebar(Standart Header)', 'brideliness' ),\n\t\t\t'id' => 'menu-sidebar',\n\t\t\t'description' => esc_html__( 'Located to the right after menu', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '',\n\t\t\t'after_title' => '',\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Front Page Sidebar', 'brideliness' ),\n\t\t\t'id' => 'sidebar-front',\n\t\t\t'description' => esc_html__( 'Appears on Front Page', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\"><span>',\n\t\t\t'after_title' => '</span></h3>',\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Shop Page Sidebar', 'brideliness' ),\n\t\t\t'id' => 'sidebar-shop',\n\t\t\t'description' => esc_html__( 'Appears on Products page', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\"><span>',\n\t\t\t'after_title' => '</span></h3>',\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Shop Page Special Filters Sidebar', 'brideliness' ),\n\t\t 'id' => 'filters-sidebar',\n\t\t 'description' => esc_html__( 'Located at the top of the products page', 'brideliness' ),\n\t\t 'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t 'after_widget' => '</aside>',\n\t\t 'before_title' => '<h3 class=\"dropdown-filters-title\">',\n\t\t 'after_title' => '</h3>',\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Shop Bottom Sidebar #1', 'brideliness' ),\n\t\t 'id' => 'footer-content-bottom-shop1',\n\t\t 'description' => esc_html__( 'Located at the bottom content shop', 'brideliness' ),\n\t\t 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t 'after_widget' => '</div>',\n\t\t 'before_title' => '<h3 class=\"shop-bottom-sidebar\">',\n\t\t 'after_title' => '</h3>',\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Shop Bottom Sidebar #2', 'brideliness' ),\n\t\t 'id' => 'footer-content-bottom-shop2',\n\t\t 'description' => esc_html__( 'Located at the bottom content shop', 'brideliness' ),\n\t\t 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t 'after_widget' => '</div>',\n\t\t 'before_title' => '<h3 class=\"shop-bottom-sidebar\">',\n\t\t 'after_title' => '</h3>',\n\t\t ) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Single Product Sidebar', 'brideliness' ),\n\t\t\t'id' => 'sidebar-product',\n\t\t\t'description' => esc_html__( 'Appears on Single Products page', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\"><span>',\n\t\t\t'after_title' => '</span></h3>',\n\t\t) );\n\t\t// Footer Sidebars\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Footer Sidebar Col#1', 'brideliness' ),\n\t\t\t'id' => 'footer-sidebar-1',\n\t\t\t'description' => esc_html__( 'Located in the footer of the site', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Footer Sidebar Col#2', 'brideliness' ),\n\t\t\t'id' => 'footer-sidebar-2',\n\t\t\t'description' => esc_html__( 'Located in the footer of the site', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Footer Sidebar Col#3', 'brideliness' ),\n\t\t\t'id' => 'footer-sidebar-3',\n\t\t\t'description' => esc_html__( 'Located in the footer of the site', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Footer Sidebar Col#4', 'brideliness' ),\n\t\t\t'id' => 'footer-sidebar-4',\n\t\t\t'description' => esc_html__( 'Located in the footer of the site', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t) );\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Footer Bottom Sidebar', 'brideliness' ),\n\t\t\t'id' => 'footer-bottom',\n\t\t\t'description' => esc_html__( 'Located in the footer of the site', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t) );\n\tif(brideliness_get_option('brideliness-specials-sidebar1')){\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Brideliness Specials Sidebar #1', 'brideliness' ),\n\t\t\t'id' => 'brideliness-specials-sidebar1',\n\t\t\t'description' => esc_html__( 'This sidebar can be placed in any part of your home page where Visual Composer plugin is used', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget specials %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\"><span>',\n\t\t\t'after_title' => '</span></h3>',\n\t\t\t) );\t\n\t}\n\tif(brideliness_get_option('brideliness-specials-sidebar2')){\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Brideliness Specials Sidebar #2', 'brideliness' ),\n\t\t\t'id' => 'brideliness-specials-sidebar2',\n\t\t\t'description' => esc_html__( 'This sidebar can be placed in any part of your home page where Visual Composer plugin is used', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget specials %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\"><span>',\n\t\t\t'after_title' => '</span></h3>',\n\t\t\t) );\t\n\t}\n\tif(brideliness_get_option('brideliness-specials-sidebar3')){\n\t\tregister_sidebar( array(\n\t\t\t'name' => esc_html__( 'Brideliness Specials Sidebar #3', 'brideliness' ),\n\t\t\t'id' => 'specials-front-page',\n\t\t\t'description' => esc_html__( 'This sidebar can be placed in any part of your home page where Visual Composer plugin is used', 'brideliness' ),\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget specials-front-page %2$s\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\"><span>',\n\t\t\t'after_title' => '</span></h3>',\n\t\t) );\n\t}\t\t\n\t}", "function bp_widgets_init() {\n // register_sidebar( array(\n // 'name' => __( 'Footer Widget Area', 'holstein' ),\n // 'id' => 'footer-widget',\n // 'description' => __( 'Appears on the bottom of every page.', 'holstein' ),\n // 'before_widget' => '<div class=\"col\">',\n // 'after_widget' => '</div>',\n // 'before_title' => '<h2>',\n // 'after_title' => '</h2>'\n // ) );\n\n register_sidebar( array(\n 'name' => __( 'Right Sidebar Widget Area', 'bp' ),\n 'id' => 'right-sidebar',\n 'description' => __( 'Appears on the right side of the blog index.', 'bp' ),\n 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n 'after_widget' => '</div>',\n 'before_title' => '<h4 class=\"widget-title\">',\n 'after_title' => '</h4>'\n ) );\n\n // register_sidebar( array(\n // 'name' => __( 'Left Sidebar Widget Area', 'holstein' ),\n // 'id' => 'left-sidebar',\n // 'description' => __( 'Appears on the left side of pages', 'holstein' ),\n // 'before_widget' => '<div id=\"%1$s\" class=\"area %2$s\">',\n // 'after_widget' => '</div>',\n // 'before_title' => '<h3>',\n // 'after_title' => '</h3>'\n // ) ); \n}", "function register_sidebar_widget($name, $output_callback, $classname = '', ...$params)\n {\n }", "function wowaries_widgets_init() {\n /* WowAriesProject generated Register Sidebars Begin */\n\n /* WowAriesProject generated Register Sidebars End */\n}", "function modshrink_s_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => __( 'Primary Sidebar', 'modshrink_s' ),\n\t\t'id' => 'sidebar-1',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h1 class=\"widget-title\">',\n\t\t'after_title' => '</h1>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => __( 'Secondary Sidebar', 'modshrink_s' ),\n\t\t'id' => 'sidebar-2',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h1 class=\"widget-title\">',\n\t\t'after_title' => '</h1>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => __( 'Content Aside', 'modshrink_s' ),\n\t\t'id' => 'content_aside',\n\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</aside>',\n\t\t'before_title' => '<h1 class=\"widget-title\">',\n\t\t'after_title' => '</h1>',\n\t) );\n\tregister_sidebar( array(\n\t\t'name' => __( 'After <body>', 'modshrink_s' ),\n\t\t'id' => 'after_body',\n\t\t'before_widget' => '',\n\t\t'after_widget' => '',\n\t\t'before_title' => '',\n\t'after_title' => '',\n\t) );\n}", "public function quickSidebarAction();", "function happy_register_sidebars() {\n\n\tregister_sidebar( array( 'name' => __( 'Feature', hybrid_get_textdomain() ), 'id' => 'feature', 'description' => __( 'Displayed in the feature area.', hybrid_get_textdomain() ), 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s widget-%2$s\"><div class=\"widget-inside\">', 'after_widget' => '</div></div>', 'before_title' => '<h3 class=\"widget-title\">', 'after_title' => '</h3>' ) );\n\n}", "function calslabs_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Top Right Hours',\n\t\t'id' => 'top_right_area',\n\t\t'before_widget' => '<div>',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<h2 class=\"widget-title\">',\n\t\t'after_title' => '</h2>',\n\t) );\n\n}", "function kcsite_widgets_init() {\t\t\t\n\t\tregister_sidebar( array(\n\t\t\t'name' => __( 'Left sidebar', 'kcsite' ),\n\t\t\t'id' => 'sidebar-l',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget clearfix %2$s\">',\n\t\t\t'after_widget' => '</aside>',\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t));\t\t\n\t\tregister_sidebar( array(\n\t\t\t'name' => __( 'Right sidebar', 'kcsite' ),\n\t\t\t'id' => 'sidebar-r',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget clearfix %2$s\">',\n\t\t\t'after_widget' => \"</aside>\",\n\t\t\t'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t'after_title' => '</h3>',\n\t\t));\n/*\n\t\tregister_sidebar( array(\n\t\t\t'name' => __('Banners Before Footer', 'kcsite'),\n\t\t\t'id' => 'sidebar-banners-before-footer',\n\t\t\t'before_widget' => '<aside id=\"%1$s\" class=\"widget %2$s help-inline\">',\n\t\t\t'after_widget' => \"</aside>\",\n\t\t\t//'before_title' => '<h3 class=\"widget-title\">',\n\t\t\t//'after_title' => '</h3>',\n\t\t) );*/\n\t}", "function registerSidebars() {\n\t\t\tregister_sidebar(array(\n\t\t\t\t'name' => __( 'Sidebar', 'titan' ),\n\t\t\t\t'id' => 'normal_sidebar',\n\t\t\t\t'before_widget' => '<li id=\"%1$s\" class=\"widget %2$s\">',\n\t\t\t\t'after_widget' => '</li>',\n\t\t\t\t'before_title' => '<h2 class=\"widgettitle\">',\n\t\t\t\t'after_title' => '</h2>',\n\t\t\t));\n\t\t}", "function gp_widgets_init() {\n\n /**\n * Register sidebars.\n */\n\n $sidebar_main = array_merge(\n array( 'name' => __( 'General Sidebar', 'gp' ), 'id' => 'sidebar-main' ),\n gp_get_default_widget_params()\n );\n register_sidebar( $sidebar_main );\n\n // $sidebar_post = array_merge(\n // array( 'name' => __( 'Blog Sidebar', 'gp' ), 'id' => 'sidebar-blog' ),\n // gp_get_default_widget_params()\n // );\n // register_sidebar( $sidebar_post );\n\n\n // $sidebar_post = array_merge(\n // array( 'name' => __( 'Blog Post Sidebar', 'gp' ), 'id' => 'sidebar-post' ),\n // gp_get_default_widget_params()\n // );\n // register_sidebar( $sidebar_post );\n\n\n // $sidebar_portfolio = array_merge(\n // array( 'name' => __( 'Portfolio Sidebar', 'gp' ), 'id' => 'sidebar-portfolio' ),\n // gp_get_default_widget_params()\n // );\n // register_sidebar( $sidebar_portfolio );\n\n\n // $sidebar_portfolio_single = array_merge(\n // array( 'name' => __( 'Portfolio Project Sidebar', 'gp' ), 'id' => 'sidebar-portfolio-single' ),\n // gp_get_default_widget_params()\n // );\n // register_sidebar( $sidebar_portfolio_single );\n\n // $persy_fuer_kmu = array_merge(\n // array( 'name' => __( 'Persy für KMU', 'gp' ), 'id' => 'persy-fuer-kmu' ),\n // gp_get_default_widget_params()\n // );\n // register_sidebar( $persy_fuer_kmu );\n\n // $persy_fuer_pdl = array_merge(\n // array( 'name' => __( 'Persy für PDL', 'gp' ), 'id' => 'persy-fuer-pdl' ),\n // gp_get_default_widget_params()\n // );\n // register_sidebar( $persy_fuer_pdl );\n\n // $persy_support = array_merge(\n // array( 'name' => __( 'Persy Support', 'gp' ), 'id' => 'persy-support' ),\n // gp_get_default_widget_params()\n // );\n // register_sidebar( $persy_support );\n\n $template_with_subnav = array_merge(\n array( 'name' => __( 'Template with subnav', 'gp' ), 'id' => 'sidebar-template-with-subnav' ),\n gp_get_default_widget_params()\n );\n register_sidebar( $template_with_subnav );\n\n\n // Removes the default styles that are packaged with the Recent Comments widget.\n add_filter( 'show_recent_comments_widget_style', '__return_false' );\n\n}", "function projects_page_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Projects Page Left Col',\n\t\t'id' => 'projects_page',\n\t\t'before_widget' => '<div id=\"projectsPageNavWidget\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '',\n\t\t'after_title' => '',\n\t) );\n\n}", "function add_sidebars() {\n\tregister_sidebar( array(\n\t\t'name' => 'Main Sidebar',\n\t\t'id' => 'main-sidebar',\n\t\t'before_widget' => '<li id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</li>',\n\t\t'before_title' => '<h2 class=\"sidebar-title\">',\n\t\t'after_title' => '</h2>',\n\t) );\n}", "function arphabet_widgets_init() {\n\tregister_sidebar( array(\n\t\t'name' => 'Event Widget',\n\t\t'id' => 'event_widget',\n\t)\n \t);\n\tregister_sidebar( array(\n\t\t'name' => 'Landing Photo Widget',\n\t\t'id' => 'landingphoto_widget',\n\t)\n \t);\n\tregister_sidebar( array(\n\t\t'name' => 'Gallery Widget',\n\t\t'id' => 'gallery_widget',\n\t)\n\t );\n\t register_sidebar( array(\n\t\t'name' => 'About Widget',\n\t\t'id' => 'about_widget',\n\t)\n \t);\n}", "function caldol_register_nav_sidebar(){\n\n\tregister_sidebar(array(\n\n\t\t\t'name' => 'CALDOL Nav Sidebar',\n\n\t\t\t'id' => 'caldol-nav-sidebar',\n\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\n\t\t\t'after_widget' => '</div>',\n\n\t\t\t'before_title' => '<h4 class=\"widgettitle\">',\n\n\t\t\t'after_title' => '</h4>',\n\n\t));\n\n}", "function wsunews_sides() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Cover Sidebar',\n\t\t'id' => 'side-cover',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<header>',\n\t\t'after_title' => '</header>',\n\t));\n\t\n\tregister_sidebar( array(\n\t\t'name' => 'Local Sidebar',\n\t\t'id' => 'side-local',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<header class=\"widget-header\">',\n\t\t'after_title' => '</header>',\n\t));\n\t\n\tregister_sidebar( array(\n\t\t'name' => 'Events Sidebar',\n\t\t'id' => 'side-events',\n\t\t'before_widget' => '',\n\t\t'after_widget' => '',\n\t\t'before_title' => '<header>',\n\t\t'after_title' => '</header>',\n\t));\n\t\n\tregister_sidebar( array(\n\t\t'name' => 'Athletics Sidebar',\n\t\t'id' => 'side-athletics',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<header class=\"widget-header\">',\n\t\t'after_title' => '</header>',\n\t));\n\t\n\tregister_sidebar( array(\n\t\t'name' => 'Athletics Section',\n\t\t'id' => 'section-athletics',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<header class=\"widget-header\">',\n\t\t'after_title' => '</header>',\n\t));\n\t\n\tregister_sidebar( array(\n\t\t'name' => 'People Sidebar',\n\t\t'id' => 'side-people',\n\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</div>',\n\t\t'before_title' => '<header class=\"widget-header\">',\n\t\t'after_title' => '</header>',\n\t));\n\n}", "function msdlab_homepage_widgets(){\n\tprint '<div id=\"homepage-widgets\" class=\"widget-area\">';\n\tprint '<div class=\"wrap\"><div class=\"row\">';\n dynamic_sidebar('homepage-widgets');\n \tprint '</div></div>';\n\tprint '</div>';\n}", "function ourWidgetsInit(){\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Sidebar',\n\t\t\t'id' => 'sidebar1',\n\t\t\t'before_widget' => '<div class=\"widget-item\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h4 class=\"my-special-class\">',\n\t\t\t'after_title' => '</h4>'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 1',\n\t\t\t'id' => 'footer1'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 2',\n\t\t\t'id' => 'footer2'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 3',\n\t\t\t'id' => 'footer3'\n\t\t));\n\t\tregister_sidebar(array(\n\t\t\t'name' => 'Footer Area 4',\n\t\t\t'id' => 'footer4'\n\t\t));\n\t}", "function parques_widget_init()\n{\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'progress-bar',\n\t\t\t'name'\t\t\t=> 'Barra de progreso',\n\t\t\t'description'\t=> 'Barra de progreso que indica el avance del proyecto',\n\t\t\t'before_widget' => '<div>',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-footer',\n\t\t\t'name'\t\t\t=> \"footer\",\n\t\t\t'description'\t=> 'footer con la infomacion del contacto en todas las pag',\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"col-sm-4\">',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-social',\n\t\t\t'name'\t\t\t=> \"widget-social\",\n\t\t\t'description'\t=> 'Contenido para las redes sociales',\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget-social\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-gallery',\n\t\t\t'name'\t\t\t=> \"widget-gallery\",\n\t\t\t'description'\t=> 'widget para el plugin de galerias',\n\t\t\t'before_widget' => '<div class=\"widget-gallery\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-banner',\n\t\t\t'name'\t\t\t=> \"widget-banner\",\n\t\t\t'description'\t=> 'Banner para parques del rio.',\n\t\t\t'before_widget' => '<div id=\"widget-banner\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-home',\n\t\t\t'name'\t\t\t=> \"widget-home\",\n\t\t\t'description'\t=> 'Contenido relacionado con articulos del sitio.',\n\t\t\t'before_widget' => '<div id=\"widget-home\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-progreso',\n\t\t\t'name'\t\t\t=> \"widget-progreso\",\n\t\t\t'description'\t=> 'Widget con barra de progreso del proyecto.',\n\t\t\t'before_widget' => '<div id=\"widget-progreso\" class=\"hidden-xs\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'widget-categorias',\n\t\t\t'name'\t\t\t=> \"widget-categorias\",\n\t\t\t'description'\t=> 'Widget con categorías del proyecto.',\n\t\t\t'before_widget' => '<div id=\"widget-categorias\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'sidebar',\n\t\t\t'name'\t\t\t=> \"sidebar\",\n\t\t\t'description'\t=> 'Sidebar',\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget-%1$s\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n\n\tregister_sidebar( \n\t\tarray(\n\t\t\t'id' \t\t=> 'nav-menu-narrativa',\n\t\t\t'name'\t\t\t=> \"nav-menu-narrativa\",\n\t\t\t'description'\t=> 'Sidebar',\n\t\t\t'before_widget' => '<div id=\"%1$s\" class=\"widget-%1$s\" >',\n\t\t\t'after_widget' => '</div>',\n\t\t)\n\t);\n}", "function zanblog_widgets_init() {\r\n register_sidebar(array(\r\n 'name' => '幻灯片',\r\n 'before_widget' => '<figure class=\"slide hidden-xs\">',\r\n 'after_widget' => '</figure>'\r\n ));\r\n\r\n register_sidebar(array(\r\n 'name' => '搜索框',\r\n 'before_widget' => '<div class=\"search visible-lg\">',\r\n 'after_widget' => '</div>'\r\n ));\r\n\r\n register_sidebar(array(\r\n 'name' => '最热文章',\r\n 'before_widget' => '',\r\n 'after_widget' => ''\r\n ));\r\n\r\n register_sidebar(array(\r\n 'name' => '最新评论',\r\n 'before_widget' => '',\r\n 'after_widget' => ''\r\n ));\r\n\r\n register_sidebar(array(\r\n 'name' => '最新文章',\r\n 'before_widget' => '',\r\n 'after_widget' => ''\r\n ));\r\n\r\n register_sidebar(array(\r\n 'name' => '分类、标签、友链',\r\n 'before_widget' => '',\r\n 'after_widget' => ''\r\n ));\r\n}", "function cbc_widgets_init() {\n\n\tregister_sidebar( array(\n\t\t'name' => 'Footer bar 1',\n\t\t'id' => 'footer_bar_1',\n\t\t'before_widget' => '<li>',\n\t\t'after_widget' => '</li>',\n\t\t'before_title' => '<h2>',\n\t\t'after_title' => '</h2>',\n\t) );\n\n}", "function arphabet_widgets_init() {\n\tregister_sidebar(\n\t\tarray(\n\t\t\t'name' => 'Counter',\n\t\t\t'id' => 'counter_1',\n\t\t\t'before_widget' => '<div class=\"csc_box\">',\n\t\t\t'after_widget' => '</div>',\n\t\t\t'before_title' => '<h2 class=\"csc_title\">',\n\t\t\t'after_title' => ' <i class=\"fa fa-users\"></i></h2>'\n\t\t)\n\t);\n}", "function uni_add_sidebar_shop() {\n\tregister_sidebar( array(\n\t\t'name' => esc_html__( 'Shop Sidebar', 'shtheme' ),\n\t\t'id' => 'sidebar-shop',\n\t\t'description' => esc_html__( 'Add widgets here.', 'shtheme' ),\n\t\t'before_widget' => '<section id=\"%1$s\" class=\"widget %2$s\">',\n\t\t'after_widget' => '</section>',\n\t\t'before_title' => '<h2 class=\"widget-title\">',\n\t\t'after_title' => '</h2>',\n\t) );\n}" ]
[ "0.8132188", "0.8120824", "0.8034519", "0.79872465", "0.7974055", "0.79628855", "0.79603726", "0.7908758", "0.78789467", "0.7870186", "0.78700227", "0.7851856", "0.78367466", "0.7822457", "0.7807032", "0.7787467", "0.7763582", "0.775756", "0.77496463", "0.7747582", "0.77284884", "0.77127457", "0.769016", "0.76888615", "0.765033", "0.7645302", "0.7644023", "0.7627459", "0.76211417", "0.7618492", "0.760626", "0.75986725", "0.75941193", "0.75896835", "0.7567934", "0.7567335", "0.75613445", "0.75592446", "0.75582534", "0.7532894", "0.753134", "0.7526342", "0.75234294", "0.7520922", "0.750458", "0.7503683", "0.74903154", "0.74797994", "0.7471564", "0.7470144", "0.74685824", "0.7464816", "0.7453316", "0.7452337", "0.7444953", "0.74338454", "0.742845", "0.7427862", "0.74273366", "0.74268335", "0.74171865", "0.7412867", "0.74123526", "0.74118525", "0.74110115", "0.7407619", "0.73867583", "0.73826975", "0.736938", "0.73653525", "0.73622596", "0.7360923", "0.7357934", "0.735765", "0.7350519", "0.7333817", "0.733009", "0.7329257", "0.73241305", "0.7315054", "0.731034", "0.7299086", "0.7298204", "0.72941935", "0.72936463", "0.72932106", "0.7275162", "0.7270395", "0.72686225", "0.7258858", "0.7254661", "0.7254517", "0.72363585", "0.7229757", "0.72291815", "0.7226618", "0.72210646", "0.72148776", "0.7208858", "0.7207489" ]
0.7871527
9
generacion de un custom post type
function products_type() { $labels = array( 'name' => 'Productos', 'singular_name' => 'Producto', 'menu_name' => 'Productos', ); $args = array( 'label' => 'Productos', 'description' => 'Productos de Platzi', 'labels' => $labels, 'supports' => array('title', 'editor', 'thumbnail', 'revisions'), 'public' => true, 'show_in_menu' => true, 'menu_position' => 5, 'menu_icon' => 'dashicons-cart', 'can_export' => true, 'publicly' => true, 'rewrite' => true, 'show_in_rest' => true, ); register_post_type('producto', $args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bf_register_custom_post_type() {\r\n /* Añado las etiquetas que aparecerán en el escritorio de WordPress */\r\n\t$labels = array(\r\n\t\t'name' => _x( 'Ponentes', 'post type general name', 'text-domain' ),\r\n\t\t'singular_name' => _x( 'Ponente', 'post type singular name', 'text-domain' ),\r\n\t\t'menu_name' => _x( 'Ponentes', 'admin menu', 'text-domain' ),\r\n\t\t'add_new' => _x( 'Añadir nuevo', 'ponente', 'text-domain' ),\r\n\t\t'add_new_item' => __( 'Añadir nuevo ponente', 'text-domain' ),\r\n\t\t'new_item' => __( 'Nuevo Ponente', 'text-domain' ),\r\n\t\t'edit_item' => __( 'Editar Ponente', 'text-domain' ),\r\n\t\t'view_item' => __( 'Ver ponente', 'text-domain' ),\r\n\t\t'all_items' => __( 'Todos los ponentes', 'text-domain' ),\r\n\t\t'search_items' => __( 'Buscar ponentes', 'text-domain' ),\r\n\t\t'not_found' => __( 'No hay ponentes.', 'text-domain' ),\r\n\t\t'not_found_in_trash' => __( 'No hay ponentes en la papelera.', 'text-domain' )\r\n\t);\r\n\r\n /* Configuro el comportamiento y funcionalidades del nuevo custom post type */\r\n\t$args = array(\r\n\t\t'labels' => $labels,\r\n\t\t'description' => __( 'Descripción.', 'text-domain' ),\r\n\t\t'public' => true,\r\n\t\t'publicly_queryable' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'show_in_menu' => true,\r\n\t\t'show_in_nav_menus' => true,\r\n\t\t'query_var' => true,\r\n\t\t'rewrite' => array( 'slug' => 'ponente' ),\r\n\t\t'capability_type' => 'post',\r\n\t\t'hierarchical' => false,\r\n\t\t'menu_position' => null,\r\n 'menu_icon' => 'dashicons-businessman',\r\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\r\n\t\t'show_in_rest'\t \t => true,\r\n\t\t'public' \t\t\t => true,\r\n\t\t'has_archive' \t\t => true,\r\n\t\t'taxonomies' => array('category','categoria-conferencias')\r\n\t);\r\n\r\n\tregister_post_type('ponentes', $args );\r\n}", "function thirdtheme_custom_post_type()\n {\n $args = array(\n 'labels' => array('name' =>__(' my custom post'),\n 'singular name' =>__('my custom post')),\n 'public' => true,\n 'show_in_menu' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail'));\n register_post_type('custompost',$args);\n \n }", "public function customPostType()\n {\n\n if (empty($this->custom_post_types)) {\n return;\n }\n\n foreach ($this->custom_post_types as $post_type) {\n register_post_type(\n $post_type['post_type'],\n [\n 'labels' => [\n 'name' => __($post_type['name'], 'vrcoder'),\n 'singular_name' => __($post_type['singular_name'], 'vrcoder'),\n 'menu_name' => __($post_type['name'], 'vrcoder'),\n 'name_admin_bar' => __($post_type['singular_name'], 'vrcoder'),\n 'archives' => __($post_type['singular_name'] . ' Archives', 'vrcoder'),\n 'attributes' => __($post_type['singular_name'] . ' Attributes', 'vrcoder'), \n 'parent_item_colon' => __('Parent ' . $post_type['singular_name'], 'vrcoder'),\n 'all_items' => __('All ' . $post_type['name'], 'vrcoder'),\n 'add_new_item' => __('Add new ' . $post_type['singular_name'], 'vrcoder'),\n 'add_new' => __('Add new', 'vrcoder'),\n 'new_item' => __('New ' . $post_type['singular_name'], 'vrcoder'),\n 'edit_item' => __('Edit ' . $post_type['singular_name'], 'vrcoder'),\n 'update_item' => __('Update' . $post_type['singular_name'], 'vrcoder'),\n 'view_item' => __('View' . $post_type['singular_name'], 'vrcoder'),\n 'view_items' => __('View' . $post_type['name'], 'vrcoder'),\n 'search_items' => __('Search' . $post_type['name'], 'vrcoder'),\n 'not_found' => __('No' . $post_type['singular_name'] . ' Found', 'vrcoder'),\n 'not_found_in_trash' => __('No' . $post_type['singular_name'] . ' Found in Trash', 'vrcoder'),\n 'featured_image' => __('Featured Image', 'vrcoder'),\n 'set_featured_image' => __('Set Featured Image', 'vrcoder'),\n 'remove_featured_image' => __('Remove Featured Image', 'vrcoder'),\n 'use_featured_image' => __('Use Featured Image', 'vrcoder'),\n 'insert_into_item' => __('Insert into' . $post_type['singular_name'], 'vrcoder'),\n 'uploaded_to_this_item' => __('Upload to this' . $post_type['singular_name'], 'vrcoder'),\n 'items_list' => __($post_type['name'] . ' List', 'vrcoder'),\n 'items_list_navigation' => __($post_type['name'] . ' List Navigation', 'vrcoder'),\n 'filter_items_list' => __('Filter' . $post_type['name'] . ' List', 'vrcoder'),\n ],\n 'label' => __($post_type['singular_name'], 'vrcoder'),\n 'description' => __($post_type['name'] . ' Custom Post Type', 'vrcoder'),\n 'supports' => $post_type['supports'],\n 'show_in_rest' => $post_type['show_in_rest'],\n 'taxonomies' => $post_type['taxonomies'],\n 'hierarchical' => $post_type['hierarchical'],\n 'public' => $post_type['public'],\n 'show_ui' => $post_type['show_ui'],\n 'show_in_menu' => $post_type['show_in_menu'],\n 'menu_position' => $post_type['menu_position'],\n 'show_in_admin_bar' => $post_type['show_in_admin_bar'],\n 'show_in_nav_menus' => $post_type['show_in_nav_menus'],\n 'can_export' => $post_type['can_export'],\n 'has_archive' => $post_type['has_archive'],\n 'exclude_from_search' => $post_type['exclude_from_search'],\n 'publicly_queryable' => $post_type['publicly_queryable'],\n 'capability_type' => $post_type['capability_type'],\n 'menu_icon' => $post_type['menu_icon']\n ]\n );\n }\n\n }", "function custom_post_type() {\n\n// Set UI labels for Custom Post Type\n\t$labels = array(\n\t\t'name' => _x( 'Новости', 'Новости сайта', 'p1atform' ),\n\t\t'singular_name' => _x( 'Новость', 'Post Type Singular Name', 'p1atform' ),\n\t\t'menu_name' => __( 'Новости', 'p1atform' ),\n\t\t'parent_item_colon' => __( 'Parent Новость', 'p1atform' ),\n\t\t'all_items' => __( 'Все новости', 'p1atform' ),\n\t\t'view_item' => __( 'Просмотреть новость', 'p1atform' ),\n\t\t'add_new_item' => __( 'Добавить новость', 'p1atform' ),\n\t\t'add_new' => __( 'Добавить новость', 'p1atform' ),\n\t\t'edit_item' => __( 'Редактировать новость', 'p1atform' ),\n\t\t'update_item' => __( 'Обновить новость', 'p1atform' ),\n\t\t'search_items' => __( 'Поиск новости', 'p1atform' ),\n\t);\n\n\t$args = array(\n\t\t'label' => __( 'Отзывы', 'p1atform' ),\n\t\t'description' => __( 'Отзывы', 'p1atform' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array(\n\t\t\t'title',\n\t\t\t'editor',\n\t\t\t'excerpt',\n\t\t\t'author',\n\t\t\t'thumbnail',\n\t\t\t'comments',\n\t\t\t'revisions',\n\t\t\t'custom-fields'\n\t\t),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-format-aside',\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t);\n\n\tregister_post_type( 'news', $args );\n\n\t$labels = array(\n\t\t'name' => _x( 'Клиенты', 'Новости сайта', 'p1atform' ),\n\t\t'singular_name' => _x( 'Клиент', 'Post Type Singular Name', 'p1atform' ),\n\t\t'menu_name' => __( 'Клиенты', 'p1atform' ),\n\t\t'parent_item_colon' => __( 'Парент Клиент', 'p1atform' ),\n\t\t'all_items' => __( 'Все клиенты', 'p1atform' ),\n\t\t'view_item' => __( 'Просмотреть клиента', 'p1atform' ),\n\t\t'add_new_item' => __( 'Добавить клиента', 'p1atform' ),\n\t\t'add_new' => __( 'Добавить клиента', 'p1atform' ),\n\t\t'edit_item' => __( 'Редактировать клиента', 'p1atform' ),\n\t\t'update_item' => __( 'Обновить клиента', 'p1atform' ),\n\t\t'search_items' => __( 'Поиск клиента', 'p1atform' ),\n\t);\n\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'supports' => array(\n\t\t\t'title',\n\t\t\t'editor',\n\t\t\t'excerpt',\n\t\t\t'author',\n\t\t\t'thumbnail',\n\t\t\t'comments',\n\t\t\t'revisions',\n\t\t\t'custom-fields',\n\t\t),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 6,\n\t\t'menu_icon' => 'dashicons-admin-users',\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t);\n\n\tregister_post_type( 'clients', $args );\n\n\tregister_post_type( 'reviews', array(\n\t\t'labels' => array(\n\t\t\t'name' => 'Отзывы', // Основное название типа записи\n\t\t\t'singular_name' => 'Отзыв', // отдельное название записи типа Book\n\t\t\t'add_new' => 'Добавить Отзыв',\n\t\t\t'add_new_item' => 'Добавить Отзыв',\n\t\t\t'edit_item' => 'Редактировать Отзыв',\n\t\t\t'new_item' => 'Новая Отзыв',\n\t\t\t'view_item' => 'Посмотреть Отзыв',\n\t\t\t'search_items' => 'Найти Отзыв',\n\t\t\t'not_found' => 'Книг не найдено',\n\t\t\t'not_found_in_trash' => 'В корзине книг не найдено',\n\t\t\t'parent_item_colon' => '',\n\t\t\t'menu_name' => 'Отзывы'\n\n\t\t),\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => true,\n\t\t'capability_type' => 'post',\n\t\t'has_archive' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-format-chat',\n\t\t'hierarchical' => false,\n\t\t'menu_position' => null,\n\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' )\n\t) );\n\n}", "public function register_qmgt_custom_post() {\r\n\t\trequire_once( QMGT_ROOT . '/qmgt-custom-post-type.php');\r\n\t}", "public function register_custom_post() {\n foreach ( $this->posts as $key => $value ) {\n register_post_type( $key, $value );\n }\n }", "public function flo_reg_custom_post_type(){\n\t\t// call the methods that are registering the post types\n\t\t$this->flo_reg_forms_post_type();\n\t\t$this->flo_reg_entrie_post_type();\n\n\t\t$this->flo_register_form_entries_taxonomy();\n\t}", "public function create_post_type() {\n\t\t\n \t\tregister_post_type(self::POST_TYPE,\n \t\t\tarray(\n \t\t\t\t'labels' => array(\n \t\t\t\t\t'name' => \"Custom\",\n \t\t\t\t\t'singular_name' => __(ucwords(str_replace(\"_\", \" \", self::POST_TYPE)))\n \t\t\t\t),\n \t\t\t\t'public' => true,\n \t\t\t\t'has_archive' => true,\n \t\t\t\t'description' => __(\"This is WP Custom Post Type\"),\n \t\t\t\t'supports' => array('title', 'editor', 'excerpt','thumbnail','custom-fields'),\n \t\t\t)\n \t\t);\n\n\t\t\tregister_taxonomy(\n\t\t\t\t'custom-category',\n\t\t\t\tself::POST_TYPE,\n\t\t\t\tarray(\n\t\t\t\t\t'label' => __( 'Category' ),\n\t\t\t\t\t'rewrite' => array( 'slug' => 'custom-category' ),\n\t\t\t\t\t'hierarchical' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public function register_custom_post_type() {\n $labels = array (\n 'name' => __('Custom', self::$plugin_obj->class_name ),\n 'singular_name' => __('item', self::$plugin_obj->class_name ),\n 'add_new' => __('new item', self::$plugin_obj->class_name ),\n 'add_new_item' => __('new item', self::$plugin_obj->class_name ),\n 'new_item' => __('new item', self::$plugin_obj->class_name ),\n 'edit' => __('edit item', self::$plugin_obj->class_name ),\n 'edit_item' => __('edit item', self::$plugin_obj->class_name ),\n 'view' => __('view item', self::$plugin_obj->class_name ),\n 'view_item' => __('view item', self::$plugin_obj->class_name ),\n 'search_items' => __('search item', self::$plugin_obj->class_name ),\n 'not_found' => __('no item found', self::$plugin_obj->class_name ),\n 'not_found_in_trash' => __('no item in trash', self::$plugin_obj->class_name ),\n 'parent' => __('parent item', self::$plugin_obj->class_name )\n );\n\n $args = array(\n 'labels' => $labels,\n 'public' => TRUE,\n 'publicly_queryable' => TRUE,\n 'show_ui' => TRUE,\n 'show_in_menu' => TRUE,\n 'query_var' => TRUE,\n 'capability_type' => 'page',\n 'has_archive' => TRUE,\n 'hierarchical' => TRUE,\n 'exclude_from_search' => FALSE,\n 'menu_position' => 100 ,\n 'supports' => array('title','editor','excerpt','custom-fields','revisions','thumbnail','page-attributes'),\n 'taxonomies' => array('category','post_tag')\n );\n\n register_post_type('custom', $args);\n }", "public function create_post_types() {\n }", "function tower_custom_post_types() {\n foreach (TOWER_CUSTOM_POSTS as $key => $custom_type) {\n register_post_type($key, $custom_type['config']);\n }\n}", "public function register_post_type()\n {\n $labels = [\n 'name' => _x('Chiro Quizzes', 'post type general name', $this->token),\n 'singular_name' => _x('Chiro Quiz', 'post type singular name', $this->token),\n 'add_new' => _x('Add New', $this->token, $this->token),\n 'add_new_item' => sprintf(__('Add New %s', $this->token), __('Chiro Quiz', $this->token)),\n 'edit_item' => sprintf(__('Edit %s', $this->token), __('Chiro Quiz', $this->token)),\n 'new_item' => sprintf(__('New %s', $this->token), __('Chiro Quiz', $this->token)),\n 'all_items' => sprintf(__('All %s', $this->token), __('Chiro Quizzes', $this->token)),\n 'view_item' => sprintf(__('View %s', $this->token), __('Chiro Quiz', $this->token)),\n 'search_items' => sprintf(__('Search %a', $this->token), __('Chiro Quizzes', $this->token)),\n 'not_found' => sprintf(__('No %s Found', $this->token), __('Chiro Quizzes', $this->token)),\n 'not_found_in_trash' => sprintf(__('No %s Found In Trash', $this->token), __('Chiro Quizzes', $this->token)),\n 'parent_item_colon' => '',\n 'menu_name' => __('Chiro Quizzes', $this->token)\n ];\n\n $slug = __('chiro-quiz', 'pf_chiro_quiz');\n $custom_slug = get_option('pf_chiro_quiz_slug');\n if ($custom_slug && strlen($custom_slug) > 0 && $custom_slug != '') {\n $slug = $custom_slug;\n }\n\n $args = [\n 'labels' => $labels,\n 'public' => true,\n 'publicly_queryable' => true,\n 'exclude_from_search' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'query_var' => true,\n 'rewrite' => ['slug' => $slug],\n 'capability_type' => 'post',\n 'has_archive' => false,\n 'hierarchical' => false,\n 'supports' => ['title'],\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-admin-quiz'\n ];\n\n register_post_type($this->token, $args);\n }", "function add_custom_post_type() \n {\n // add custom type evenementen\n $labels = array(\n 'name' => _x('Quotes', 'post type general name', $this->localization_domain),\n 'singular_name' => _x('Quote', 'post type singular name', $this->localization_domain),\n 'add_new' => _x('Add Quote', 'event', $this->localization_domain),\n 'add_new_item' => __('Add New Quote', $this->localization_domain),\n 'edit_item' => __('Edit Quote', $this->localization_domain),\n 'new_item' => __('New Quote', $this->localization_domain),\n 'view_item' => __('View Quote', $this->localization_domain),\n 'search_items' => __('Search Quotes', $this->localization_domain),\n 'not_found' => __('No Quotes found', $this->localization_domain),\n 'not_found_in_trash' => __('No Quotes found in Trash', $this->localization_domain), \n 'parent_item_colon' => ''\n );\n $type_args = array(\n 'labels' => $labels,\n 'description' => __('bbQuotations offers a simple quotes custom post type. Useful for pull quotes or just random quotes on your site.',\n $this->localization_domain),\n 'public' => false,\n 'publicly_queryable' => false,\n 'show_ui' => true, \n 'query_var' => true,\n 'rewrite' => array('slug' => $this->options['bbquotations-slug']),\n 'capability_type' => 'post',\n 'hierarchical' => false,\n 'menu_position' => 5,\n 'supports' => array('title','editor','author')\n ); \n register_post_type( $this->custom_post_type_name, $type_args);\n }", "function rng_create_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'Post Types Plural', 'Post Type General Name', 'translate_name' ),\n\t\t'singular_name' => _x( 'Post Type Singular', 'Post Type Singular Name', 'translate_name' ),\n\t\t'menu_name' => __( 'Post Types', 'translate_name' ),\n\t\t'name_admin_bar' => __( 'Post Type', 'translate_name' ),\n\t\t'archives' => __( 'Item Archives', 'translate_name' ),\n\t\t'attributes' => __( 'Item Attributes', 'translate_name' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', 'translate_name' ),\n\t\t'all_items' => __( 'All Items', 'translate_name' ),\n\t\t'add_new_item' => __( 'Add New Item', 'translate_name' ),\n\t\t'add_new' => __( 'Add New', 'translate_name' ),\n\t\t'new_item' => __( 'New Item', 'translate_name' ),\n\t\t'edit_item' => __( 'Edit Item', 'translate_name' ),\n\t\t'update_item' => __( 'Update Item', 'translate_name' ),\n\t\t'view_item' => __( 'View Item', 'translate_name' ),\n\t\t'view_items' => __( 'View Items', 'translate_name' ),\n\t\t'search_items' => __( 'Search Item', 'translate_name' ),\n\t\t'not_found' => __( 'Not found', 'translate_name' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'translate_name' ),\n\t\t'featured_image' => __( 'Featured Image', 'translate_name' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'translate_name' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'translate_name' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'translate_name' ),\n\t\t'insert_into_item' => __( 'Insert into item', 'translate_name' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'translate_name' ),\n\t\t'items_list' => __( 'Items list', 'translate_name' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'translate_name' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'translate_name' ),\n\t);\n\t$args = array(\n 'public' => true,\n\t\t'label' => __( 'Post Type Singular', 'translate_name' ),\n\t\t'description' => __( 'Post Type Description', 'translate_name' ),\n 'labels' => $labels,\n 'exclude_from_search' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_menu'\t\t\t=> true,\n\t\t'show_in_admin_bar'\t\t=> true,\n\t\t'menu_position'\t\t\t=> 5,\n\t\t// 'menu_icon' \t\t\t=> get_bloginfo('template_directory') . '/images/portfolio-icon.png',\n\t\t'menu_icon'\t\t\t\t=> 'dashicon-groups',\n\t\t'has_archive'\t\t\t=> true,\n\t\t'capability_type'\t\t=> array('book','books'),\n\t\t'capabilities' \t\t\t=> array(\n\t\t\t'edit_post' => 'edit_book', \n\t\t\t'read_post' => 'read_book', \n\t\t\t'delete_post' => 'delete_book', \n\t\t\t'edit_posts' => 'edit_books', \n\t\t\t'edit_others_posts' => 'edit_others_books', \n\t\t\t'publish_posts' => 'publish_books', \n\t\t\t'read_private_posts' => 'read_private_books', \n\t\t\t'create_posts' => 'edit_books', \n\t\t),\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes', 'post-formats' ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => true,\n\t);\n\tregister_post_type( 'book', $args );\n\n}", "function create_post_type() {\r\n\r\n\tregister_post_type( 'Editorials',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t'name' => __( 'Editorials' ),\r\n\t\t\t\t'singular_name' => __( 'Editorial' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'editorials'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n\tregister_post_type( 'Local news',\r\n\t// CPT Options\r\n\t\tarray(\r\n\t\t\t'labels' => array(\r\n\t\t\t\t\r\n\t\t\t\t'name' => __( 'Local news' ),\r\n\t\t\t\t'singular_name' => __( 'Local new' )\r\n\t\t\t),\r\n\t\t\t'public' => true,\r\n\t\t\t'has_archive' => true,\r\n\t\t\t'rewrite' => array('slug' => 'local news'),\r\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'revisions', 'comments' ),\r\n \t'show_ui' => true,\r\n\t\t)\r\n\t);\r\n}", "public function post_type() {\n\t\t$labels = array(\n\t\t\t'name' => __( 'Departamentos'),\n\t\t\t'singular_name' => __( 'Departamento' ),\n\t\t\t'add_new' => __('Añadir nuevo'),\n\t\t\t'add_new_item' => __('Añadir nuevo Departamento'),\n\t\t\t'edit_item' => __('Editar Departamento'),\n\t\t\t'new_item' => __('Nuevo Departamento'),\n\t\t\t'view_item' => __('Ver Departamento'),\n\t\t\t'search_items' => __('Buscar'),\n\t\t\t'not_found' => __('No se encontraron Departamentos'),\n\t\t\t'not_found_in_trash' => __('No se encontraron Departamentos en la Papelera'), \n\t\t\t'parent_item_colon' => ''\n\t\t );\n\t\t \n\t\t $args = array(\n\t\t\t'labels' => $labels,\n\t\t\t'public' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true, \n\t\t\t'query_var' => true,\n\t 'has_archive' => true,\n\t\t\t'capability_type' => 'post',\n\t\t\t'hierarchical' => true,\n\t\t 'show_ui' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t 'show_in_menu' => 'bn_config',\n\t\t\t'menu_position' => 57,\n\t\t\t'menu_icon' => 'dashicons-clipboard',\n\t\t\t'rewrite' => array('slug' => __( $this->post_type )),\n\t\t\t'supports' => array('title', 'excerpt', 'page-attributes') //,'editor'\n\t\t );\n\t\t \n\t\t register_post_type(__( $this->post_type ), $args);\n\t}", "public static function post_type(){}", "public function generate_post_type() {\n\t\t$doc_types = get_option( 'ibx_docs_type' );\n\t\t$doc_types = maybe_unserialize( $doc_types );\n\n\t\tif ( empty( $doc_types ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$count = 1;\n\n\t\tforeach ( $doc_types as $option ) {\n\t\t\t$labels = array(\n\t\t\t\t'name' => _x( $option['title'], 'Post type general name', 'plugintest' ),\n\t\t\t\t'singular_name' => _x( $option['title'], 'Post type singular name', 'plugintest' ),\n\t\t\t);\n\n\t\t\t$args = array(\n\t\t\t\t'labels' => $labels,\n\t\t\t\t'public' => true,\n\t\t\t\t'publicly_queryable' => true,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'show_in_menu' => true,\n\t\t\t\t'query_var' => true,\n\t\t\t\t'rewrite' => array( 'slug' => $option['slug'] ),\n\t\t\t\t'capability_type' => 'post',\n\t\t\t\t'hierarchical' => false,\n\t\t\t\t'has_archive' => true,\n\t\t\t);\n\n\t\t\tregister_post_type( $option['slug'], $args );\n\t\t\t// add_rewrite_rule( '^docs/' . $option['slug'] . '/([^/]+)/?$', 'index.php?post_type=' . $option['slug'] . '&name=$matches[1]', 'top' );\n\t\t\t//add_rewrite_rule( '^docs/' . $option['slug'], 'index.php?post_type=' . $option['slug'], 'top' );\n\t\t\tadd_rewrite_rule( 'ibx/' . $option['slug'] . '/(.*)/?$', 'index.php?' . $option['slug'] . '=$matches[1]', 'top' );\n\t\t\tadd_rewrite_rule( 'ibx/' . $option['slug'], 'index.php?post_type=' . $option['slug'], 'top' );\n\n\t\t\t$category_labels = array(\n\t\t\t\t'name' => esc_html__( 'Categories', 'plugintest' ),\n\t\t\t\t'singular_name' => esc_html__( 'Category', 'plugintest' ),\n\t\t\t);\n\n\t\t\t$category_args = array(\n\t\t\t\t'hierarchical' => true,\n\t\t\t\t'public' => true,\n\t\t\t\t'labels' => $category_labels,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'show_admin_column' => true,\n\t\t\t\t'has_archive' => true,\n\t\t\t\t'rewrite' => array( 'slug' => 'category-' . $count ),\n\t\t\t);\n\n\t\t\tregister_taxonomy( 'cat-' . $option['slug'], $option['slug'], $category_args );\n\t\t\tadd_rewrite_rule( 'ibx/cat-' . $option['slug'] . '/(.*)/?$', 'index.php?cat-' . $option['slug'] . '=$matches[1]', 'top' );\n\n\t\t\t$count++;\n\t\t}\n\t\tflush_rewrite_rules();\n\t}", "function add_my_custom_posttype_recepten(){\n //LABELS DIFINIËREN\n $labels = array(\n 'add_new' => 'Voeg nieuw recept toe',\n 'add_new_item' => 'Voeg nieuw recept toe',\n 'name' => 'Recepten',\n 'singular_name' => 'recept',\n );\n //ARGUMENTEN DIFINIËREN\n $args = array(\n 'labels' => $labels, // de array labels van hier boven linken aan het argument labels\n 'Description' => 'Lactosevrije recepten van B & J',\n 'public' => true,\n 'menu_position' => 4,\n 'menu_icon' => 'dashicons-book-alt', //Een icoon kiezen\n 'supports' => array('title', 'editor', 'thumbnail', 'page-attributes', 'comments'), \n 'has_archive' => true, //Maak een archief aan (opsomming van alle elementen), anders gaan we archive-recepten.php nooit kunnen aanspreken.\n 'show_in_nav_menus' => TRUE,\n\n );\n\n register_post_type( 'recepten', $args ); \n \n }", "function wpmudev_create_post_type() {\n\t$labels = array(\n \t\t'name' => 'Actividades',\n \t'singular_name' => 'Actividad',\n \t'add_new' => 'Añade Nueva Actividad',\n \t'add_new_item' => 'Añade una nueva Actividad',\n \t'edit_item' => 'Edita la Actividad',\n \t'new_item' => 'Nueva Actividad',\n \t'all_items' => 'Todas las Actividades',\n \t'view_item' => 'Ver Actividad',\n \t'search_items' => 'Buscar Actividades',\n \t'not_found' => 'No se han encontrado Actividades',\n \t'not_found_in_trash' => 'No se han encontrado Actividades en la Papelera', \n \t'parent_item_colon' => '',\n \t'menu_name' => 'Actividades',\n );\n \n $args = array(\n\t\t'labels' => $labels,\n\t\t'has_archive' => true,\n \t\t'public' => true,\n\t\t'supports' => array( 'title', 'custom-fields', 'thumbnail', 'comments', 'page-attributes', 'author' ),\n\t\t'exclude_from_search' => false,\n\t\t'capability_type' => 'post',\n\t\t//'map_meta_caps' => true,\n\t\t'rewrite' => array( 'slug' => 'actividades' ),\n\t);\n\t\n\tregister_post_type( 'actividad', $args );\n}", "public function createPostTypes()\n {\n }", "function medarbejder_custom_post_type() {\n $labels = array(\n 'name' => _x( 'Medarbejdere', 'Post Type General Name', 'webstarters' ),\n 'singular_name' => _x( 'Medarbejder', 'Post Type Singular Name', 'webstarters' ),\n 'menu_name' => __( 'Medarbejdere', 'webstarters' ),\n 'parent_item_colon' => __( 'Forældre medarbejder', 'webstarters' ),\n 'all_items' => __( 'Alle medarbejdere', 'webstarters' ),\n 'view_item' => __( 'Se medarbejder', 'webstarters' ),\n 'add_new_item' => __( 'Tilføj ny medarbejder', 'webstarters' ),\n 'add_new' => __( 'Tilføj ny medarbejder', 'webstarters' ),\n 'edit_item' => __( 'Redigere medarbejder', 'webstarters' ),\n 'update_item' => __( 'Opdatere medarbejder', 'webstarters' ),\n 'search_items' => __( 'Søg efter medarbejder', 'webstarters' ),\n 'not_found' => __( 'Not Found', 'webstarters' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'webstarters' ),\n );\n\n// Set other options for Custom Post Type\n\n $args = array(\n 'label' => __( 'medarbejder', 'webstarters' ),\n 'description' => __( 'Custom post type til byggegrunde', 'webstarters' ),\n 'labels' => $labels,\n // Features this CPT supports in Post Editor\n 'supports' => array( 'title', 'thumbnail', 'custom-fields', ),\n // You can associate this CPT with a taxonomy or custom taxonomy.\n 'taxonomies' => array(),\n /* A hierarchical CPT is like Pages and can have\n * Parent and child items. A non-hierarchical CPT\n * is like Posts.\n */\n 'hierarchical' => false,\n 'public' => false,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => false,\n 'exclude_from_search' => false,\n 'publicly_queryable' => false,\n 'capability_type' => 'page',\n );\n\n // Registering your Custom Post Type\n register_post_type( 'medarbejder', $args );\n\n}", "function add_my_custom_posttype_waarden(){\n //LABELS DIFINIËREN\n $labels = array(\n 'add_new' => 'Voeg nieuwe waarde toe',\n 'add_new_item' => 'Voeg nieuwe waarde toe',\n 'name' => 'waarden',\n 'singular_name' => 'waarden',\n );\n //ARGUMENTEN DIFINIËREN\n $args = array(\n 'labels' => $labels, // de array labels van hier boven linken aan het argument labels\n 'Description' => 'waarden van Ben & Jerry',\n 'public' => true,\n 'menu_position' => 6,\n 'menu_icon' => 'dashicons-layout', //Een icoon kiezen\n 'supports' => array('title', 'editor', 'thumbnail'), \n 'has_archive' => true, //Maak een archief aan (opsomming van alle elementen), anders gaan we archive-waarden.php nooit kunnen aanspreken.\n 'show_in_nav_menus' => TRUE,\n \n );\n register_post_type( 'waarden', $args ); \n }", "public function add_custom_post_types() {\n //\n }", "function productos_type(){\n\n $labels = array(\n 'name' => 'Productos',\n 'singular_name' => 'Producto',\n // define el nombre en el menú\n 'menu_name' => 'Productos'\n );\n $args = array(\n 'label' => 'productos',\n 'description' => 'productos de platzi',\n 'labels' => $labels,\n // supports hace referencia a los skils que tendrá este custon type\n 'supports' => array('title', 'editor', 'thumbnail', 'revisions'),\n // Define el estado de publicación borrador false, publicadas true\n 'public' =>true,\n // define si el custon type puede usarse desde los menus\n 'taxonomies' => array( 'category', 'post_tag' ),\n 'show_in_menu' =>true,\n // en qué posición se colocará en el menu\n 'menu_position' => 5,\n // icono del custon type\n // repositorio: https://developer.wordpress.org/resource/dashicons/#cart\n 'menu_icon' => 'dashicons-cart',\n 'can_export' => true,\n // Puede hacerse un loop personalizado\n 'publicly_queryable' => true,\n // hace que tenga una URL asignada\n 'rewrite' =>true,\n // genera el editor de codigo gutember\n 'show_in_rest' => true,\n );\n // es la función que me crea el custon_type\n register_post_type( 'producto', $args );\n}", "function create_post_type() {\n\tregister_post_type( 'Architects', array(\n\t\t'labels' => array(\n\t\t\t'name' => __( 'Architects' ),\n\t\t\t'singular_name' => __( 'Architect' ),\n\t\t\t'add_new_item' => __( 'Add architect' ),\n\t\t\t'edit' => __( 'Edit' ),\n\t\t\t'edit_item' => __( 'Edit this architect' ),\n\t\t\t'new_item' => __( 'New architect' ),\n\t\t\t'view' => __( 'View architect' ),\n\t\t\t'view_item' => __( 'View this architect' ),\n\t\t\t'search_items' => __( 'Search architects' ),\n\t\t\t'not_found' => __( 'No architect was found' ),\n\t\t\t'not_found_in_trash' => __( 'No architects in the trash' ),\n\t\t\t'parent' => __( 'Parent' )\n\t\t),\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'exclude_from_search' => false,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => get_template_directory_uri() . '/images/icon-post.type-integrantes.png',\n\t\t'hierarchical' => true, // if true this post type will be as pages\n\t\t'query_var' => true,\n\t\t'supports' => array('title', 'editor','excerpt','custom-fields','author','page-attributes','trackbacks'),\n\t\t'rewrite' => array('slug'=>'architect','with_front'=>false),\n\t\t'can_export' => true,\n\t\t'_builtin' => false,\n\t\t'_edit_link' => 'post.php?post=%d',\n\t));\n\t// Remotes custom post type\n\tregister_post_type( 'Remotes', array(\n\t\t'labels' => array(\n\t\t\t'name' => __( 'Projects' ),\n\t\t\t'singular_name' => __( 'Project' ),\n\t\t\t'add_new_item' => __( 'Add projects' ),\n\t\t\t'edit' => __( 'Edit' ),\n\t\t\t'edit_item' => __( 'Edit this project' ),\n\t\t\t'new_item' => __( 'New project' ),\n\t\t\t'view' => __( 'View project' ),\n\t\t\t'view_item' => __( 'View this project' ),\n\t\t\t'search_items' => __( 'Search project' ),\n\t\t\t'not_found' => __( 'No project was found' ),\n\t\t\t'not_found_in_trash' => __( 'No project in the trash' ),\n\t\t\t'parent' => __( 'Parent' )\n\t\t),\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'exclude_from_search' => false,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => get_template_directory_uri() . '/images/icon-post.type-integrantes.png',\n\t\t'hierarchical' => false, // if true this post type will be as pages\n\t\t'query_var' => true,\n\t\t'supports' => array('title', 'editor','excerpt','custom-fields','author','comments','trackbacks'),\n\t\t'rewrite' => array('slug'=>'project','with_front'=>false),\n\t\t'can_export' => true,\n\t\t'_builtin' => false,\n\t\t'_edit_link' => 'post.php?post=%d',\n\t));\n\t// Scienticic custom post type\n\tregister_post_type( 'scientifics', array(\n\t\t'labels' => array(\n\t\t\t'name' => __( 'Scientifics' ),\n\t\t\t'singular_name' => __( 'Scientific' ),\n\t\t\t'add_new_item' => __( 'Add scientific' ),\n\t\t\t'edit' => __( 'Edit' ),\n\t\t\t'edit_item' => __( 'Edit this scientific' ),\n\t\t\t'new_item' => __( 'New scientific' ),\n\t\t\t'view' => __( 'View scientific' ),\n\t\t\t'view_item' => __( 'View this scientific' ),\n\t\t\t'search_items' => __( 'Search scientific' ),\n\t\t\t'not_found' => __( 'No scientific was found' ),\n\t\t\t'not_found_in_trash' => __( 'No scientifics in the trash' ),\n\t\t\t'parent' => __( 'Parent' )\n\t\t),\n\t\t'public' => true,\n\t\t'publicly_queryable' => true,\n\t\t'exclude_from_search' => false,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => get_template_directory_uri() . '/images/icon-post.type-integrantes.png',\n\t\t'hierarchical' => true, // if true this post type will be as pages\n\t\t'query_var' => true,\n\t\t'supports' => array('title', 'editor','excerpt','custom-fields','author','page-attributes','trackbacks'),\n\t\t'rewrite' => array('slug'=>'scientific','with_front'=>false),\n\t\t'can_export' => true,\n\t\t'_builtin' => false,\n\t\t'_edit_link' => 'post.php?post=%d',\n\t));\n\n}", "public function create_post_type() {\n\n register_post_type( self::POST_TYPE,\n array(\n\n 'labels' => array(\n 'name' => __( 'Fundraisers' ),\n 'singular_name' => __( 'Fundraiser' )\n ),\n 'description' => 'Fundraisers that allow users to purchase items through the WooCommerce Stores',\n 'menu_icon' => 'dashicons-chart-line',\n 'supports' => array( 'title', 'editor', 'thumbnail', 'excerpt',\n 'revisions' ),\n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array(\n 'slug' => __( 'fundraisers' ),\n 'with_front' => false\n )\n )\n );\n }", "private function initCustomPostType(){\n //Instantiate our custom post type object\n $this->cptWPDS = new PostType($this->wpdsPostType);\n \n //Set our custom post type properties\n $this->cptWPDS->setSingularName($this->wpdsPostTypeName);\n $this->cptWPDS->setPluralName($this->wpdsPostTypeNamePlural);\n $this->cptWPDS->setMenuName($this->wpdsPostTypeNamePlural);\n $this->cptWPDS->setLabels('Add New', 'Add New '.$this->wpdsPostTypeName, 'Edit '.$this->wpdsPostTypeName, 'New '.$this->wpdsPostTypeName, 'All '.$this->wpdsPostTypeNamePlural, 'View '.$this->wpdsPostTypeNamePlural, 'Search '.$this->wpdsPostTypeNamePlural, 'No '.strtolower($this->wpdsPostTypeNamePlural).' found', 'No '.strtolower($this->wpdsPostTypeNamePlural).' found in the trash');\n $this->cptWPDS->setMenuIcon('dashicons-welcome-write-blog');\n $this->cptWPDS->setSlug($this->wpdsPostType);\n $this->cptWPDS->setDescription('Writings from the universe');\n $this->cptWPDS->setShowInMenu(true);\n $this->cptWPDS->setPublic(true);\n $this->cptWPDS->setTaxonomies([$this->wpdsPostType]);\n $this->cptWPDS->removeSupports(['title']);\n \n //Register custom post type\n $this->cptWPDS->register();\n }", "function wpm_actus_post_type() {\n\n\t// On rentre les différentes dénominations de notre custom post type qui seront affichées dans l'administration\n\t$labels = array(\n\t\t// Le nom au pluriel\n\t\t'name' => _x( 'Actus', 'Post Type General Name'),\n\t\t// Le nom au singulier\n\t\t'singular_name' => _x( 'Actu', 'Post Type Singular Name'),\n\t\t// Le libellé affiché dans le menu\n\t\t'menu_name' => __( 'Actus'),\n\t\t// Les différents libellés de l'administration\n\t\t'all_items' => __( 'Toutes les actus'),\n\t\t'view_item' => __( 'Voir les actus'),\n\t\t'add_new_item' => __( 'Ajouter une actu'),\n\t\t'add_new' => __( 'Ajouter'),\n\t\t'edit_item' => __( 'Editer'),\n\t\t'update_item' => __( 'Modifier'),\n\t\t'search_items' => __( 'Rechercher'),\n\t\t'not_found' => __( 'Non trouvée'),\n\t\t'not_found_in_trash' => __( 'Non trouvée dans la corbeille'),\n\t);\n\n\t// On peut définir ici d'autres options pour notre custom post type\n\n\t$args = array(\n\t\t'label' => __( 'Actus'),\n\t\t'description' => __( 'Toutes les actus'),\n\t\t'labels' => $labels,\n\t\t// On définit les options disponibles dans l'éditeur de notre custom post type ( un titre, un auteur...)\n\t\t'supports' => array( 'title', 'thumbnail' ),\n\t\t/*\n\t\t* Différentes options supplémentaires\n\t\t*/\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'has_archive' => true,\n\t\t'rewrite'\t\t\t => array( 'slug' => 'actus'),\n\n\t);\n\n\t// On enregistre notre custom post type qu'on nomme ici \"serietv\" et ses arguments\n\tregister_post_type( 'actus', $args );\n\n}", "public function register_post_type(){\r\n //Capitilize the words and make it plural\r\n $name = ucwords( str_replace( '_', ' ', $this->post_type_name ) );\r\n $plural = $name . 's';\r\n $menupos = $this->post_type_pos;\r\n\r\n // We set the default labels based on the post type name and plural. We overwrite them with the given labels.\r\n $labels = array_merge(\r\n\r\n // Default\r\n array(\r\n 'name' => _x( $plural, 'post type general name' ),\r\n 'singular_name' => _x( $name, 'post type singular name' ),\r\n 'add_new' => _x( 'Add New', strtolower( $name ) ),\r\n 'add_new_item' => __( 'Add New ' . $name ),\r\n 'edit_item' => __( 'Edit ' . $name ),\r\n 'new_item' => __( 'New ' . $name ),\r\n 'all_items' => __( 'All ' . $plural ),\r\n 'view_item' => __( 'View ' . $name ),\r\n 'search_items' => __( 'Search ' . $plural ),\r\n 'not_found' => __( 'No ' . strtolower( $plural ) . ' found'),\r\n 'not_found_in_trash' => __( 'No ' . strtolower( $plural ) . ' found in Trash'),\r\n 'parent_item_colon' => '',\r\n 'menu_name' => $plural\r\n ),\r\n\r\n // Given labels\r\n $this->post_type_labels\r\n\r\n );\r\n\r\n // Same principle as the labels. We set some defaults and overwrite them with the given arguments.\r\n $args = array_merge(\r\n\r\n // Default\r\n array(\r\n 'capability_type' => 'post',\r\n 'hierarchical' => false,\r\n 'label' => $plural,\r\n 'labels' => $labels,\r\n 'menu_position' => $menupos,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array('slug' => $plural),\r\n 'show_in_nav_menus' => true,\r\n 'show_ui' => true,\r\n 'supports' => array( 'title', 'editor'),\r\n '_builtin' => false,\r\n ),\r\n\r\n // Given args\r\n $this->post_type_args\r\n\r\n );\r\n\r\n // Register the post type\r\n register_post_type( $this->post_type_name, $args );\r\n }", "function planoType() {\r\n\t$labels = array(\r\n\t\t'name' => _x('Planos', 'post type general name'),\r\n\t 'singular_name' => _x('Plano', 'post type singular name'),\r\n\t 'add_new' => _x('Adicionar Novo', 'slideshow item'),\r\n\t 'add_new_item' => __('Adicionar Novo Plano'),\r\n\t 'edit_item' => __('Editar Plano'),\r\n\t 'new_item' => __('Novo Plano'),\r\n\t 'view_item' => __('Ver Plano'),\r\n\t 'search_items' => __('Procurar Plano'),\r\n\t 'not_found' => __('Nenhum Plano Encontrado'),\r\n\t 'not_found_in_trash' => __('Nenhum Plano na Lixeira'),\r\n\t 'parent_item_colon' => ''\r\n\t);\r\n\r\n $args = array(\r\n 'labels' => $labels,\r\n 'public' => true,\r\n 'publicly_queryable' => true,\r\n 'show_ui' => true,\r\n 'query_var' => true,\r\n 'rewrite' => true,\r\n 'capability_type' => 'post',\r\n 'hierarchical' => false,\r\n 'menu_position' => 4,\r\n 'supports' => array('title','editor'),\r\n 'rewrite' => array('slug' => 'plano')\r\n );\r\n\r\n register_post_type( 'plano' , $args ); # registering the new post type\r\n}", "function wpbm_register_post_type(){\n include('inc/admin/register/wpbm-register-post.php');\n register_post_type( 'WP Blog Manager', $args );\n }", "function itinerario_post_type() {\n \n $labels = array(\n 'name' => _x( 'itinerario', 'Post Type General Name', 'text_domain' ),\n 'singular_name' => _x( 'Itinerario', 'Post Type Singular Name', 'text_domain' ),\n 'menu_name' => __( 'Itinerarios', 'text_domain' ),\n 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n 'all_items' => __( 'Todos', 'text_domain' ),\n 'view_item' => __( 'Ver Itinerario', 'text_domain' ),\n 'add_new_item' => __( 'Nuevo Itinerario', 'text_domain' ),\n 'add_new' => __( 'Nuevo', 'text_domain' ),\n 'edit_item' => __( 'Editar', 'text_domain' ),\n 'update_item' => __( 'Actualizar', 'text_domain' ),\n 'search_items' => __( 'Buscar', 'text_domain' ),\n 'not_found' => __( 'No se encontró', 'text_domain' ),\n 'not_found_in_trash' => __( 'No se encontró en la papelera', 'text_domain' ),\n );\n $args = array(\n 'label' => __( 'Itinerarios', 'text_domain' ),\n 'description' => __( 'Post Type Description', 'text_domain' ),\n 'labels' => $labels,\n 'supports' => array( ),\n 'taxonomies' => array( 'category', 'post_tag' ),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => false,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-palmtree',\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n 'rewrite' => true,\n 'supports' => array('title', 'editor', 'thumbnail', 'comments', 'slug'),\n );\n register_post_type( 'itinerario', $args );\n \n }", "function custom_post_type() {\n\t$labels = array(\n\t\t'name' => __( 'Post', 'themeSlug' ),\n\t\t'singular_name' => __( 'Post', 'themeSlug' ),\n\t\t'menu_name' => __( 'Post', 'themeSlug' ),\n\t\t'all_items' => __( 'All Post', 'themeSlug' ),\n\t\t'add_new' => __( 'Add New', 'themeSlug' ),\n\t\t'add_new_item' => __( 'Add New Post', 'themeSlug' ),\n\t\t'edit_item' => __( 'Edit Post', 'themeSlug' ),\n\t\t'new_item' => __( 'New Item', 'themeSlug' ),\n\t\t'view_item' => __( 'View Post', 'themeSlug' ),\n\t\t'search_items' => __( 'Search Post', 'themeSlug' ),\n\t\t'not_found' => __( 'No Post Found', 'themeSlug' ),\n\t\t'not_found_in_trash' => __( 'No Post in trash', 'themeSlug' ),\n\t\t'parent_item_colon' => __( 'Parent Post', 'themeSlug' ),\n\t\t'archives' => __( 'Post Archives', 'themeSlug' ),\n\t\t'insert_into_item' => __( 'Insert into Post', 'themeSlug' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this Post', 'themeSlug' ),\n\t\t'filter_items_list' => __( 'Filter Post List', 'themeSlug' ),\n\t\t'items_list_navigation' => __( 'Post list navigation', 'themeSlug' ),\n\t\t'items_list' => __( 'Post List', 'themeSlug' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'Post', 'text_domain' ),\n\t\t'description' => __( 'Post', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor' ),\n\t\t'hierarchical' => false,\n\t\t'public' => false,\n\t\t'publicly_queryable' => false,\n\t\t'show_ui' => true,\n\t\t'show_in_rest' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 6,\n\t\t'menu_icon' => 'dashicons-format-status',\n\t\t'exclude_from_search' => false,\n\t\t'capability_type' => 'post',\n\t\t'rewrite' => array(\n\t\t\t'slug' => 'cpt',\n\t\t\t'with_front' => true,\n\t\t),\n\t);\n\n\tregister_post_type( 'cpt', $args );\n}", "function theme_custom_post_type() {\n\tregister_post_type( 'custom_type',\n\n\t\t// Array with all the options for the custom post type\n\t\tarray( 'labels' => array(\n\t\t\t'name'\t\t\t\t\t=> __( 'Custom Types' ), // Name of the custom post type group\n\t\t\t'singular_name'\t\t\t=> __( 'Custom Post' ), // Name of the custom post type singular\n\t\t\t'all_items'\t\t\t\t=> __( 'All Custom Posts' ),\n\t\t\t'add_new' \t\t\t\t=> __( 'Add New' ),\n\t\t\t'add_new_item' \t\t\t=> __( 'Add New Custom Type' ),\n\t\t\t'edit'\t\t\t\t\t=> __( 'Edit' ),\n\t\t\t'edit_item'\t\t\t\t=> __( 'Edit Post Types' ),\n\t\t\t'new_item'\t\t\t\t=> __( 'New Post Type' ),\n\t\t\t'view_item'\t\t\t\t=> __( 'View Post Type' ),\n\t\t\t'search_items'\t\t\t=> __( 'Search Post Type' ),\n\t\t\t'not_found'\t\t\t\t=> __( 'Nothing found in the Database.' ),\n\t\t\t'not_found_in_trash'\t=> __( 'Nothing found in Trash' ),\n\t\t\t'parent_item_colon' \t=> ''\n\t\t\t),\n\n\t\t\t'description' \t\t\t=> __( 'This is the example custom post type' ), // Custom post type description\n\t\t\t'public' \t\t\t\t=> true,\n\t\t\t'publicly_queryable' \t=> true,\n\t\t\t'exclude_from_search' \t=> false,\n\t\t\t'show_ui' \t\t\t\t=> true,\n\t\t\t'query_var' \t\t\t=> true,\n\t\t\t'menu_position' \t\t=> 5, // The order the custom post type appears on the admin menu\n\t\t\t// 'menu_icon' \t\t\t=> get_stylesheet_directory_uri() . '/assets/images/custom-post-icon.png',\n\t\t\t'rewrite'\t\t\t\t=> array( 'slug' => 'custom_type', 'with_front' => false ), // You may specify its url slug\n\t\t\t'has_archive' \t\t\t=> 'custom_type', // You mary rename the slug here\n\t\t\t'capability_type' \t\t=> 'post',\n\t\t\t'hierarchical' \t\t\t=> false,\n\n\t\t\t// Enable post editor support\n\t\t\t'supports' => array(\n\t\t\t\t'title',\n\t\t\t\t'editor',\n\t\t\t\t'author',\n\t\t\t\t'thumbnail',\n\t\t\t\t'excerpt',\n\t\t\t\t'trackbacks',\n\t\t\t\t'custom-fields',\n\t\t\t\t'comments',\n\t\t\t\t'revisions',\n\t\t\t\t'sticky'\n\t\t\t)\n\t\t)\n\t);\n\n\t// This adds your post categories to your custom post type\n\tregister_taxonomy_for_object_type( 'category', 'custom_type' );\n\n\t// This adds your post tags to your custom post type\n\tregister_taxonomy_for_object_type( 'post_tag', 'custom_type' );\n\n}", "public function registerCustomPostTypes() {\n\n\n }", "function custom_post_type() {\n $labels = array(\n 'name' => _x( 'Ort', 'Post Type General Name', 'twentythirteen' ),\n 'singular_name' => _x( 'Ort', 'Post Type Singular Name', 'twentythirteen' ),\n 'menu_name' => __( 'Orter', 'twentythirteen' ),\n 'all_items' => __( 'Alla Orter', 'twentythirteen' ),\n 'view_item' => __( 'View Ort', 'twentythirteen' ),\n 'add_new_item' => __( 'Skapa ny Ort', 'twentythirteen' ),\n 'add_new' => __( 'Skapa ny Ort', 'twentythirteen' ),\n 'edit_item' => __( 'Redigera Ort', 'twentythirteen' ),\n 'update_item' => __( 'Upddatera Ort', 'twentythirteen' ),\n 'search_items' => __( 'Sök Ort', 'twentythirteen' ),\n 'not_found' => __( 'Not Found', 'twentythirteen' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'twentythirteen' ),\n );\n \n $args = array(\n 'label' => __( 'cities', 'twentythirteen' ),\n 'description' => __( 'City Post Page', 'twentythirteen' ),\n 'labels' => $labels,\n 'supports' => array('title','thumbnail',),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n \n register_post_type( 'cities', $args );\n\n }", "public static function createPostType() {\n $plural = 'Travel Cards';\n $singular = 'Travel Card';\n $p_lower = strtolower($plural);\n $s_lower = strtolower($singular);\n\n $labels = [\n 'name' => $plural,\n 'singular_name' => $singular,\n 'add_new_item' => \"New $singular\",\n 'edit_item' => \"Edit $singular\",\n 'view_item' => \"View $singular\",\n 'view_items' => \"View $plural\",\n 'search_items' => \"Search $plural\",\n 'not_found' => \"No $p_lower found\",\n 'not_found_in_trash' => \"No $p_lower found in trash\",\n 'parent_item_colon' => \"Parent $singular\",\n 'all_items' => \"All $plural\",\n 'archives' => \"$singular Archives\",\n 'attributes' => \"$singular Attributes\",\n 'insert_into_item' => \"Insert into $s_lower\",\n 'uploaded_to_this_item' => \"Uploaded to this $s_lower\",\n ];\n\n $supports = ['title', 'editor', 'thumbnail', 'excerpt'];\n\n register_post_type( 'travelcard',\n array(\n 'rewrite' => ['slug' => 'travelcard'],\n 'taxonomies' => array('card_category', 'card_tag'),\n 'register_meta_box_cb' => [self::class, 'addMetaBox'],\n 'labels' => $labels,\n 'public' => true,\n 'has_archive' => false,\n 'menu_icon' => 'dashicons-id',\n 'supports' => $supports,\n 'capability_type' => array('travelcard', 'travelcards'),\n 'map_meta_cap' => false,\n 'exclude_from_search' => true,\n )\n );\n }", "function food_specials_custompost() {\r\n\t$args = array(\r\n\t\t'label' => 'Daily Food Specials',\r\n\t\t'public' => true,\r\n\t\t'show_ui' => true,\r\n\t\t'capability_type' => 'post',\r\n\t\t'rewrite' => array('slug' => 'food_specials'),\r\n\t\t'query_var' => true,\r\n\t\t'supports' => array(\r\n\t\t\t'title', 'editor', 'excerpt', 'comments', 'thumbnail', 'author',)\r\n\t\t);\r\n\tregister_post_type('food_specials', $args);\r\n}", "function create_post_type() {\n\t\tregister_post_type(\n\t\t 'project',\n\t\t array(\n\t\t 'label' => 'Projects',\n\t\t 'labels' => array(\n\t\t 'name' => 'Projects',\n\t\t 'singular_name' => 'Project',\n\t\t 'all_items' => 'All projects',\n\t\t 'add_new_item' => 'Add a project',\n\t\t 'edit_item' => 'Edit project',\n\t\t 'new_item' => 'New project',\n\t\t 'view_item' => 'See project',\n\t\t 'search_items' => 'Search project',\n\t\t 'not_found' => 'No project found',\n\t\t 'not_found_in_trash'=> 'No project in the trash'\n\t\t ),\n\t\t 'public' => true,\n\t\t // 'capability_type' => 'post',\n\t\t 'supports' => array(\n\t\t 'title',\n\t\t 'editor',\n\t\t 'thumbnail'\n\t\t ),\n\t\t 'has_archive' => true,\n\t\t\t'menu_icon' => 'dashicons-welcome-add-page'\n\t\t )\n\t\t);\n\t}", "function create_post_type()\n{\n//post type\n $post_type_labels = array(\n 'name' => __('Услуги', 'themename'),\n 'singular_name' => __('Услуга', 'themename'),\n 'add_new' => __('Добавить', 'themename'),\n 'add_new_item' => __('Добавить', 'themename'),\n 'edit_item' => __('Редактировать', 'themename'),\n 'new_item' => __('Добавить', 'themename'),\n 'view_item' => __('Смотреть', 'themename'),\n 'search_items' => __('Искать', 'themename'),\n 'not_found' => __('Не найдено', 'themename'),\n 'parent_item_colon' => '',\n );\n $description = get_option('Перечень услуг');\n $post_type_args = array(\n 'labels' => apply_filters('inspiry_property_post_type_labels', $post_type_labels),\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'query_var' => true,\n 'has_archive' => true,\n 'capability_type' => 'post',\n 'hierarchical' => true,\n 'menu_icon' => 'dashicons-portfolio',\n 'menu_position' => 15,\n 'description' => $description,\n 'supports' => array('title', 'editor', 'thumbnail'),\n 'rewrite' => array(\n 'slug' => apply_filters('inspiry_property_slug', 'uslugi'),\n ),\n );\n register_post_type('service', $post_type_args);\n\n // taxonomy\n register_taxonomy('service_cats', array('service'), array(\n 'label' => 'Категории', // определяется параметром $labels->name\n 'labels' => array(\n 'name' => 'Категории услуг',\n 'singular_name' => 'Категория',\n 'search_items' => 'Искать',\n 'all_items' => 'Все категории',\n 'parent_item' => 'Родительская категория',\n 'parent_item_colon' => 'Родительская категория:',\n 'edit_item' => 'Редактировать',\n 'update_item' => 'Обновить',\n 'add_new_item' => 'Добавить',\n 'new_item_name' => 'Новая категория',\n 'menu_name' => 'Категории услуг',\n ),\n 'description' => 'Категории услуг', // описание таксономии\n 'public' => true,\n 'show_in_nav_menus' => false, // равен аргументу public\n 'show_ui' => true, // равен аргументу public\n 'show_tagcloud' => false, // равен аргументу show_ui\n 'hierarchical' => true,\n 'rewrite' => array('slug' => 'services-categoies', 'hierarchical' => false, 'with_front' => false, 'feed' => false),\n 'show_admin_column' => true, // Позволить или нет авто-создание колонки таксономии в таблице ассоциированного типа записи. (с версии 3.5)\n ));\n\n $post_type_labels = array(\n 'name' => __('FAQ', 'themename'),\n 'singular_name' => __('FAQ', 'themename'),\n 'add_new' => __('Добавить вопрос', 'themename'),\n 'add_new_item' => __('Добавить вопрос', 'themename'),\n 'edit_item' => __('Редактировать вопрос', 'themename'),\n 'new_item' => __('Добавить вопрос', 'themename'),\n 'view_item' => __('Смотреть вопрос', 'themename'),\n 'search_items' => __('Искать вопрос', 'themename'),\n 'not_found' => __('Не найдено', 'themename'),\n 'parent_item_colon' => '',\n );\n $description = get_option('Часто задаваеміе вопросы');\n $post_type_args = array(\n 'labels' => apply_filters('inspiry_property_post_type_labels', $post_type_labels),\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'query_var' => true,\n 'has_archive' => true,\n 'capability_type' => 'post',\n 'hierarchical' => true,\n 'menu_icon' => 'dashicons-format-status',\n 'menu_position' => 16,\n 'description' => $description,\n 'supports' => array('title', 'editor', 'thumbnail'),\n 'rewrite' => array(\n 'slug' => apply_filters('inspiry_property_slug', 'qustions'),\n ),\n );\n register_post_type('qustions', $post_type_args);\n\n $post_type_labels = array(\n 'name' => __('Отзывы', 'themename'),\n 'singular_name' => __('Отзыв', 'themename'),\n 'add_new' => __('Добавить отзыв', 'themename'),\n 'add_new_item' => __('Добавить отзыв', 'themename'),\n 'edit_item' => __('Редактировать отзыв', 'themename'),\n 'new_item' => __('Добавить отзыв', 'themename'),\n 'view_item' => __('Смотреть отзыв', 'themename'),\n 'search_items' => __('Искать отзыв', 'themename'),\n 'not_found' => __('Не найдено', 'themename'),\n 'parent_item_colon' => '',\n );\n $description = get_option('Отзывы');\n $post_type_args = array(\n 'labels' => apply_filters('inspiry_property_post_type_labels', $post_type_labels),\n 'public' => true,\n 'publicly_queryable' => true,\n 'show_ui' => true,\n 'query_var' => true,\n 'has_archive' => true,\n 'capability_type' => 'post',\n 'hierarchical' => true,\n 'menu_icon' => 'dashicons-star-filled',\n 'menu_position' => 17,\n 'description' => $description,\n 'supports' => array('title', 'editor', 'thumbnail'),\n 'rewrite' => array(\n 'slug' => apply_filters('review', 'service'),\n ),\n );\n register_post_type('reviews', $post_type_args);\n\n}", "function create_posttype() {\n $labels = array(\n 'name' => _x( 'NPosts', 'Post Type General Name'),\n 'singular_name' => _x( 'NPost', 'Post Type Singular Name'),\n 'menu_name' => __( 'NPosts'),\n 'parent_item_colon' => __( 'Parent NPost'),\n 'all_items' => __( 'All NPosts'),\n 'view_item' => __( 'View NPost'),\n 'add_new_item' => __( 'Add New NPost'),\n 'add_new' => __( 'Add New'),\n 'edit_item' => __( 'Edit NPost'),\n 'update_item' => __( 'Update NPost'),\n 'search_items' => __( 'Search NPost'),\n 'not_found' => __( 'Not Found'),\n 'not_found_in_trash' => __( 'Not found in Trash'),\n );\n \n// Set other options for Custom Post Type\n \n $args = array(\n 'label' => __( 'nposts'),\n 'description' => __( 'NPost news and reviews'),\n 'labels' => $labels,\n // Features this CPT supports in Post Editor\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ),\n // You can associate this CPT with a taxonomy or custom taxonomy. \n // 'taxonomies' => array( 'genres' ),\n /* A hierarchical CPT is like Pages and can have\n * Parent and child items. A non-hierarchical CPT\n * is like Posts.\n */ \n 'hierarchical' => true,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n );\n \n // Registering your Custom Post Type\n register_post_type( 'npost', $args );\n \n}", "function carbon_register_post_type($settings){\n\n $labels = array(\n 'name' => _x($settings['plural'],'post type plural name','carbon'),\n 'singular_name' => _x($settings['singular'],'post type singular name','carbon'),\n 'add_new' => _x('Add New',$settings['singular'],'carbon'),\n 'add_new_item' => __('Add New ' .$settings['singular']),\n 'edit_item' => __('Edit ' .$settings['singular']),\n 'new_item' => __('New ' .$settings['singular']),\n 'all_items' => __('All ' .$settings['plural']),\n 'view_item' => __('View ' .$settings['singular']),\n 'search_items' => __('Search ' .$settings['plural']),\n 'not_found' => __('No ' .$settings['plural'].' found'),\n 'not_found_in_trash' => __('No ' .$settings['plural'].' found in Trash'),\n 'parent_item_colon' => ':',\n 'menu_name' => $settings['plural'],\n );\n\n $args = array(\n 'labels' => $labels,\n 'can_export' => (isset($settings['can_export']) ? $settings['can_export'] : true), // defaults true\n 'capability_type' => (isset($settings['capability_type']) ? $settings['behavior'] : 'post'), // default post\n // 'capabilities' // default capability_type\n 'exclude_from_search' => (isset($settings['exclude_from_search']) ? $settings['exclude_from_search'] : false), // default opposite of public\n 'hierarchical' => (isset($settings['hierarchical']) ? $settings['hierarchical'] : false), // default false\n 'has_archive' => (isset($settings['has_archive']) ? $settings['has_archive'] : false), // default false\n // 'permalink_epmask' // default EP_PERMALINK\n 'public' => (isset($settings['public']) ? $settings['public'] : true), // default false\n 'publicly_queryable' => (isset($settings['publicly_queryable']) ? $settings['publicly_queryable'] : true), // default public\n 'query_var' => (isset($settings['query_var']) ? $settings['query_var'] : true), // default true type\n 'show_ui' => (isset($settings['show_ui']) ? $settings['show_ui'] : true), // default public\n 'show_in_menu' => (isset($settings['show_in_menu']) ? $settings['show_in_menu'] : true), // default public\n 'show_in_admin_bar' => (isset($settings['show_in_admin_bar']) ? $settings['show_in_admin_bar'] : true), // default show_in_menu\n 'menu_position' => (isset($settings['menu_position']) ? $settings['menu_position'] : null), // default null\n 'menu_icon' => (isset($settings['menu_icon']) ? $settings['menu_icon'] : 'dashicons-admin-post'),\n 'supports' => (isset($settings['supports']) ? $settings['supports'] : array('title', 'editor', 'excerpt', 'thumbnail', 'revisions', 'page-attributes')), // default title editor\n 'taxonomies' => (isset($settings['taxonomies']) ? $settings['taxonomies'] : array()), // default none\n // 'register_meta_box_cb' // default none\n 'rewrite' => (isset($settings['rewrite']) ? $settings['rewrite'] : array( // default true name\n 'slug' => (isset($settings['slug']) ? $settings['slug'] : $settings['type']), // default type\n 'with_front' => (isset($settings['with_front']) ? $settings['with_front'] : false), // default true\n 'feeds' => (isset($settings['feeds']) ? $settings['feeds'] : false), // default has_archive\n 'pages' => (isset($settings['pages']) ? $settings['pages'] : true), // defaults true\n // 'ep_mask' // default permalink_epmask EP_PERMALINK\n )),\n );\n register_post_type($settings['type'], $args);\n }", "function pramble_custom_post_type (){\n\t\n\t$labels = array(\n\t\t'name' => 'Community',\n\t\t'singular_name' => 'Community',\n\t\t'add_new' => 'Add Item',\n\t\t'all_items' => 'All Items',\n\t\t'add_new_item' => 'Add Item',\n\t\t'edit_item' => 'Edit Item',\n\t\t'new_item' => 'New Item',\n\t\t'view_item' => 'View Item',\n\t\t'search_item' => 'Search Community',\n\t\t'not_found' => 'No items found',\n\t\t'not_found_in_trash' => 'No items found in trash',\n\t\t'parent_item_colon' => 'Parent Item'\n\t);\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'public' => true,\n\t\t'has_archive' => true,\n\t\t'publicly_queryable' => true,\n\t\t'query_var' => true,\n\t\t'rewrite' => true,\n\t\t'capability_type' => 'post',\n\t\t'hierarchical' => false,\n\t\t'supports' => array(\n\t\t\t'title',\n\t\t\t'editor',\n\t\t\t'excerpt',\n\t\t\t'thumbnail',\n\t\t\t'revisions',\n\t\t),\n\t\t'taxonomies' => array('category', 'post_tag'),\n\t\t'menu_position' => 5,\n\t\t'exclude_from_search' => false\n\t);\n\tregister_post_type('community',$args);\n}", "function stock_toolkit_custom_post()\n\t{\n\tregister_post_type('slide', array(\n\t\t'labels' => array(\n\t\t\t'name' => __('Slides') ,\n\t\t\t'singular_name' => __('Slide')\n\t\t) ,\n\t\t'supports' => array(\n\t\t\t'title',\n\t\t\t'editor',\n\t\t\t'custom-fields',\n\t\t\t'thumbnail',\n\t\t\t'page-attributes'\n\t\t) ,\n\t\t'public' => false,\n\t\t'show_ui' => true\n\t));\n\t}", "function create_post_type() {\n\n // register external_post as a Custom Post Type\n register_post_type( 'external_post', \n array( \n 'labels' => array( \n 'name' => __('External Posts'), \n 'singular_name' => __('External Post') \n ),\n 'public' => true,\n 'menu_position' => 5,\n 'supports' => array('title', 'excerpt'),\n 'rewrite' => array('slug' => 'external','with_front' => false) \n ) \n ); \n\n // connect external_post to category taxonomy\n register_taxonomy_for_object_type('category', 'external_post');\n register_taxonomy_for_object_type('post_tag', 'external_post');\n\n\n // register wp_tool as a Custom Post Type\n register_post_type('wp_tool',\n array( \n 'labels' => array( \n 'name' => __('WordPress Tools'), \n 'singular_name' => __('WordPress Tool') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'author', 'editor', 'excerpt', 'thumbnail', 'post-formats', 'revisions', 'meta_info'),\n 'rewrite' => array('slug' => 'tool','with_front' => false) \n ) \n );\n\n // connect wp_tool to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'wp_tool');\n register_taxonomy_for_object_type('category', 'wp_tool');\n\n\n // reregister default post so we can set a custom slug\n register_post_type('post', array(\n 'labels' => array(\n 'name_admin_bar' => _x('Post', 'add new on admin bar' ),\n ),\n 'public' => true,\n '_builtin' => false, \n '_edit_link' => 'post.php?post=%d', \n 'capability_type' => 'post',\n 'map_meta_cap' => true,\n 'show_in_menu' => false,\n 'hierarchical' => false,\n 'rewrite' => array('slug' => 'article'),\n 'query_var' => false,\n 'supports' => array('title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'post-formats', 'column_info'),\n )); \n\n // register external_tool as a Custom Post Type\n register_post_type('external_tool',\n array(\n 'labels' => array( \n 'name' => __('External Tools'), \n 'singular_name' => __('External Tool') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'author', 'excerpt', 'thumbnail', 'revisions', 'meta_info'),\n 'rewrite' => array('slug' => 'special','with_front' => false) \n ) \n ); \n\n // connect external_tool to category taxonomy\n register_taxonomy_for_object_type('category', 'external_tool');\n register_taxonomy_for_object_type('meta_info', 'external_tool');\n\n\n // register city_journal as a Custom Post Type\n register_post_type('city_journal',\n array(\n 'labels' => array( \n 'name' => __('CityJournal Entry'),\n 'singular_name' => __('CityJournal Entry')\n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'editor', 'author', 'excerpt', 'thumbnail', 'revisions', 'meta_info', 'comments'),\n 'rewrite' => array('slug' => 'cityjournal','with_front' => false) \n ) \n ); \n\n // connect city_journal to category taxonomy\n register_taxonomy_for_object_type('category', 'city_journal');\n register_taxonomy_for_object_type('meta_info', 'city_journal'); \n\n\n // register people_project as a Custom Post Type\n register_post_type('people_project',\n array(\n 'labels' => array( \n 'name' => __('People & Projects'),\n 'singular_name' => __('People & Project')\n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'excerpt', 'thumbnail', 'meta_info'),\n ) \n ); \n\n // connect people_project to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'people_project'); \n\n\n register_post_type('discussion',\n array( \n 'labels' => array( \n 'name' => __('Discussions'), \n 'singular_name' => __('Discussion') \n ), \n 'public' => true, \n 'menu_position' => 5, \n 'supports' => array('title', 'editor', 'excerpt', 'thumbnail', 'post-formats', 'revisions', 'meta_info', 'comments'),\n 'rewrite' => array('slug' => 'discussion','with_front' => false) \n ) \n );\n\n // connect discussion to category taxonomy\n register_taxonomy_for_object_type('meta_info', 'discussion');\n register_taxonomy_for_object_type('category', 'discussion');\n\n}", "function classTools_post_type() {\n\n $labels = array(\n 'name' => _x( 'Ferramentas', 'Post Type General Name', 'text_domain' ),\n 'singular_name' => _x( 'ferramenta', 'Post Type Singular Name', 'text_domain' ),\n 'menu_name' => __( 'Ferramenta', 'text_domain' ),\n 'name_admin_bar' => __( 'Post Type', 'text_domain' ),\n 'archives' => __( 'Item Archives', 'text_domain' ),\n 'attributes' => __( 'Item Attributes', 'text_domain' ),\n 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n 'all_items' => __( 'todas as ferramentas', 'text_domain' ),\n 'add_new_item' => __( 'Add novaferramenta', 'text_domain' ),\n 'add_new' => __( 'nova ferramenta', 'text_domain' ),\n 'new_item' => __( 'nova ferramenta', 'text_domain' ),\n 'edit_item' => __( 'Edit Item', 'text_domain' ),\n 'update_item' => __( 'Update Item', 'text_domain' ),\n 'view_item' => __( 'View Item', 'text_domain' ),\n 'view_items' => __( 'View Items', 'text_domain' ),\n 'search_items' => __( 'Search Item', 'text_domain' ),\n 'not_found' => __( 'não encontrado', 'text_domain' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n 'featured_image' => __( 'Featured Image', 'text_domain' ),\n 'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n 'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n 'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n 'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n 'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n 'items_list' => __( 'Items list', 'text_domain' ),\n 'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n 'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n );\n $args = array(\n 'label' => __( 'ferramentas', 'text_domain' ),\n 'description' => __( 'ferramentas', 'text_domain' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields'),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n register_post_type( 'classTools_post_type', $args );\n\n}", "function press_post_type() {\n\n// Set UI labels for Custom Post Type\n\t$labels = array(\n\t\t'name' => _x( 'Press', 'Post Type General Name'),\n\t\t'singular_name' => _x( 'Press', 'Post Type Singular Name'),\n\t\t'menu_name' => __( 'Press'),\n\t\t'all_items' => __( 'All Press'),\n\t\t'view_item' => __( 'View Press'),\n\t\t'add_new_item' => __( 'Add New Press'),\n\t\t'add_new' => __( 'Add New'),\n\t\t'edit_item' => __( 'Edit Press'),\n\t\t'update_item' => __( 'Update Press')\n\n\t\t\n\t);\n\t\n// Set other options for Custom Post Type\n\t\n\t$args = array(\n\t\t'label' => __( 'press'),\n\t\t'labels' => $labels,\n\t\t// Features this CPT supports in Post Editor\n\t\t'supports' => array( 'title', 'editor', 'thumbnail'),\n \n\t\t/* A hierarchical CPT is like Pages and can have\n\t\t* Parent and child items. A non-hierarchical CPT\n\t\t* is like Posts.\n\t\t*/\t\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => false,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 5,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => true,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n 'rewrite' => array(\"slug\" => \"press\"),\n 'register_meta_box_cb' => 'add_press_metaboxes' // function hooking up metaboxes\n\t);\n\t\n\t// Registering your Custom Post Type\n\tregister_post_type( 'press', $args );\n\n}", "function proyecto_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'proyectos', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'proyecto', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'Post Types', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'Post Type', 'text_domain' ),\n\t\t'archives' => __( 'Item Archives', 'text_domain' ),\n\t\t'attributes' => __( 'Item Attributes', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n\t\t'all_items' => __( 'All Items', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New Item', 'text_domain' ),\n\t\t'add_new' => __( 'Add New', 'text_domain' ),\n\t\t'new_item' => __( 'New Item', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Item', 'text_domain' ),\n\t\t'update_item' => __( 'Update Item', 'text_domain' ),\n\t\t'view_item' => __( 'View Item', 'text_domain' ),\n\t\t'view_items' => __( 'View Items', 'text_domain' ),\n\t\t'search_items' => __( 'Search Item', 'text_domain' ),\n\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t\t'featured_image' => __( 'Featured Image', 'text_domain' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n\t\t'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n\t\t'items_list' => __( 'Items list', 'text_domain' ),\n\t\t'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n\t\t'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n\t);\n\t$args = array(\n\t\t'label' => __( 'proyecto', 'text_domain' ),\n\t\t'description' => __( 'personalización del proyecto', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail' ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-images-alt2',\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t);\n\tregister_post_type( 'proyecto', $args );\n\n}", "function create_custom_post_types(){\n\t/**\n\t * Arguments for company labels\n\t */\n\t$args_labels_company = array(\n\t\t'name' => __('Companies', 'threedee-expo'),\n\t\t'singular_name' => __('Company', 'threedee-expo'),\n\t\t'add_new_item' => __('Add New Company', 'threedee-expo'),\n\t\t'edit_item' => __('Edit Company', 'threedee-expo'),\n\t\t'new_item' => __('New Company', 'threedee-expo'),\n\t\t'view_item' => __('View Company', 'threedee-expo'),\n\t\t'search_items' => __('Search Companies', 'threedee-expo'),\n\t\t'not_found' => __('No companies found', 'threedee-expo'),\n\t\t'not_found_in_trash'=> __('No companies found in Trash', 'threedee-expo'),\n\t\t'all_items' => __('All Companies', 'threedee-expo'),\n\t\t'archives' => __('Company Archives', 'threedee-expo'),\n\t);\n\t/**\n\t * Arguments for company capabilities\n\t */\n\t$args_capabilities_company = array(\n\t\t'publish_posts' => 'publish_companies',\n\t\t'edit_posts' => 'edit_companies',\n\t\t'edit_others_posts' => 'edit_others_companies',\n\t\t'delete_posts' => 'delete_companies',\n\t\t'delete_others_posts' => 'delete_others_companies',\n\t\t'read_private_posts' => 'read_private_companies',\n\t\t'edit_post' => 'edit_company',\n\t\t'delete_post' => 'delete_company',\n\t\t'read_post' => 'read_company',\n\t);\n\t/**\n\t * Arguments for register companies\n\t */\n\t$args_company = array(\n\t\t'labels' => $args_labels_company,\n\t\t'description' => 'Companies.',\n\t\t'public' => true,\n\t\t'has_archive' => true,\n\t\t'rewrite'\t => array('slug' => 'company'),\n\t\t'menu_icon' => 'dashicons-businessman',\n\t\t'capability_type' => 'companies',\n\t\t'capabilities' => $args_capabilities_company,\n\t\t'map_meta_cap' => true,\n\t\t'supports' => array('author','title')\n\t);\n\t/**\n\t * Arguments for company labels\n\t */\n\t$args_labels_group_of_companies = array(\n\t\t'name' => __('Group of Companies', 'threedee-expo'),\n\t\t'singular_name' => __('Group of Company', 'threedee-expo'),\n\t\t'add_new_item' => __('Add New Group of Companies', 'threedee-expo'),\n\t\t'edit_item' => __('Edit Group of Companies', 'threedee-expo'),\n\t\t'new_item' => __('New Group of Companies', 'threedee-expo'),\n\t\t'view_item' => __('View Group of Companies', 'threedee-expo'),\n\t\t'search_items' => __('Search Group of Companies', 'threedee-expo'),\n\t\t'not_found' => __('No Group of Companies found', 'threedee-expo'),\n\t\t'not_found_in_trash'=> __('No Group of Companies found in Trash', 'threedee-expo'),\n\t\t'all_items' => __('All Group of Companies', 'threedee-expo'),\n\t\t'archives' => __('Group of Companies Archives', 'threedee-expo'),\n\t);\n\t/**\n\t * Arguments for company capabilities\n\t */\n\t$args_capabilities_group_of_companies = array(\n\t\t'publish_posts' => 'publish_group_of_companies',\n\t\t'edit_posts' => 'edit_group_of_companies',\n\t\t'edit_others_posts' => 'edit_others_group_of_companies',\n\t\t'delete_posts' => 'delete_group_of_companies',\n\t\t'delete_others_posts' => 'delete_others_group_of_companies',\n\t\t'read_private_posts' => 'read_private_group_of_companies',\n\t\t'edit_post' => 'edit_group_of_company',\n\t\t'delete_post' => 'delete_group_of_company',\n\t\t'read_post' => 'read_group_of_company',\n\t);\n\t/**\n\t * Arguments for register companies\n\t */\n\t$args_group_of_companies = array(\n\t\t'labels' => $args_labels_group_of_companies,\n\t\t'description' => 'Group of Companies.',\n\t\t'public' => true,\n\t\t'has_archive' => true,\n\t\t'rewrite'\t => array('slug' => 'group_of_companies'),\n\t\t'menu_icon' => 'dashicons-groups',\n\t\t'capability_type' => 'group_of_companies',\n\t\t'capabilities' => $args_capabilities_group_of_companies,\n\t\t'map_meta_cap' => true,\n\t\t'supports' => array('author','title')\n\t);\n\tregister_post_type( 'companies', $args_company);\n\tregister_post_type( 'group_of_companies',$args_group_of_companies);\n}", "function create_post_type(){\n register_post_type('recipes', [ \n 'labels' => [\n 'name' => 'Recipes', //Etikett i plural Etikett i singular\n 'singular_name' => 'Recipe', //Vad som ska stå i ”Lägg till...” knappen\n 'add_new' => 'New Recipe', //Vad som ska stå i ”Lägg till ny...” knappen\n 'add_new_item' => 'New Recipe', //Vad som ska stå i ”Ny...” länken\n 'edit_item' => 'Edit Recipe', //Vad som ska stå i ”Redigera...” länken\n 'new_item' => 'New Recipe', //Vad som ska stå i ”Ny...” länken\n 'search_items' => 'Search for Recipe', //Vad som ska stå i sökrutan i listningen\n 'not_found' => 'No Recipe Found', \n 'all_items' => 'All Recipes', //Vad som ska stå i ”Alla...” länken\n ],\n 'supports' => array( 'thumbnail' ),\n 'description' => 'The Big Tasty!', //En kort beskrivning av posttypen\n 'public' => true, //Om och hur posttypen ska visas för olika användare\n 'exclude_from_search' => false, //Om posttypens poster ska exkluderas vid sökning\n 'show_ui' => true, //Om posttypen ska kunna hanteras från admin\n 'show_in_nav_menus' => true, //Om poster av posttypen ska kunna läggas till i menyer\n 'show_in_menu' => true, //Vart posttypen ska listas i admin (vänster eller topp)\n 'show_in_admin_bar' => true, //Om posttypen ska visas i toppbar’en\n 'menu_position' => 10, //Vart i vänstermenyn posttypen ska visas\n 'hierarchical' => false, //Om poster i posttypen ska kunna ha föräldrar, likt Sidor\n 'menu_icon' => 'dashicons-food', //Ikon för posttypen\n 'supports' => array('title' , 'editor'), //Vad som ska synas när man skapar/redigerar en post \n 'taxonomies' => array('category'), //Vilka taxonomier som ska tillhöra posttypen\n 'has_archive' => true, //Om posttypen ska ha arkivsida\n 'rewrite' => [ //Hur posttypens rewrites ska hanteras...\n 'slug' => 'recipe', //Permalänkstrukturen för posttypen\n 'with_front' => true //Om permalänkarna ska låta föregås av sluggen\n ] \n ]);\n\n}", "function carbon_register_post_types(){\n\n // carbon_register_post_type(array(\n // 'singular' => 'Type', // required\n // 'plural' => 'Types', // required\n // 'type' => 'type', // required\n // 'slug' => 'types/type',\n // 'menu_icon' => 'dashicons-admin-post',\n // 'has_archive' => true,\n // 'exclude_from_search' => true,\n // ));\n }", "function add_my_custom_posttype_smaken(){\n //LABELS DIFINIËREN\n $labels = array(\n 'add_new' => 'Voeg nieuwe smaak toe',\n 'add_new_item' => 'Voeg nieuwe smaak toe',\n 'name' => 'Smaken',\n 'singular_name' => 'Smaak',\n );\n //ARGUMENTEN DIFINIËREN\n $args = array(\n 'labels' => $labels, // de array labels van hier boven linken aan het argument labels\n 'Description' => 'Lactosevrije smaken van B & J',\n 'public' => true,\n 'menu_position' => 4,\n 'menu_icon' => 'dashicons-carrot', //Een icoon kiezen\n 'supports' => array('title', 'editor', 'thumbnail', 'page-attributes'), \n 'has_archive' => true, //Maak een archief aan (opsomming van alle elementen), anders gaan we archive-waarden.php nooit kunnen aanspreken.\n 'show_in_nav_menus' => TRUE,\n );\n register_post_type( 'smaken', $args ); \n }", "static function register_post_type() {\n\n $args = array(\n 'labels' => array(\n\t\t'name' => __( 'Forms', 'pwp' ),\n\t\t'singular_name' => __( 'Form', 'pwp' ),\n\t\t'add_new' => __( 'Add New', 'pwp' ),\n\t\t'add_new_item' => __( 'Add New Form', 'pwp' ),\n\t\t'edit_item' => __( 'Edit Form', 'pwp' ),\n\t\t'new_item' => __( 'New Form', 'pwp' ),\n\t\t'all_items' => __( 'All Forms', 'pwp' ),\n\t\t'view_item' => __( 'View Form', 'pwp' ),\n\t\t'search_items' => __( 'Search Forms', 'pwp' ),\n\t\t'not_found' => __( 'No forms found', 'pwp' ),\n\t\t'not_found_in_trash' => __( 'No forms found in Trash', 'pwp' ),\n\t\t'parent_item_colon' => __( ':', 'pwp' ),\n\t\t'menu_name' => __( 'Forms', 'pwp' )\n\t ),\n 'public' => false,\n 'show_ui' => true,\n 'query_var' => false,\n 'supports' => array( 'title', 'custom-fields', 'editor' )\n );\n\tregister_post_type( 'form', $args );\n }", "function create_posttype() \n {\n register_post_type( 'mist_employee',\n array(\n 'labels' => array(\n 'name' => __( 'Employees' ),\n 'singular_name' => __( 'Employee' )\n ),\n \n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'employees'),\n 'supports' => array('title','editor','thumbnail','excerpt'),\n 'menu_icon' => 'dashicons-businessman'\n )\n );\n register_post_type( 'mist_message',\n array(\n 'labels' => array(\n 'name' => __( 'Person Messages' ),\n 'singular_name' => __( 'Message' ),\n ),\n \n 'public' => true,\n 'has_archive' => true,\n 'rewrite' => array('slug' => 'message'),\n 'supports' => array('title','editor','thumbnail','excerpt'),\n 'menu_icon' => 'dashicons-testimonial'\n )\n );\n add_post_type_support('mist_message', 'excerpt');\n \n }", "function register_post_types(){\n\t\t\trequire('lib/custom-types.php');\n\t\t}", "function cadastrando_post_type_clientes() {\n\n $nomeSingular = 'Cliente';\n $nomePlural = 'Clientes';\n $descricao = 'Clientes da minha empresa';\n\n $labels = array(\n 'name' => $nomePlural,\n 'name_singular' => $nomeSingular,\n 'add_new_item' => 'Adicionar novo ' . $nomeSingular,\n 'edit_item' => 'Editar ' . $nomeSingular\n );\n\n $supports = array(\n 'title',\n 'editor',\n 'thumbnail'\n );\n\n $args = array(\n 'labels' => $labels,\n 'description' => $descricao,\n 'public' => true,\n 'menu_icon' => 'dashicons-id-alt',\n 'supports' => $supports\n );\n\n register_post_type( 'cliente', $args);\n}", "function katayam_custom_post_type(){\r\n\t$labels=array(\r\n\t'name'=>'Portfolio',\r\n\t'singular_name'=>'Portfolio',\r\n\t'add_new'=>'Add Portfolio word',\r\n\t'all_items'=>'All Items',\r\n\t'add_new_item'=>'Add Item',\r\n\t'edit_item'=>'Edit Item',\r\n\t'new_item'=>'New Item',\r\n\t'view_item'=>'View Item',\r\n\t'search_item'=>'Search Portfolio',\r\n\t'not_found'=>'No Item Found',\r\n\t'not_found_in_trash'=>'No Item Fount In Trash',\r\n\t'parent_item_colon'=>'Parent Item'\r\n\t);\t\r\n$args=array(\r\n'labels'=>$labels,\r\n'public'=>true,\r\n'has_archive'=>true,\r\n'publicly_queryable'=>true,\r\n'query_var'=>true,\r\n'rewrite'=>true,\r\n'capability_type'=>'post',\r\n'hierarchical'=>false,\r\n'supports'=>array(\r\n'title',\r\n'editor',\r\n'excerpt',\r\n'thumbnail',\r\n'revisions',\r\n),\r\n//'taxonomies'=>array('category','post_tag'),\r\n'menu_position'=>5,\r\n'exclude_from_search'=>false\r\n);\r\nregister_post_type('portfolio',$args);\r\n}", "function create_volunteer_custom_post() {\n register_post_type( 'volunteers',\n array(\n 'labels' => array(\n 'name' => __( 'Board Members' ),\n 'singular_name' => __( 'Board Member' ),\n ),\n 'public' => true,\n 'has_archive' => true,\n 'supports' => array(\n 'title',\n 'editor',\n 'thumbnail',\n 'custom-fields'\n )\n ));\n}", "function qanat_custom_post_type() {\n\n $labels = array(\n 'name' => _x( 'Clientes', 'Post Type General Name', 'qanat' ),\n 'singular_name' => _x( 'Cliente', 'Post Type Singular Name', 'qanat' ),\n 'menu_name' => __( 'Clientes', 'qanat' ),\n 'name_admin_bar' => __( 'Clientes', 'qanat' ),\n 'archives' => __( 'Archivo de Clientes', 'qanat' ),\n 'attributes' => __( 'Atributos de Clientes', 'qanat' ),\n 'parent_item_colon' => __( 'Cliente Padre:', 'qanat' ),\n 'all_items' => __( 'Todos los Clientes', 'qanat' ),\n 'add_new_item' => __( 'Agregar Nuevo Cliente', 'qanat' ),\n 'add_new' => __( 'Agregar Cliente', 'qanat' ),\n 'new_item' => __( 'Nuevo Cliente', 'qanat' ),\n 'edit_item' => __( 'Editar Cliente', 'qanat' ),\n 'update_item' => __( 'Actualizar Cliente', 'qanat' ),\n 'view_item' => __( 'Ver Cliente', 'qanat' ),\n 'view_items' => __( 'Ver Clientes', 'qanat' ),\n 'search_items' => __( 'Buscar Cliente', 'qanat' ),\n 'not_found' => __( 'No hay resultados', 'qanat' ),\n 'not_found_in_trash' => __( 'No hay resultados en Papelera', 'qanat' ),\n 'featured_image' => __( 'Logo del Cliente', 'qanat' ),\n 'set_featured_image' => __( 'Colocar Logo del Cliente', 'qanat' ),\n 'remove_featured_image' => __( 'Remover Logo del Cliente', 'qanat' ),\n 'use_featured_image' => __( 'Usar como Logo del Cliente', 'qanat' ),\n 'insert_into_item' => __( 'Insertar en Cliente', 'qanat' ),\n 'uploaded_to_this_item' => __( 'Cargado a este Cliente', 'qanat' ),\n 'items_list' => __( 'Listado de Clientes', 'qanat' ),\n 'items_list_navigation' => __( 'Navegación del Listado de Clientes', 'qanat' ),\n 'filter_items_list' => __( 'Filtro del Listado de Clientes', 'qanat' ),\n );\n $args = array(\n 'label' => __( 'Cliente', 'qanat' ),\n 'description' => __( 'Clientes dentro de la Empresa', 'qanat' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor', 'thumbnail' ),\n 'hierarchical' => false,\n 'public' => true,\n 'rewrite' => array('with_front' => false, 'slug' => 'clientes'),\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-buddicons-buddypress-logo',\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => true,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n 'show_in_rest' => true,\n );\n register_post_type( 'clientes', $args );\n\n /* PUBLICACIONES */\n $labels_pub = array(\n 'name' => _x( 'Publicaciones', 'Post Type General Name', 'qanat' ),\n 'singular_name' => _x( 'Publicación', 'Post Type Singular Name', 'qanat' ),\n 'menu_name' => __( 'Publicaciones', 'qanat' ),\n 'name_admin_bar' => __( 'Publicación', 'qanat' ),\n 'archives' => __( 'Archivo de Publicaciones', 'qanat' ),\n 'attributes' => __( 'Atributos de Publicación', 'qanat' ),\n 'parent_item_colon' => __( 'Publicación Padre:', 'qanat' ),\n 'all_items' => __( 'Todas las Publicaciones', 'qanat' ),\n 'add_new_item' => __( 'Agregar Nueva Publicación', 'qanat' ),\n 'add_new' => __( 'Agregar Nueva', 'qanat' ),\n 'new_item' => __( 'Nueva Publicación', 'qanat' ),\n 'edit_item' => __( 'Editar Publicación', 'qanat' ),\n 'update_item' => __( 'Actualizar Publicación', 'qanat' ),\n 'view_item' => __( 'Ver Publicación', 'qanat' ),\n 'view_items' => __( 'Ver Publicaciones', 'qanat' ),\n 'search_items' => __( 'Buscar Publicación', 'qanat' ),\n 'not_found' => __( 'No hay resultados', 'qanat' ),\n 'not_found_in_trash' => __( 'No hay resultados en Papelera', 'qanat' ),\n 'featured_image' => __( 'Imagen de Publicación', 'qanat' ),\n 'set_featured_image' => __( 'Colocar Imagen de Publicación', 'qanat' ),\n 'remove_featured_image' => __( 'Remover Imagen de Publicación', 'qanat' ),\n 'use_featured_image' => __( 'Usar como Imagen de Publicación', 'qanat' ),\n 'insert_into_item' => __( 'Insertar en Publicación', 'qanat' ),\n 'uploaded_to_this_item' => __( 'Cargado en esta Publicación', 'qanat' ),\n 'items_list' => __( 'Listado de Publicaciones', 'qanat' ),\n 'items_list_navigation' => __( 'Navegación del Listado de Publicaciones', 'qanat' ),\n 'filter_items_list' => __( 'Filtro del Listado de Publicaciones', 'qanat' ),\n );\n $args_pub = array(\n 'label' => __( 'Publicación', 'qanat' ),\n 'description' => __( 'Publicaciones disponibles para descarga', 'qanat' ),\n 'labels' => $labels_pub,\n 'supports' => array( 'title', 'editor' ),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'rewrite' => array('with_front' => false, 'slug' => 'publicaciones'),\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-megaphone',\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n 'show_in_rest' => true,\n );\n register_post_type( 'publicaciones', $args_pub );\n\n\n $labels_act = array(\n 'name' => _x( 'Actividades', 'Post Type General Name', 'qanat' ),\n 'singular_name' => _x( 'Actividad', 'Post Type Singular Name', 'qanat' ),\n 'menu_name' => __( 'Actividades', 'qanat' ),\n 'name_admin_bar' => __( 'Actividad', 'qanat' ),\n 'archives' => __( 'Archivo de Actividades', 'qanat' ),\n 'attributes' => __( 'Atributos de Actividad', 'qanat' ),\n 'parent_item_colon' => __( 'Actividad Padre:', 'qanat' ),\n 'all_items' => __( 'Todas las Actividades', 'qanat' ),\n 'add_new_item' => __( 'Agregar Nueva Actividad', 'qanat' ),\n 'add_new' => __( 'Agregar Nueva', 'qanat' ),\n 'new_item' => __( 'Nueva Actividad', 'qanat' ),\n 'edit_item' => __( 'Editar Actividad', 'qanat' ),\n 'update_item' => __( 'Actualizar Actividad', 'qanat' ),\n 'view_item' => __( 'Ver Actividad', 'qanat' ),\n 'view_items' => __( 'Ver Actividades', 'qanat' ),\n 'search_items' => __( 'Buscar Actividad', 'qanat' ),\n 'not_found' => __( 'No hay resultados', 'qanat' ),\n 'not_found_in_trash' => __( 'No hay resultados en Papelera', 'qanat' ),\n 'featured_image' => __( 'Imagen de Actividad', 'qanat' ),\n 'set_featured_image' => __( 'Colocar Imagen de Actividad', 'qanat' ),\n 'remove_featured_image' => __( 'Remover Imagen de Actividad', 'qanat' ),\n 'use_featured_image' => __( 'Usar como Imagen de Actividad', 'qanat' ),\n 'insert_into_item' => __( 'Insertar en Actividad', 'qanat' ),\n 'uploaded_to_this_item' => __( 'Cargada a esta Actividad', 'qanat' ),\n 'items_list' => __( 'Listado de Actividades', 'qanat' ),\n 'items_list_navigation' => __( 'Navegación del Listado de Actividades', 'qanat' ),\n 'filter_items_list' => __( 'Filtro del Listado de Actividades', 'qanat' ),\n );\n $args_act = array(\n 'label' => __( 'Actividad', 'qanat' ),\n 'description' => __( 'Actividades de la Empresa', 'qanat' ),\n 'labels' => $labels_act,\n 'supports' => array( 'title', 'editor', 'thumbnail' ),\n 'taxonomies' => array( 'tipo-actividades' ),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'rewrite' => array('with_front' => false, 'slug' => 'actividades'),\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-analytics',\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n 'show_in_rest' => true,\n );\n register_post_type( 'actividades', $args_act );\n\n // Register Custom Taxonomy\n\n $labels_tipo = array(\n 'name' => _x( 'Tipos de Actividades', 'Taxonomy General Name', 'qanat' ),\n 'singular_name' => _x( 'Tipo de Actividad', 'Taxonomy Singular Name', 'qanat' ),\n 'menu_name' => __( 'Tipos de Actividades', 'qanat' ),\n 'all_items' => __( 'Agregar Todos', 'qanat' ),\n 'parent_item' => __( 'Tipo Padre', 'qanat' ),\n 'parent_item_colon' => __( 'Tipo Padre:', 'qanat' ),\n 'new_item_name' => __( 'Nuevo Tipo', 'qanat' ),\n 'add_new_item' => __( 'Agregar Nuevo Tipo', 'qanat' ),\n 'edit_item' => __( 'Editar Tipo', 'qanat' ),\n 'update_item' => __( 'Actualizar Tipo', 'qanat' ),\n 'view_item' => __( 'Ver Tipo', 'qanat' ),\n 'separate_items_with_commas' => __( 'Separar tipos por comas', 'qanat' ),\n 'add_or_remove_items' => __( 'Agregar o Remover tipos', 'qanat' ),\n 'choose_from_most_used' => __( 'Escoger de los más usados', 'qanat' ),\n 'popular_items' => __( 'Tipos Populares', 'qanat' ),\n 'search_items' => __( 'Buscar tipos', 'qanat' ),\n 'not_found' => __( 'no hay resultados', 'qanat' ),\n 'no_terms' => __( 'No hay Tipos', 'qanat' ),\n 'items_list' => __( 'Listado de Tipos', 'qanat' ),\n 'items_list_navigation' => __( 'Navegación del Listado de Tipos', 'qanat' ),\n );\n $args_tipo = array(\n 'labels' => $labels_tipo,\n 'hierarchical' => true,\n 'public' => true,\n 'rewrite' => array( 'slug' => 'tipo-actividades' ),\n 'show_ui' => true,\n 'show_admin_column' => true,\n 'show_in_nav_menus' => true,\n 'show_tagcloud' => true,\n 'show_in_rest' => true,\n );\n register_taxonomy( 'tipo-actividades', array( 'actividades' ), $args_tipo );\n\n}", "function howTo_post_type() {\n\n $labels = array(\n 'name' => _x( 'Como Funciona', 'Post Type General Name', 'text_domain' ),\n 'singular_name' => _x( 'Como Funciona', 'Post Type Singular Name', 'text_domain' ),\n 'menu_name' => __( 'Como Funciona', 'text_domain' ),\n 'name_admin_bar' => __( 'Post Type', 'text_domain' ),\n 'archives' => __( 'Item Archives', 'text_domain' ),\n 'attributes' => __( 'Item Attributes', 'text_domain' ),\n 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n 'all_items' => __( 'todos os cards', 'text_domain' ),\n 'add_new_item' => __( 'Add novo card', 'text_domain' ),\n 'add_new' => __( 'novo card', 'text_domain' ),\n 'new_item' => __( 'novo card', 'text_domain' ),\n 'edit_item' => __( 'Edit Item', 'text_domain' ),\n 'update_item' => __( 'Update Item', 'text_domain' ),\n 'view_item' => __( 'View Item', 'text_domain' ),\n 'view_items' => __( 'View Items', 'text_domain' ),\n 'search_items' => __( 'Search Item', 'text_domain' ),\n 'not_found' => __( 'não encontrato', 'text_domain' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n 'featured_image' => __( 'Featured Image', 'text_domain' ),\n 'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n 'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n 'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n 'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n 'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n 'items_list' => __( 'Items list', 'text_domain' ),\n 'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n 'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n );\n $args = array(\n 'label' => __( 'Como Funciona', 'text_domain' ),\n 'description' => __( 'Como Funciona', 'text_domain' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor', 'thumbnail' ),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n register_post_type( 'howTo_post_type', $args );\n\n}", "function add_custom_post_type() {\n\tregister_post_type( 'learning_resource',\n array(\n 'labels' => array(\n 'name' => __( 'Learning Resources' ),\n 'singular_name' => __( 'Learning Resource' )\n ),\n 'public' => true,\n 'has_archive' => true,\n )\n );\n}", "public function create_post_type()\n \t{\n\t\t\t$labels = array(\n\t\t\t\t\t'name' => 'files',\n\t\t\t\t\t'singular_name' => 'file',\n\t\t\t\t\t'menu_name' => 'Files',\n\t\t\t\t\t'name_admin_bar' => 'Files',\n\t\t\t\t\t'parent_item_colon' => 'Parent Item:',\n\t\t\t\t\t'all_items' => 'All Items',\n\t\t\t\t\t'add_new_item' => 'Add New File',\n\t\t\t\t\t'add_new' => 'Add New',\n\t\t\t\t\t'new_item' => 'New File',\n\t\t\t\t\t'edit_item' => 'Edit File',\n\t\t\t\t\t'update_item' => 'Update File',\n\t\t\t\t\t'view_item' => 'View File',\n\t\t\t\t\t'search_items' => 'Search Item',\n\t\t\t\t\t'not_found' => 'Not found',\n\t\t\t\t\t'not_found_in_trash' => 'Not found in Trash',\n\t\t\t\t);\n\t\t\t\t\n\t\t\t$rewrite = array(\n\t\t\t\t\t'slug' => 'files',\n\t\t\t\t\t'with_front' => true,\n\t\t\t\t\t'pages' => false,\n\t\t\t\t\t'feeds' => false,\n\t\t\t\t);\n\t\t\t$args = array(\n\t\t\t\t\t'label' => 'file',\n\t\t\t\t\t'description' => 'A Post Type to provide the data for the sharing.',\n\t\t\t\t\t'labels' => $labels,\n\t\t\t\t\t'supports' => array( 'title', 'excerpt', 'custom-fields', ),\n\t\t\t\t\t'hierarchical' => false,\n\t\t\t\t\t'public' => true,\n\t\t\t\t\t'show_ui' => true,\n\t\t\t\t\t'show_in_menu' => true,\n\t\t\t\t\t'menu_position' => 5,\n\t\t\t\t\t'menu_icon' => 'dashicons-share',\n\t\t\t\t\t'show_in_admin_bar' => true,\n\t\t\t\t\t'show_in_nav_menus' => false,\n\t\t\t\t\t'can_export' => true,\n\t\t\t\t\t'has_archive' => false,\n\t\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t\t'publicly_queryable' => true,\n\t\t\t\t\t'rewrite' => $rewrite,\n\t\t\t\t\t'capability_type' => 'post',\n\t\t\t\t);\n\t\t\n\t\t\t/* register_post_type('name', $args) */\n \t\tregister_post_type(self::POST_TYPE, $args);\n \t}", "private function register_post_type() {\n\t\t\t// register the post type\n\t\t\t$args = array('label' => __('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t'description' => '',\n\t\t\t\t\t\t\t\t\t\t'public' => false,\n\t\t\t\t\t\t\t\t\t\t'show_ui' => true,\n\t\t\t\t\t\t\t\t\t\t'show_in_menu' => true,\n\t\t\t\t\t\t\t\t\t\t'capability_type' => 'post',\n\t\t\t\t\t\t\t\t\t\t'map_meta_cap' => true,\n\t\t\t\t\t\t\t\t\t\t'hierarchical' => false,\n\t\t\t\t\t\t\t\t\t\t'rewrite' => array('slug' => $this->post_type, 'with_front' => false),\n\t\t\t\t\t\t\t\t\t\t'query_var' => true,\n\t\t\t\t\t\t\t\t\t\t'exclude_from_search' => true,\n\t\t\t\t\t\t\t\t\t\t'menu_position' => 100,\n\t\t\t\t\t\t\t\t\t\t'menu_icon' => 'dashicons-admin-generic',\n\t\t\t\t\t\t\t\t\t\t'supports' => array('title','custom-fields','revisions'),\n\t\t\t\t\t\t\t\t\t\t'labels' => array('name' => __('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'singular_name' => __('Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'menu_name' =>\t__('Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'add_new' => __('Add Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'add_new_item' => __('Add New Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit' => __('Edit', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'edit_item' => __('Edit Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'new_item' => __('New Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'view' => __('View Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'view_item' => __('View Options Page', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'search_items' => __('Search Options Pages', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'not_found' => __('No Options Pages Found', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'not_found_in_trash' => __('No Options Pages Found in Trash', $this->text_domain),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'parent' => __('Parent Options Page', $this->text_domain)));\n\t\t\tregister_post_type($this->post_type, $args);\n\t\t}", "function register_post_types(){\n }", "function create_post_type() {\r\n register_post_type( 'nyheter',\r\n array(\r\n 'labels' => array(\r\n 'name' => __( 'Nyheter' ),\r\n 'singular_name' => __( 'Nyheter' )\r\n ),\r\n 'public' => true,\r\n 'has_archive' => true,\r\n 'supports' => array('title', 'editor', 'thumbnail')\r\n )\r\n );\r\n}", "function cursos_post_type() {\n\n $labels = array(\n 'name' => _x( 'cursos', 'Post Type General Name', 'text_domain' ),\n 'singular_name' => _x( 'curso', 'Post Type Singular Name', 'text_domain' ),\n 'menu_name' => __( 'cursos', 'text_domain' ),\n 'name_admin_bar' => __( 'Post Type', 'text_domain' ),\n 'archives' => __( 'Item Archives', 'text_domain' ),\n 'attributes' => __( 'Item Attributes', 'text_domain' ),\n 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n 'all_items' => __( 'Todos os cursos', 'text_domain' ),\n 'add_new_item' => __( 'Add nova pergunta', 'text_domain' ),\n 'add_new' => __( 'novo cursoa', 'text_domain' ),\n 'new_item' => __( 'nova pergunta', 'text_domain' ),\n 'edit_item' => __( 'Edit Item', 'text_domain' ),\n 'update_item' => __( 'Update Item', 'text_domain' ),\n 'view_item' => __( 'View Item', 'text_domain' ),\n 'view_items' => __( 'View Items', 'text_domain' ),\n 'search_items' => __( 'Search Item', 'text_domain' ),\n 'not_found' => __( 'não encontrato', 'text_domain' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n 'featured_image' => __( 'Featured Image', 'text_domain' ),\n 'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n 'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n 'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n 'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n 'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n 'items_list' => __( 'Items list', 'text_domain' ),\n 'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n 'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n );\n $args = array(\n 'label' => __( 'cursos', 'text_domain' ),\n 'description' => __( 'cursos', 'text_domain' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields', 'excerpt'),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n register_post_type( 'cursos_post_type', $args );\n\n}", "public function registerCustomPostType()\n {\n if (!post_type_exists($this->slug)) {\n register_post_type($this->slug, $this->arguments);\n }\n }", "function wpcp_custom_post_type()\n{\n register_post_type('wpcp_server',\n array(\n 'labels' => array(\n 'name' => __('Servers', 'textdomain'),\n 'singular_name' => __('Server', 'textdomain'),\n ),\n 'public' => true,\n 'has_archive' => false,\n 'delete_with_user' => false,\n \"supports\" => array(\"customer\", \"author\"),\n 'menu_icon' => 'dashicons-cloud'\n )\n );\n}", "function reserva_post_type() {\n\n $labels = array(\n 'name' => _x( 'reservas', 'Post Type General Name', 'text_domain' ),\n 'singular_name' => _x( 'reserva', 'Post Type Singular Name', 'text_domain' ),\n 'menu_name' => __( 'Post Types', 'text_domain' ),\n 'name_admin_bar' => __( 'Post Type', 'text_domain' ),\n 'archives' => __( 'Item Archives', 'text_domain' ),\n 'attributes' => __( 'Item Attributes', 'text_domain' ),\n 'parent_item_colon' => __( 'Parent Item:', 'text_domain' ),\n 'all_items' => __( 'All Items', 'text_domain' ),\n 'add_new_item' => __( 'Add New Item', 'text_domain' ),\n 'add_new' => __( 'Add New', 'text_domain' ),\n 'new_item' => __( 'New Item', 'text_domain' ),\n 'edit_item' => __( 'Edit Item', 'text_domain' ),\n 'update_item' => __( 'Update Item', 'text_domain' ),\n 'view_item' => __( 'View Item', 'text_domain' ),\n 'view_items' => __( 'View Items', 'text_domain' ),\n 'search_items' => __( 'Search Item', 'text_domain' ),\n 'not_found' => __( 'Not found', 'text_domain' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n 'featured_image' => __( 'Featured Image', 'text_domain' ),\n 'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n 'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n 'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n 'insert_into_item' => __( 'Insert into item', 'text_domain' ),\n 'uploaded_to_this_item' => __( 'Uploaded to this item', 'text_domain' ),\n 'items_list' => __( 'Items list', 'text_domain' ),\n 'items_list_navigation' => __( 'Items list navigation', 'text_domain' ),\n 'filter_items_list' => __( 'Filter items list', 'text_domain' ),\n );\n $args = array(\n 'label' => __( 'reserva', 'text_domain' ),\n 'description' => __( 'personalizanilazioón de reserva', 'text_domain' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor', 'thumbnail' ),\n 'taxonomies' => array( 'category', 'post_tag' ),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-welcome-write-blog',\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'page',\n );\n register_post_type( 'reserva', $args );\n\n}", "function custom_post_types(){\n\t\n // CPT Portfolio\n $labels = array(\n 'name' => __('Formation'),\n 'all_items' => 'LA FORMATION ', // affiché dans le sous menu\n 'singular_name' => 'Formation',\n 'add_new_item' => 'add new formation ',\n 'edit_item' => 'Modify the diploma',\n 'menu_name' => 'Formation'\n );\n\n\t$args = array(\n 'labels' => $labels,\n 'public' => true,\n 'show_in_rest' => true,\n 'has_archive' => true,\n 'supports' => array( 'title', 'editor','thumbnail', 'excerpt' ),\n 'menu_position' => 2, \n 'menu_icon' => 'dashicons-welcome-learn-more',\n\t);\n\n\tregister_post_type( 'formation', $args );\n}", "function themo_tour_custom_post_type() {\n\n $labels = array(\n 'name' => _x( 'Tours', 'Post Type General Name', 'th-widget-pack' ),\n 'singular_name' => _x( 'Tour', 'Post Type Singular Name', 'th-widget-pack' ),\n 'menu_name' => __( 'Tours', 'th-widget-pack' ),\n 'parent_item_colon' => __( 'Parent Tour:', 'th-widget-pack' ),\n 'all_items' => __( 'All Tours', 'th-widget-pack' ),\n 'view_item' => __( 'View Tour', 'th-widget-pack' ),\n 'add_new_item' => __( 'Add New Tours', 'th-widget-pack' ),\n 'add_new' => __( 'Add New', 'th-widget-pack' ),\n 'edit_item' => __( 'Edit Tour', 'th-widget-pack' ),\n 'update_item' => __( 'Update Tour', 'th-widget-pack' ),\n 'search_items' => __( 'Search Tour', 'th-widget-pack' ),\n 'not_found' => __( 'Not found', 'th-widget-pack' ),\n 'not_found_in_trash' => __( 'Not found in Trash', 'th-widget-pack' ),\n );\n\n if ( function_exists( 'get_theme_mod' ) ) {\n $custom_slug = get_theme_mod( 'themo_tour_rewrite_slug', 'tour' );\n } else {\n $custom_slug = 'tour';\n }\n\n $rewrite = array(\n 'slug' => $custom_slug,\n 'with_front' => false,\n 'pages' => true,\n 'feeds' => true,\n );\n $args = array(\n 'label' => __( 'themo_tour', 'th-widget-pack' ),\n 'description' => __( 'Tours', 'th-widget-pack' ),\n 'labels' => $labels,\n 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats', ),\n 'taxonomies' => array( 'themo_tour_type' ),\n 'hierarchical' => false,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'menu_icon' => 'dashicons-location-alt',\n 'can_export' => true,\n 'has_archive' => false,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'rewrite' => $rewrite,\n 'capability_type' => 'post',\n );\n register_post_type( 'themo_tour', $args );\n\n }", "function register_post_types(){\n }", "function create_service_cpt() {\n\n\t\n\t$args = array(\n\t\t'label' => __( 'Service', 'basic' ),\n\t\t'description' => __( 'Custom post type ', 'basic' ),\n\t\t'labels' => $labels,\n\t\t'menu_icon' => 'dashicons-buddicons-topics',\n\t\t'supports' => array('title', 'editor', 'thumbnail', 'author', 'comments', 'post-formats'),\n\t\t// 'taxonomies' => array('category', 'post_tag'),\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'hierarchical' => false,\n\t\t'exclude_from_search' => false,\n\t\t'show_in_rest' => true,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n\t);\n\tregister_post_type( 'service', $args );\n\n}", "function register_post_types(){\n\t\trequire('lib/custom-types.php');\n\t}", "function add_config_post_type() {\n\t\t\n\t\t$labels = array(\n 'name' => _x( 'Công trình', 'Post Type General Name'),\n 'singular_name' => _x( 'Công trình', 'Post Type Singular Name'),\n 'menu_name' => __( 'Công trình'),\n 'name_admin_bar' => __( 'Công trình'),\n 'archives' => __( 'Item Archives'),\n 'attributes' => __( 'Item Attributes'),\n 'parent_item_colon' => __( 'Parent Item:'),\n 'all_items' => __( 'Tất cả công trình'),\n 'add_new_item' => __( 'Add công trình'),\n 'add_new' => __( 'Thêm công trình'),\n 'new_item' => __( 'Thêm mới'),\n 'edit_item' => __( 'Chỉnh sửa'),\n 'update_item' => __( 'Cập nhật'),\n 'view_item' => __( 'View Item'),\n 'view_items' => __( 'View Items'),\n 'search_items' => __( 'Search Item'),\n 'not_found' => __( 'Not found'),\n 'not_found_in_trash' => __( 'Not found in Trash'),\n 'featured_image' => __( 'Featured Image'),\n 'set_featured_image' => __( 'Set featured image'),\n 'remove_featured_image' => __( 'Remove featured image'),\n 'use_featured_image' => __( 'Use as featured image'),\n 'insert_into_item' => __( 'Insert into item'),\n 'uploaded_to_this_item' => __( 'Uploaded to this item'),\n 'items_list' => __( 'Bản ghi'),\n 'items_list_navigation' => __( 'Items list navigation'),\n 'filter_items_list' => __( 'Filter items list'),\n );\n $args = array(\n 'label' => __( 'Công trình'),\n 'description' => __( 'Công trình'),\n 'labels' => $labels,\n 'supports' => array( 'title','editor','revisions','thumbnail','author'),\n 'taxonomies' => array('category'),\n 'hierarchical' => true,\n 'public' => true,\n 'show_ui' => true,\n 'show_in_menu' => true,\n 'show_in_nav_menus' => true,\n 'show_in_admin_bar' => true,\n 'menu_position' => 5,\n 'can_export' => true,\n 'has_archive' => true,\n 'exclude_from_search' => false,\n 'publicly_queryable' => true,\n 'capability_type' => 'post',\n // 'rewrite' => array( 'slug' => 'danhsach' ),\n 'query_var' => true,\n 'menu_icon' => 'dashicons-admin-home'\n );\n register_post_type( 'estate', $args );\n \n }", "function ks_create_post_type() {\n\tregister_post_type( 'image-entry',\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( 'Comp. Entries', 'kilpailusivu' ),\n\t\t\t\t'singular_name' => __( 'Entry', 'kilpailusivu' ),\n\t\t\t\t'add_new' => __( 'Add New', 'kilpailusivu' ),\n\t\t\t\t'add_new_item' => __( 'Add New Entry', 'kilpailusivu' ),\n\t\t\t\t'edit' => __( 'Edit', 'kilpailusivu' ),\n\t\t\t\t'edit_item' => __( 'Edit Entry', 'kilpailusivu' ),\n\t\t\t\t'new_item' => __( 'New Entry', 'kilpailusivu' ),\n\t\t\t\t'view' => __( 'View', 'kilpailusivu' ),\n\t\t\t\t'view_item' => __( 'View Entry', 'kilpailusivu' ),\n\t\t\t\t'search_items' => __( 'Search Entries', 'kilpailusivu' ),\n\t\t\t\t'not_found' => __( 'No Entries found', 'kilpailusivu' ),\n\t\t\t\t'not_found_in_trash' => __( 'No Entries found in Trash', 'kilpailusivu' )\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'hierarchical' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'supports' => array(\n\t\t\t\t'title',\n\t\t\t),\n\t\t\t'menu_icon' => 'dashicons-smiley',\n\t\t\t'can_export' => true,\n\t\t\t'taxonomies' => array()\n\t\t) );\n}", "function garoe_create_post_type(){\n\n\t/*|>>>>>>>>>>>>>>>>>>>> BANNERS <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels = array(\n\t\t'name' => __('Banners'),\n\t\t'singular_name' => __('Banner'),\n\t\t'add_new' => __('Nuevo Banner'),\n\t\t'add_new_item' => __('Agregar nuevo Banner'),\n\t\t'edit_item' => __('Editar Banner'),\n\t\t'view_item' => __('Ver Banner'),\n\t\t'search_items' => __('Buscar Banners'),\n\t\t'not_found' => __('Banner no encontrado'),\n\t\t'not_found_in_trash' => __('Banner no encontrado en la papelera'),\n\t);\n\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag','banner_category'),\n\t\t'menu_icon' => 'dashicons-visibility',\n\t);\n\n\t/*|>>>>>>>>>>>>>>>>>>>> TESTIMONIO <<<<<<<<<<<<<<<<<<<<|*/\n\t$labels2 = array(\n\t\t'name' => __('Testimonios'),\n\t\t'singular_name' => __('Testimonio'),\n\t\t'add_new' => __('Nuevo Testimonio'),\n\t\t'add_new_item' => __('Agregar nuevo Testimonio'),\n\t\t'edit_item' => __('Editar Testimonio'),\n\t\t'view_item' => __('Ver Testimonio'),\n\t\t'search_items' => __('Buscar Testimonios'),\n\t\t'not_found' => __('Testimonio no encontrado'),\n\t\t'not_found_in_trash' => __('Testimonio no encontrado en la papelera'),\n\t);\n\n\t$args2 = array(\n\t\t'labels' => $labels2,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag','testimonio_category'),\n\t\t'menu_icon' => 'dashicons-megaphone'\n\t);\n\n\t/*|>>>>>>>>>>>>>>>>>>>> Galería Imágenes <<<<<<<<<<<<<<<<<<<<|*/\n\t$labels3 = array(\n\t\t'name' => __('Galería Imagen'),\n\t\t'singular_name' => __('Imagen'),\n\t\t'add_new' => __('Nueva Imagen'),\n\t\t'add_new_item' => __('Agregar nueva Imagen'),\n\t\t'edit_item' => __('Editar Imagen'),\n\t\t'view_item' => __('Ver Imagen'),\n\t\t'search_items' => __('Buscar Imagen'),\n\t\t'not_found' => __('Imagen no encontrado'),\n\t\t'not_found_in_trash' => __('Imagen no encontrado en la papelera'),\n\t);\n\n\t$args3 = array(\n\t\t'labels' => $labels3,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag'),\n\t\t'menu_icon' => 'dashicons-format-gallery'\n\t);\n\n\t/*|>>>>>>>>>>>>>>>>>>>> Galería Videos <<<<<<<<<<<<<<<<<<<<|*/\n\t$labels4 = array(\n\t\t'name' => __('Galería Videos'),\n\t\t'singular_name' => __('Video'),\n\t\t'add_new' => __('Nueva Video'),\n\t\t'add_new_item' => __('Agregar nueva Video'),\n\t\t'edit_item' => __('Editar Video'),\n\t\t'view_item' => __('Ver Video'),\n\t\t'search_items' => __('Buscar Video'),\n\t\t'not_found' => __('Video no encontrado'),\n\t\t'not_found_in_trash' => __('Video no encontrado en la papelera'),\n\t);\n\n\t$args4 = array(\n\t\t'labels' => $labels4,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag'),\n\t\t'menu_icon' => 'dashicons-video-alt3'\n\t);\n\n\t/*|>>>>>>>>>>>>>>>>>>>> SERVICIO <<<<<<<<<<<<<<<<<<<<|*/\n\t$labels5 = array(\n\t\t'name' => __('Servicios'),\n\t\t'singular_name' => __('Servicio'),\n\t\t'add_new' => __('Nuevo Servicio'),\n\t\t'add_new_item' => __('Agregar nuevo Servicio'),\n\t\t'edit_item' => __('Editar Servicio'),\n\t\t'view_item' => __('Ver Servicio'),\n\t\t'search_items' => __('Buscar Servicio'),\n\t\t'not_found' => __('Testimonio no encontrado'),\n\t\t'not_found_in_trash' => __('Testimonio no encontrado en la papelera'),\n\t);\n\n\t$args5 = array(\n\t\t'labels' => $labels5,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag'),\n\t\t'menu_icon' => 'dashicons-portfolio'\n\t);\n\t\n\t/*|>>>>>>>>>>>>>>>>>>>> REGISTRAR <<<<<<<<<<<<<<<<<<<<|*/\n\tregister_post_type('banner',$args);\n\tregister_post_type('testimonio',$args2);\n\tregister_post_type('galeria-imagen',$args3);\n\tregister_post_type('galeria-video',$args4);\n\tregister_post_type('servicio',$args5);\n}", "protected function setPostTypeObject(){\n\t\treturn array(\n\t\t\t'label' => _x('genres', 'genre', 'cpt_genre'),\n\t\t\t'labels' => array(\n\t\t\t\t'name' => _x('Genres', 'genre', 'cpt_genre'),\n\t\t\t\t'singular_name' => _x('genre', 'genre', 'cpt_genre'),\n\t\t\t\t'add_new' => _x('Add new genre', 'genre', 'cpt_genre'),\n\t\t\t\t'all_items' => _x('Genres', 'genre', 'cpt_genre'),\n\t\t\t\t'add_new_item' => _x('Add new genre', 'genre', 'cpt_genre'),\n\t\t\t\t'edit_item' => _x('Edit genre', 'genre', 'cpt_genre'),\n\t\t\t\t'new_item' => _x('New genre', 'genre', 'cpt_genre'),\n\t\t\t\t'view_item' => _x('Show genre', 'genre', 'cpt_genre'),\n\t\t\t\t'search_items' => _x('Search genres', 'genre', 'cpt_genre'),\n\t\t\t\t'not_found' => _x('No genres found', 'genre', 'cpt_genre'),\n\t\t\t\t'not_found_in_trash' => _x('No genres found in the trash', 'genre', 'cpt_genre'),\n\t\t\t\t'parent_item_colon' => _x('Genre', 'genre', 'cpt_genre'),\n\t\t\t\t'menu_name' => _x('Genres catalog', 'genre', 'cpt_genre')\n\t\t\t),\n\t\t\t'description' => _x('Genres for music catalog', 'genre', 'cpt_genre'),\n\t\t\t'public' => true,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_nav_menus' => false,\n\t\t\t'show_in_menu' => 'edit.php?post_type=music',\n\t\t\t'show_in_admin_bar' => true,\n\t\t\t'menu_position' => null,\n\t\t\t'menu_icon' => null,\n\t\t\t'capability_type' => array( 'genre', 'genres' ),\n\t\t\t'hierarchical' => true,\n\t\t\t'supports' => array( 'title', 'editor' ),\n\t\t\t'has_archive' => true,\n\t\t\t'rewrite' => array( 'slug' => __('genres', 'cpt_genre'), 'with_front' => true, 'feeds' => true, 'pages' => true ),\n\t\t\t'query_var' => true,\n\t\t\t'can_export' => false\n\t\t);\n\t}", "public function create_post_type() {\n\n\t\t\t$this->register_post_type( array(\n\t\t\t\t'hierarchical' => false,\n\t\t\t\t'public' => true,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'show_in_menu' => true,\n\t\t\t\t'menu_position' => 6.9,\n\t\t\t\t'menu_icon' => 'dashicons-book-alt',\n\t\t\t\t'show_in_admin_bar' => true,\n\t\t\t\t'show_in_nav_menus' => false,\n\t\t\t\t'can_export' => true,\n\t\t\t\t'has_archive' => 'manuals',\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t\t'publicly_queryable' => true,\n\t\t\t\t'capability_type' => 'post',\n\t\t\t\t'show_in_rest' => true,\n\t\t\t) );\n\n\t\t\tnew WPS\\Schema\\Entry_Schema( $this->post_type, 'book' );\n\n\t\t}", "function create_obit_posttype() {\n\t\tregister_post_type( 'obituary',\n\t\t array (\n\t\t 'labels' => array(\n\t\t 'name' => __( 'Obituaries' ),\n\t\t 'singular_name' => __( 'Obituary' )\n\t\t ),\n\t\t 'taxonomies' => array('category', 'post_tag'),\n\t\t 'public' => true,\n\t\t 'has_archive' => true,\n\t\t 'supports' => array( 'title', 'editor', 'excerpt', 'custom-fields', 'thumbnail' ),\n\t\t 'rewrite' => array('slug' => 'obituary'),\n\t\t) );\n\t\t//flush_rewrite_rules();\n\t}", "function create_post_type() {\n\t// register custom post type\n\tregister_post_type( 'sub_post',\n\t\tarray(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( ' Sub Posts ' ),\n\t\t\t\t'singular_name' => __( 'Sub Post' ),\n\t\t\t\t'add_new_item' => __( 'Add New Sub Post' ),\n\t\t\t\t'edit_item' => __( 'Edit Sub Post' ),\n\t\t\t\t'new_item' => __( 'New Sub Post' ),\n\t\t\t\t'view' => __( 'View Sub Post' ),\n\t\t\t\t'view_item' => __( 'View Sub Post' ),\n\t\t\t\t'search_items' => __( 'Search Sub Post' ),\n\t\t\t\t'not_found' => __( 'No Sub Posts found' ),\n\t\t\t\t'not_found_in_trash' => __( 'No Sub Posts found in Trash' ),\n\t\t\t\t'parent' => __( 'Parent Article' ),\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'has_archive' => true,\n\t\t\t'rewrite' => true,\n\t\t\t'hierarchical' => true,\n\t\t\t'query_var' => true,\n\t\t\t'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'custom-fields', 'comments' ),\n\t\t\t'taxonomies' => array('category','post_tag'),\n\t\t)\n\t);\n\n\t// register custom taxonomy\n\n}", "function init_post_type() {\n\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Unit', 'Post Type General Name', 'wppm' ),\n\t\t\t'singular_name' => _x( 'Unit', 'Post Type Singular Name', 'wppm' ),\n\t\t\t'menu_name' => __( 'Units', 'wppm' ),\n\t\t\t'parent_item_colon' => __( 'Parent Item:', 'wppm' ),\n\t\t\t'all_items' => __( 'All Units', 'wppm' ),\n\t\t\t'view_item' => __( 'View Unit', 'wppm' ),\n\t\t\t'add_new_item' => __( 'Add New Unit', 'wppm' ),\n\t\t\t'add_new' => __( 'Add New', 'wppm' ),\n\t\t\t'edit_item' => __( 'Edit Unit', 'wppm' ),\n\t\t\t'update_item' => __( 'Update Unit', 'wppm' ),\n\t\t\t'search_items' => __( 'Search Units', 'wppm' ),\n\t\t\t'not_found' => __( 'Not found', 'wppm' ),\n\t\t\t'not_found_in_trash' => __( 'Not found in Trash', 'wppm' ),\n\t\t);\n\t\t$args = array(\n\t\t\t'label' => __( 'units', 'wppm' ),\n\t\t\t'description' => __( 'Units', 'wppm' ),\n\t\t\t'labels' => $labels,\n\t\t\t'supports' => array( 'title', 'thumbnail', ),\n\t\t\t'hierarchical' => false,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_in_menu' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_in_admin_bar' => true,\n\t\t\t'menu_position' => 5,\n\t\t\t//'menu_icon' => '',\n\t\t\t'can_export' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'exclude_from_search' => false,\n\t\t\t'publicly_queryable' => true,\n\t\t\t'capability_type' => 'post',\n\t\t);\n\t\tregister_post_type( 'units', $args );\n\t\tflush_rewrite_rules();\n\t\t\n\t\tadd_image_size( 'tiles-featured', 225, 225, true );\n\t\tadd_image_size( 'mini-tiles', 80, 55, true );\n\t}", "function custom_post_type() {\n\n// Set UI labels for Custom Post Type\n\t$labels = array(\n\t\t'name' => _x( 'Engagements', 'Post Type General Name'),\n\t\t'singular_name' => _x( 'Engagement', 'Post Type Singular Name'),\n\t\t'menu_name' => __( 'Engagements'),\n\t\t'all_items' => __( 'All Engagements'),\n\t\t'view_item' => __( 'View Engagement'),\n\t\t'add_new_item' => __( 'Add New Engagement'),\n\t\t'add_new' => __( 'Add New'),\n\t\t'edit_item' => __( 'Edit Engagement'),\n\t\t'update_item' => __( 'Update Engagement')\n\n\t\t\n\t);\n\t\n// Set other options for Custom Post Type\n\t\n\t$args = array(\n\t\t'label' => __( 'engagements'),\n\t\t'labels' => $labels,\n\t\t// Features this CPT supports in Post Editor\n\t\t'supports' => array( 'title', 'editor'),\n \n\t\t/* A hierarchical CPT is like Pages and can have\n\t\t* Parent and child items. A non-hierarchical CPT\n\t\t* is like Posts.\n\t\t*/\t\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'show_in_nav_menus' => false,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_position' => 5,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => true,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'post',\n 'rewrite' => array(\"slug\" => \"engagements\"),\n 'register_meta_box_cb' => 'add_engagements_metaboxes' // function hooking up metaboxes\n\t);\n\t\n\t// Registering your Custom Post Type\n\tregister_post_type( 'engagements', $args );\n\n}", "function zmpm_register_post_type() {\n\t\n\t$labels = array(\n\t\t'name' => 'Permissions',\n\t\t'singular_name' => 'Permission',\n\t\t'menu_name' => 'Permissions',\n\t\t'name_admin_bar' => 'Permission',\n\t\t'archives' => 'Permission Archives',\n\t\t'attributes' => 'Permission Attributes',\n\t\t'parent_item_colon' => 'Parent Permission:',\n\t\t'all_items' => 'Permissions',\n\t\t'add_new_item' => 'Add New Permission',\n\t\t'add_new' => 'Add New',\n\t\t'new_item' => 'New Permission',\n\t\t'edit_item' => 'Edit Permission',\n\t\t'update_item' => 'Update Permission',\n\t\t'view_item' => 'View Permission',\n\t\t'view_items' => 'View Permissions',\n\t\t'search_items' => 'Search Permission',\n\t\t'not_found' => 'Not found',\n\t\t'not_found_in_trash' => 'Not Found in Trash',\n\t\t'featured_image' => 'Featured Image',\n\t\t'set_featured_image' => 'Set featured image',\n\t\t'remove_featured_image' => 'Remove featured image',\n\t\t'use_featured_image' => 'Use as featured image',\n\t\t'insert_into_item' => 'Insert into permission',\n\t\t'uploaded_to_this_item' => 'Uploaded to this permission',\n\t\t'items_list' => 'Permissions list',\n\t\t'items_list_navigation' => 'Permissions list navigation',\n\t\t'filter_items_list' => 'Filter permissions list',\n\t);\n\t$args = array(\n\t\t'label' => 'Permission',\n\t\t'description' => 'ZingMap permissions',\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title' ),\n\t\t'hierarchical' => false,\n\t\t'public' => false,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => 'users.php',\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-lock',\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => false,\n\t\t'can_export' => true,\n\t\t'has_archive' => false,\n\t\t'exclude_from_search' => true,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t);\n\tregister_post_type( 'zmpm_permission', $args );\n\t\n}", "public function register_post_type()\n\t{\n\n\t\tregister_post_type( 'partner', array(\n\t\t\t'labels' => array(\n\t\t\t\t'name' => _x( 'Partners', 'post type general name', 'custom-post-type-partners' ),\n\t\t\t\t'singular_name' => _x( 'Partner', 'post type singular name', 'custom-post-type-partners' ),\n\t\t\t\t'add_new' => _x( 'Add New', 'Partner', 'custom-post-type-partners' ),\n\t\t\t\t'add_new_item' => __( 'Add New Partner', 'custom-post-type-partners' ),\n\t\t\t\t'edit_item' => __( 'Edit Partner', 'custom-post-type-partners' ),\n\t\t\t\t'new_item' => __( 'New Partner', 'custom-post-type-partners' ),\n\t\t\t\t'all_items' => __( 'All Partners', 'custom-post-type-partners' ),\n\t\t\t\t'view_item' => __( 'View Partner', 'custom-post-type-partners' ),\n\t\t\t\t'search_items' => __( 'Search Partners', 'custom-post-type-partners' ),\n\t\t\t\t'not_found' => __( 'No Partners found', 'custom-post-type-partners' ),\n\t\t\t\t'not_found_in_trash' => __( 'No Partners found in Trash', 'custom-post-type-partners' ),\n\t\t\t\t'parent_item_colon' => '',\n\t\t\t\t'menu_name' => __( 'Partners', 'custom-post-type-partners' )\n\t\t\t),\n\t\t\t'public' => TRUE,\n\t\t\t'publicly_queryable' => TRUE,\n\t\t\t'show_ui' => TRUE,\n\t\t\t'show_in_menu' => TRUE,\n\t\t\t'query_var' => TRUE,\n\t\t\t'rewrite' => TRUE,\n\t\t\t'capability_type' => 'post',\n\t\t\t'has_archive' => FALSE,\n\t\t\t'hierarchical' => FALSE,\n\t\t\t'menu_position' => NULL,\n\t\t\t'menu_icon' => 'dashicons-admin-links',\n\t\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'page-attributes' )\n\t\t) );\n\n\t}", "function news_custom_post() {\n $args = array(\n 'public' => true,\n 'label' => 'News',\n 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ),\n 'show_ui' => true,\n 'publicly_queryable' => true,\n 'taxonomies' => array('category', 'post_tag'),\n 'rewrite' => array( 'slug' => 'news' )\n\t\n );\n register_post_type('news', $args);\n}", "function create_post_type(){\n\n\t/*|>>>>>>>>>>>>>>>>>>>> BANNERS <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels = array(\n\t\t'name' => __('Banners'),\n\t\t'singular_name' => __('Banner'),\n\t\t'add_new' => __('Nuevo Banner'),\n\t\t'add_new_item' => __('Agregar nuevo Banner'),\n\t\t'edit_item' => __('Editar Banner'),\n\t\t'view_item' => __('Ver Banner'),\n\t\t'search_items' => __('Buscar Banners'),\n\t\t'not_found' => __('Banner no encontrado'),\n\t\t'not_found_in_trash' => __('Banner no encontrado en la papelera'),\n\t);\n\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => true,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag','banner_category'),\n\t\t'menu_icon' => 'dashicons-visibility',\n\t);\n\n\t/*|>>>>>>>>>>>>>>>>>>>> SERVICIOS <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels2 = array(\n\t\t'name' => __('Servicios'),\n\t\t'singular_name' => __('Servicio'),\n\t\t'add_new' => __('Nuevo Servicio'),\n\t\t'add_new_item' => __('Agregar nuevo Servicio'),\n\t\t'edit_item' => __('Editar Servicio'),\n\t\t'view_item' => __('Ver Servicio'),\n\t\t'search_items' => __('Buscar Servicios'),\n\t\t'not_found' => __('Servicio no encontrado'),\n\t\t'not_found_in_trash' => __('Servicio no encontrado en la papelera'),\n\t);\n\n\t$args2 = array(\n\t\t'labels' => $labels2,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag','category','servicio_category'),\n\t\t'menu_icon' => 'dashicons-exerpt-view',\n\t);\t\n\n\n\t/*|>>>>>>>>>>>>>>>>>>>> CLIENTES <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels4 = array(\n\t\t'name' => __('Clientes'),\n\t\t'singular_name' => __('Cliente'),\n\t\t'add_new' => __('Nuevo Cliente'),\n\t\t'add_new_item' => __('Agregar nuevo Cliente'),\n\t\t'edit_item' => __('Editar Cliente'),\n\t\t'view_item' => __('Ver Cliente'),\n\t\t'search_items' => __('Buscar Clientes'),\n\t\t'not_found' => __('Cliente no encontrado'),\n\t\t'not_found_in_trash' => __('Cliente no encontrado en la papelera'),\n\t);\n\n\t$args4 = array(\n\t\t'labels' => $labels4,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag','category'),\n\t\t'menu_icon' => 'dashicons-money',\n\t);\t\n\n\n\t/*|>>>>>>>>>>>>>>>>>>>> PROMOCIONES <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels7 = array(\n\t\t'name' => __('Promociones'),\n\t\t'singular_name' => __('Promoción'),\n\t\t'add_new' => __('Nueva Promoción'),\n\t\t'add_new_item' => __('Agregar nueva Promoción'),\n\t\t'edit_item' => __('Editar Promoción'),\n\t\t'view_item' => __('Ver Promoción'),\n\t\t'search_items' => __('Buscar Promoción'),\n\t\t'not_found' => __('Promoción no encontrada'),\n\t\t'not_found_in_trash' => __('Promoción no encontrada en la papelera'),\n\t);\n\n\t$args7 = array(\n\t\t'labels' => $labels7,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('category','post-tag'),\n\t\t'menu_icon' => 'dashicons-products',\n\t);\n\n\n\t/*|>>>>>>>>>>>>>>>>>>>> REGISTRAR <<<<<<<<<<<<<<<<<<<<|*/\n\tregister_post_type( 'banner' , $args );\n\tregister_post_type( 'servicio' , $args2 );\n\tregister_post_type( 'cliente' , $args4 );\n\tregister_post_type( 'promocion' , $args7 );\n\t\n\tflush_rewrite_rules();\n}", "function custom_post_type1()\n{\n\n\t$labels = array(\n\t\t'name' => _x('Testimonios', 'Post Type General Name', 'text_domain'),\n\t\t'singular_name' => _x('Testimonios', 'Post Type Singular Name', 'text_domain'),\n\t\t'menu_name' => __('Testimonios', 'text_domain'),\n\t\t'name_admin_bar' => __('Testimonio', 'text_domain'),\n\t\t'archives' => __('Item Testimonios', 'text_domain'),\n\t\t'attributes' => __('Item Testimonio', 'text_domain'),\n\t\t'parent_item_colon' => __('Parent Item:', 'text_domain'),\n\t\t'all_items' => __('All Items', 'text_domain'),\n\t\t'add_new_item' => __('Add New Item', 'text_domain'),\n\t\t'add_new' => __('Add New', 'text_domain'),\n\t\t'new_item' => __('New Item', 'text_domain'),\n\t\t'edit_item' => __('Edit Item', 'text_domain'),\n\t\t'update_item' => __('Update Item', 'text_domain'),\n\t\t'view_item' => __('View Item', 'text_domain'),\n\t\t'view_items' => __('View Items', 'text_domain'),\n\t\t'search_items' => __('Search Item', 'text_domain'),\n\t\t'not_found' => __('Not found', 'text_domain'),\n\t\t'not_found_in_trash' => __('Not found in Trash', 'text_domain'),\n\t\t'featured_image' => __('Featured Image', 'text_domain'),\n\t\t'set_featured_image' => __('Set featured image', 'text_domain'),\n\t\t'remove_featured_image' => __('Remove featured image', 'text_domain'),\n\t\t'use_featured_image' => __('Use as featured image', 'text_domain'),\n\t\t'insert_into_item' => __('Insert into item', 'text_domain'),\n\t\t'uploaded_to_this_item' => __('Uploaded to this item', 'text_domain'),\n\t\t'items_list' => __('Items list', 'text_domain'),\n\t\t'items_list_navigation' => __('Items list navigation', 'text_domain'),\n\t\t'filter_items_list' => __('Filter items list', 'text_domain'),\n\t);\n\t$args = array(\n\t\t'label' => __('Testimonio', 'text_domain'),\n\t\t'description' => __('Testimonios', 'text_domain'),\n\t\t'labels' => $labels,\n\t\t'supports' => array('title', 'thumbnail', 'editor', 'excerpt'),\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'show_in_admin_bar' => true,\n\t\t'menu_icon' => 'dashicons-editor-quote',\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t);\n\tregister_post_type('testimonio', $args);\n\n}", "function generate_post_meta()\n {\n $post_types = apply_filters('generate_entry_meta_post_types', array(\n 'post',\n ));\n\n if (in_array(get_post_type(), $post_types)): ?>\n<div class=\"entry-meta\">\n <?php generate_posted_on();?>\n</div><!-- .entry-meta -->\n<?php endif;\n }", "function pluginprefix_setup_post_type()\n{\n register_post_type('post-nasa-gallery', [\n 'label' => 'Nasa Images Posts',\n 'public' => true\n ]);\n}", "public function register_post_type() {\n\t $args = array(\n\t\t\t'public' => true,\n\t\t\t'label' => 'Questions'\n\t\t);\n\t register_post_type( 'questions', $args );\n\t}", "public static function register_post_type()\n {\n\n \t register_post_type( 'books',\n\t\t array(\n\t\t 'labels' => array(\n\t\t 'name' => __( 'Books' ),\n\t\t 'singular_name' => __( 'Books' )\n\t\t ),\n\t\t 'public' => true,\n\t\t 'has_archive' => false,\n\t\t )\n\t\t );\n\n }", "function custom_post_Contentp() {\r\n\tregister_post_type( 'contentp',\r\n\t\tarray('labels' => array(\r\n\t\t\t'name' => __('Teacher Education Presentations', 'emc'),\r\n\t\t\t'singular_name' => __('Teacher Education Presentation', 'emc'),\r\n\t\t\t'all_items' => __('All Teacher Education Presentations', 'emc'),\r\n\t\t\t'add_new' => __('Add New', 'emc'),\r\n\t\t\t'add_new_item' => __('Add New Teacher Education Presentation', 'emc'),\r\n\t\t\t'edit' => __( 'Edit', 'emc' ),\r\n\t\t\t'edit_item' => __('Edit Teacher Education Presentation', 'emc'),\r\n\t\t\t'new_item' => __('New Teacher Education Presentation', 'emc'),\r\n\t\t\t'view_item' => __('View Teacher Education Presentation', 'emc'),\r\n\t\t\t'search_items' => __('Search Teacher Education Presentations', 'emc'),\r\n\t\t\t'not_found' => __('Nothing found in the Database.', 'emc'),\r\n\t\t\t'not_found_in_trash' => __('Nothing found in Trash', 'emc'),\r\n\t\t\t'parent_item_colon' => ''\r\n\t\t\t),\r\n\t\t\t'description' => __( 'This is the example Teacher Education Presentation', 'emc' ),\r\n\t\t\t'public' => true,\r\n\t\t\t'publicly_queryable' => true,\r\n\t\t\t'exclude_from_search' => false,\r\n\t\t\t'show_ui' => true,\r\n\t\t\t'query_var' => true,\r\n\t\t\t'menu_position' => 5,\r\n\t\t\t'menu_icon' => get_stylesheet_directory_uri() . '/img/emc.png',\r\n\t\t\t'rewrite'\t=> array( 'slug' => 'teacher-education-presentations', 'with_front' => false ),\r\n\t\t\t'has_archive' => 'teacher-education-presentations',\r\n\t\t\t'capability_type' => 'post',\r\n\t\t\t'hierarchical' => true,\r\n\t\t\t'supports' => array( 'title', 'category', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'sticky')\r\n\t \t)\r\n\t);\r\n\t//register_taxonomy_for_object_type('category', 'reasearch');\r\n\t//register_taxonomy_for_object_type('post_tag', 'reasearch');\r\n}", "public function register_post_type(){\n\t\tif(!class_exists('CPT')) return;\n\t\n\t\t$this->post_type = new CPT(\n\t\t\tarray(\n\t\t\t 'post_type_name' => 'slide',\n\t\t\t 'singular' => 'Slide',\n\t\t\t 'plural' => 'Slides',\n\t\t\t 'slug' => 'slide'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'has_archive' \t\t\t=> \ttrue,\n\t\t\t\t'menu_position' \t\t=> \t8,\n\t\t\t\t'menu_icon' \t\t\t=> \t'dashicons-layout',\n\t\t\t\t'supports' \t\t\t\t=> \tarray('title', 'excerpt', 'content','thumbnail', 'post-formats', 'custom-fields')\n\t\t\t)\n\t\t);\n\t\t\n\t\t$labels = array('menu_name'=>'Types');\n\t\t$this->post_type->register_taxonomy('type',array(\n\t\t\t'hierarchical' => true,\n\t\t\t'public' => true,\n\t\t\t'show_ui' => true,\n\t\t\t'show_admin_column' => true,\n\t\t\t'show_in_nav_menus' => true,\n\t\t\t'show_tagcloud' => true,\n\t\t),$labels);\n\t}", "static function register() {\n // register the post type\n register_post_type('sale-flat', array(\n\t\t\n\t\t\t'labels'=> array(\n\t\t\t\t'name' => _x( 'Eladó ingatlanok', 'theme-phrases' ),\n\t\t\t\t'singular_name' => _x( 'Eladó ingatlan', 'theme-phrases' ),\n\t\t\t\t'menu_name' => _x( 'Eladó ingatlanok', 'theme-phrases' ),\n\t\t\t\t'name_admin_bar' => _x( 'Eladó ingatlan', 'theme-phrases' ),\n\t\t\t\t'add_new' => _x( 'Új eladó ingatlan', 'theme-phrases' ),\n\t\t\t\t'add_new_item' => __( 'Új eladó ingatlan hozzáadása', 'theme-phrases' ),\n\t\t\t\t'new_item' => __( 'Új eladó ingatlan', 'theme-phrases' ),\n\t\t\t\t'edit_item' => __( 'Eladó ingatlan szerkesztése', 'theme-phrases' ),\n\t\t\t\t'view_item' => __( 'Eladó ingatlan megtekintése', 'theme-phrases' ),\n\t\t\t\t'all_items' => __( 'Összes eladó ingatlan', 'theme-phrases' ),\n\t\t\t\t'search_items' => __( 'Eladó ingatlan keresése', 'theme-phrases' ),\n\t\t\t\t'parent_item_colon' => __( 'Parent eladó ingatlan:', 'theme-phrases' ),\n\t\t\t\t'not_found' => __( 'Nincsenek eladó ingatlanok.', 'theme-phrases' ),\n\t\t\t\t'not_found_in_trash' => __( 'Nincsenek eladó ingatlanok a kukában.', 'theme-phrases' )\n\t\t\t),\n 'description' => __('Eladó ingatlanok', 'theme-phrases'),\n 'exclude_from_search' => true,\n 'publicly_queryable' => true,\n 'public' => true,\n 'show_ui' => true,\n 'auto-draft' => false,\n 'show_in_admin_bar' => true,\n 'show_in_nav_menus' => true,\n 'menu_position' => 4,\n 'menu_icon'\t=> 'dashicons-tag',\n 'revisions' => false,\n 'hierarchical' => true,\n 'has_archive' => true,\n\t\t\t'supports' => array('title','editor','thumbnail'),\n 'rewrite' => false,\n 'can_export' => false,\n 'capabilities' => array (\n 'create_posts' => 'edit_posts',\n 'edit_post' => 'edit_posts',\n 'read_post' => 'edit_posts',\n 'delete_posts' => 'edit_posts',\n 'delete_post' => 'edit_posts',\n 'edit_posts' => 'edit_posts',\n 'edit_others_posts' => 'edit_posts',\n 'publish_posts' => 'edit_posts',\n 'read_private_posts' => 'edit_posts',\n ),\n 'register_meta_box_cb' => array('SaleFlatPostType', 'add_metabox') \n ));\n }", "public static function register_post_type() {\n\t\t$labels = array(\n\t\t\t'name' => _x( 'Collections', 'post type general name', 'wp-recipe-maker-premium' ),\n\t\t\t'singular_name' => _x( 'Collection', 'post type singular name', 'wp-recipe-maker-premium' ),\n\t\t);\n\n\t\t$args = apply_filters( 'wprm_recipe_collections_post_type_arguments', array(\n\t\t\t'labels' \t=> $labels,\n\t\t\t'public' \t=> false,\n\t\t\t'rewrite' \t=> false,\n\t\t\t'capability_type' \t=> 'post',\n\t\t\t'query_var' \t=> false,\n\t\t\t'has_archive' \t=> false,\n\t\t\t'supports' \t\t\t\t=> array( 'title', 'author' ),\n\t\t\t'show_in_rest'\t\t\t=> true,\n\t\t\t'rest_base'\t\t\t\t=> WPRMPRC_POST_TYPE,\n\t\t\t'rest_controller_class' => 'WP_REST_Posts_Controller',\n\t\t));\n\n\t\tregister_post_type( WPRMPRC_POST_TYPE, $args );\n\t}", "function create_post_type(){\n\n\t/*|>>>>>>>>>>>>>>>>>>>> SLIDER HOME <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels = array(\n\t\t'name' => __('Slider Home'),\n\t\t'singular_name' => __('Slider'),\n\t\t'add_new' => __('Nuevo Slider'),\n\t\t'add_new_item' => __('Agregar nuevo Slider Principal'),\n\t\t'edit_item' => __('Editar Slider'),\n\t\t'view_item' => __('Ver Slider'),\n\t\t'search_items' => __('Buscar Slider'),\n\t\t'not_found' => __('Slider no encontrado'),\n\t\t'not_found_in_trash' => __('Slider no encontrado en la papelera'),\n\t);\n\n\t$args = array(\n\t\t'labels' => $labels,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => true,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag','banner_category'),\n\t\t'menu_icon' => 'dashicons-nametag',\n\t);\n\n\t/*|>>>>>>>>>>>>>>>>>>>> SERVICIOS <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels2 = array(\n\t\t'name' => __('Servicios'),\n\t\t'singular_name' => __('Servicio'),\n\t\t'add_new' => __('Nuevo Servicio'),\n\t\t'add_new_item' => __('Agregar nuevo Servicio'),\n\t\t'edit_item' => __('Editar Servicio'),\n\t\t'view_item' => __('Ver Servicio'),\n\t\t'search_items' => __('Buscar Servicios'),\n\t\t'not_found' => __('Servicio no encontrado'),\n\t\t'not_found_in_trash' => __('Servicio no encontrado en la papelera'),\n\t);\n\n\t$args2 = array(\n\t\t'labels' => $labels2,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes' ),\n\t\t'taxonomies' => array( 'servicio_category' , 'post_tag' ),\n\t\t'menu_icon' => 'dashicons-exerpt-view',\n\t);\t\n\n\t/*|>>>>>>>>>>>>>>>>>>>> CLIENTES <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels3 = array(\n\t\t'name' => __('Clientes'),\n\t\t'singular_name' => __('Sector o Categoría'),\n\t\t'add_new' => __('Nuevo Sector o Categoría'),\n\t\t'add_new_item' => __('Agregar nuevo Sector o Categoría'),\n\t\t'edit_item' => __('Editar Sector o Categoría'),\n\t\t'view_item' => __('Ver Sector o Categoría'),\n\t\t'search_items' => __('Buscar Sector o Categoría'),\n\t\t'not_found' => __('Sector o Categoría no encontrado'),\n\t\t'not_found_in_trash' => __('Sector o Categoría no encontrado en la papelera'),\n\t);\n\n\t$args3 = array(\n\t\t'labels' => $labels3,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag'),\n\t\t'menu_icon' => 'dashicons-money',\n\t);\t\n\n\t\n\t/*|>>>>>>>>>>>>>>>>>>>> GALERÍA IMAGENES <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels4 = array(\n\t\t'name' => __('Gal. Imágenes'),\n\t\t'singular_name' => __('Galería'),\n\t\t'add_new' => __('Nueva Galería'),\n\t\t'add_new_item' => __('Agregar nueva Galería'),\n\t\t'edit_item' => __('Editar Galería'),\n\t\t'view_item' => __('Ver Galería'),\n\t\t'search_items' => __('Buscar Galería'),\n\t\t'not_found' => __('Galería no encontrada'),\n\t\t'not_found_in_trash' => __('Galería no encontrada en la papelera'),\n\t);\n\n\t$args4 = array(\n\t\t'labels' => $labels4,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag'),\n\t\t'menu_icon' => 'dashicons-images-alt2',\n\t);\t\n\n\t/*|>>>>>>>>>>>>>>>>>>>> GALERÍA VIDEOS <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels5 = array(\n\t\t'name' => __('Gal. Videos'),\n\t\t'singular_name' => __('Video'),\n\t\t'add_new' => __('Nuevo Video'),\n\t\t'add_new_item' => __('Agregar nuevo Video'),\n\t\t'edit_item' => __('Editar Video'),\n\t\t'view_item' => __('Ver Video'),\n\t\t'search_items' => __('Buscar Video'),\n\t\t'not_found' => __('Video no encontrado'),\n\t\t'not_found_in_trash' => __('Video no encontrado en la papelera'),\n\t);\n\n\t$args5 = array(\n\t\t'labels' => $labels5,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag','category'),\n\t\t'menu_icon' => 'dashicons-video-alt',\n\t);\n\n\t/*|>>>>>>>>>>>>>>>>>>>> PRODUCTOS <<<<<<<<<<<<<<<<<<<<|*/\n\t\n\t$labels6 = array(\n\t\t'name' => __('Productos La Dorita'),\n\t\t'singular_name' => __('Producto'),\n\t\t'add_new' => __('Nuevo Producto'),\n\t\t'add_new_item' => __('Agregar nuevo Producto'),\n\t\t'edit_item' => __('Editar Producto'),\n\t\t'view_item' => __('Ver Producto'),\n\t\t'search_items' => __('Buscar Producto'),\n\t\t'not_found' => __('Producto no encontrado'),\n\t\t'not_found_in_trash' => __('Producto no encontrado en la papelera'),\n\t);\n\n\t$args6 = array(\n\t\t'labels' => $labels6,\n\t\t'has_archive' => true,\n\t\t'public' => true,\n\t\t'hierachical' => false,\n\t\t'supports' => array('title','editor','excerpt','custom-fields','thumbnail','page-attributes'),\n\t\t'taxonomies' => array('post-tag'),\n\t\t'menu_icon' => 'dashicons-cart',\n\t);\n\n\t/*|>>>>>>>>>>>>>>>>>>>> REGISTRAR <<<<<<<<<<<<<<<<<<<<|*/\n\tregister_post_type( 'slider-home' , $args );\n\tregister_post_type( 'servicio' , $args2 );\n\tregister_post_type( 'cliente' , $args3 );\n\tregister_post_type( 'galery-images' , $args4 );\n\tregister_post_type( 'galery-videos' , $args5 );\n\tregister_post_type( 'producto-dorita' , $args6 );\n\n\tflush_rewrite_rules();\n}", "function create_posttype() {\n\n\tregister_post_type( 'menu-item',\n\n\t// CPT Options\n\n\t\tarray(\n\n\t\t\t'labels' => array(\n\t\t\t\t'name' => __( 'Menu Item' ),\n\t\t\t\t'singular_name' => __( 'Menu Item' )\n\t\t\t),\n\t\t\t'public' => true,\n\t\t\t'has_archive' => true,\n\t\t\t'rewrite' => array('slug' => 'menu-item'),\n\t\t\t)\n\t\t);\n\t}", "public static function register_post_types() {}" ]
[ "0.7957035", "0.7894825", "0.7827647", "0.777877", "0.7684019", "0.7627908", "0.76031774", "0.75945985", "0.75725", "0.7566169", "0.75637126", "0.75570244", "0.7549632", "0.75488716", "0.7537637", "0.75317967", "0.7488675", "0.7487699", "0.74776417", "0.739443", "0.7391198", "0.73905605", "0.7374534", "0.73679036", "0.736767", "0.73571986", "0.73369074", "0.73314893", "0.73076034", "0.73001534", "0.72976446", "0.7287077", "0.7283789", "0.7281846", "0.7281605", "0.7281112", "0.7279398", "0.7276387", "0.7260315", "0.72589725", "0.7252222", "0.72510743", "0.7250106", "0.725005", "0.72364354", "0.7235433", "0.7228671", "0.7226941", "0.7194842", "0.7186836", "0.7180655", "0.71794164", "0.71781725", "0.7177518", "0.71693146", "0.71581656", "0.71552855", "0.7154212", "0.7148985", "0.71326035", "0.7130397", "0.7129807", "0.7121947", "0.71015275", "0.7098968", "0.709084", "0.7087208", "0.7087086", "0.70833737", "0.7071332", "0.7069825", "0.70688", "0.7067582", "0.70663273", "0.7062934", "0.70589864", "0.7055025", "0.7053698", "0.70510375", "0.70407885", "0.7036276", "0.70258033", "0.70248497", "0.7022144", "0.7019772", "0.7008647", "0.6998035", "0.69948006", "0.69939727", "0.69845146", "0.6983574", "0.69831413", "0.6980067", "0.69718134", "0.6969344", "0.6966771", "0.6963094", "0.69629955", "0.6958552", "0.6945985" ]
0.7170449
54
/ Registro de categoria para Productos
function ajarRegisterTaxonomy() { $args = array( 'hierarchical' => true, //con/sin jerarquia 'labels' => array( 'name' => 'Categorias de Productos', 'singular_name' => 'Categoria de Productos', ), 'show_in_nav_menu' => true, 'show_admin_column' => true, 'rewrite' => array('slug' => 'categoria-productos') ); register_taxonomy('categoria-productos', array('producto'), $args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function categoria($productos) {\r\n $opciones = array(); \r\n foreach($productos->producto as $producto) {\r\n $opciones[] = $producto->categoria;\r\n }\r\n //eliminar los duplicados para mostrar el select con las opciones\r\n $opciones = array_unique($opciones);\r\n\r\n //crear las opciones del select sin repetidos\r\n for ($i=0; $i < count($opciones); $i++) { \r\n echo \"<option value='\" . $opciones[$i] . \"'>\" . ucwords($opciones[$i]) . \"</option>\";\r\n }\r\n }", "public function HM_CategoCuentas()\n {\n }", "public function categories(){\n /* \n id_categoria_producto int NOT NULL AUTO_INCREMENT,\n\ttipo_producto varchar(20) NOT NULL ,\n\tcaracteristicas_producto varchar(100) ,\n CONSTRAINT pk_categoria_producto PRIMARY KEY ( id_categoria_producto )\n\n\n id_producto int NOT NULL AUTO_INCREMENT,\n\tt_cat_producto int NOT NULL ,\n\tnombre_producto varchar(50) NOT NULL ,\n\tfecha varchar(10) NOT NULL ,\n\tpeso varchar(10) NOT NULL ,\n\tCONSTRAINT pk_producto PRIMARY KEY ( id_producto )\n */ \n $sql = 'SELECT c.name_categoria,\n c.id,\n p.id,\n p.id_categoria,\n p.nombre_producto,\n p.peso\n FROM categoria AS c, producto AS p\n WHERE c.id = p.id_categoria';\n $categories = $this->db->query($sql)->fetchAll(PDO::FETCH_CLASS, 'Category');\n return $categories;\n }", "public function categorie()\n {\n $data[\"categories\"]=$this->categories->list();\n $this->template_admin->displayad('categories' , $data);\n }", "public function run()\n {\n $this->uploadFiles('product-categories');\n\n $categories = [\n [\n 'name' => 'Hot Promotions',\n 'icon' => 'icon-star',\n ],\n [\n 'name' => 'Electronics',\n 'icon' => 'icon-laundry',\n 'image' => 'product-categories/1.jpg',\n 'is_featured' => true,\n 'children' => [\n [\n 'name' => 'Consumer Electronic',\n 'children' => [\n [\n 'name' => 'Home Audio & Theaters',\n ],\n [\n 'name' => 'TV & Videos',\n ],\n [\n 'name' => 'Camera, Photos & Videos',\n ],\n [\n 'name' => 'Cellphones & Accessories',\n ],\n [\n 'name' => 'Headphones',\n ],\n [\n 'name' => 'Videos games',\n ],\n [\n 'name' => 'Wireless Speakers',\n ],\n [\n 'name' => 'Office Electronic',\n ],\n ],\n ],\n [\n 'name' => 'Accessories & Parts',\n 'children' => [\n [\n 'name' => 'Digital Cables',\n ],\n [\n 'name' => 'Audio & Video Cables',\n ],\n [\n 'name' => 'Batteries',\n ],\n ],\n ],\n ],\n ],\n [\n 'name' => 'Clothing',\n 'icon' => 'icon-shirt',\n 'image' => 'product-categories/2.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Computers',\n 'icon' => 'icon-desktop',\n 'image' => 'product-categories/3.jpg',\n 'is_featured' => true,\n 'children' => [\n [\n 'name' => 'Computer & Technologies',\n 'children' => [\n [\n 'name' => 'Computer & Tablets',\n ],\n [\n 'name' => 'Laptop',\n ],\n [\n 'name' => 'Monitors',\n ],\n [\n 'name' => 'Computer Components',\n ],\n ],\n ],\n [\n 'name' => 'Networking',\n 'children' => [\n [\n 'name' => 'Drive & Storages',\n ],\n [\n 'name' => 'Gaming Laptop',\n ],\n [\n 'name' => 'Security & Protection',\n ],\n [\n 'name' => 'Accessories',\n ],\n ],\n ],\n ],\n ],\n [\n 'name' => 'Home & Kitchen',\n 'icon' => 'icon-lampshade',\n 'image' => 'product-categories/4.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Health & Beauty',\n 'icon' => 'icon-heart-pulse',\n 'image' => 'product-categories/5.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Jewelry & Watch',\n 'icon' => 'icon-diamond2',\n 'image' => 'product-categories/6.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Technology Toys',\n 'icon' => 'icon-desktop',\n 'image' => 'product-categories/7.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Phones',\n 'icon' => 'icon-smartphone',\n 'image' => 'product-categories/8.jpg',\n 'is_featured' => true,\n ],\n [\n 'name' => 'Babies & Moms',\n 'icon' => 'icon-baby-bottle',\n ],\n [\n 'name' => 'Sport & Outdoor',\n 'icon' => 'icon-baseball',\n ],\n [\n 'name' => 'Books & Office',\n 'icon' => 'icon-book2',\n ],\n [\n 'name' => 'Cars & Motorcycles',\n 'icon' => 'icon-car-siren',\n ],\n [\n 'name' => 'Home Improvements',\n 'icon' => 'icon-wrench',\n ],\n ];\n\n ProductCategory::truncate();\n Slug::where('reference_type', ProductCategory::class)->delete();\n MetaBoxModel::where('reference_type', ProductCategory::class)->delete();\n\n foreach ($categories as $index => $item) {\n $this->createCategoryItem($index, $item);\n }\n\n // Translations\n DB::table('ec_product_categories_translations')->truncate();\n\n $translations = [\n [\n 'name' => 'Khuyến mãi hấp dẫn',\n ],\n [\n 'name' => 'Điện tử',\n 'children' => [\n [\n 'name' => 'Điện tử tiêu dùng',\n 'children' => [\n [\n 'name' => 'Thiết bị nghe nhìn',\n ],\n [\n 'name' => 'TV & Videos',\n ],\n [\n 'name' => 'Camera, Photos & Videos',\n ],\n [\n 'name' => 'Điện thoại di động & Phụ kiện',\n ],\n [\n 'name' => 'Tai nghe',\n ],\n [\n 'name' => 'Trò chơi video',\n ],\n [\n 'name' => 'Loa không dây',\n ],\n [\n 'name' => 'Điện tử văn phòng',\n ],\n ],\n ],\n [\n 'name' => 'Phụ kiện & Phụ tùng',\n 'children' => [\n [\n 'name' => 'Digital Cables',\n ],\n [\n 'name' => 'Audio & Video Cables',\n ],\n [\n 'name' => 'Pin',\n ],\n ],\n ],\n ],\n ],\n [\n 'name' => 'Quần áo',\n ],\n [\n 'name' => 'Máy tính',\n 'children' => [\n [\n 'name' => 'Máy tính & Công nghệ',\n 'children' => [\n [\n 'name' => 'Máy tính & Máy tính bảng',\n ],\n [\n 'name' => 'Máy tính xách tay',\n ],\n [\n 'name' => 'Màn hình',\n ],\n [\n 'name' => 'Linh kiện Máy tính',\n ],\n ],\n ],\n [\n 'name' => 'Mạng máy tính',\n 'children' => [\n [\n 'name' => 'Thiết bị lưu trữ',\n ],\n [\n 'name' => 'Máy tính xách tay chơi game',\n ],\n [\n 'name' => 'Thiết bị bảo mật',\n ],\n [\n 'name' => 'Phụ kiện',\n ],\n ],\n ],\n ],\n ],\n [\n 'name' => 'Đồ dùng làm bếp',\n ],\n [\n 'name' => 'Sức khỏe & làm đẹp',\n ],\n [\n 'name' => 'Trang sức & Đồng hồ',\n ],\n [\n 'name' => 'Đồ chơi công nghệ',\n ],\n [\n 'name' => 'Điện thoại',\n ],\n [\n 'name' => 'Mẹ và bé',\n ],\n [\n 'name' => 'Thể thao & ngoài trời',\n ],\n [\n 'name' => 'Sách & Văn phòng',\n ],\n [\n 'name' => 'Ô tô & Xe máy',\n ],\n [\n 'name' => 'Cải tiến nhà cửa',\n ],\n ];\n\n $count = 1;\n foreach ($translations as $translation) {\n\n $translation['lang_code'] = 'vi';\n $translation['ec_product_categories_id'] = $count;\n\n DB::table('ec_product_categories_translations')->insert(Arr::except($translation, ['children']));\n\n $count++;\n\n if (isset($translation['children'])) {\n foreach ($translation['children'] as $child) {\n\n $child['lang_code'] = 'vi';\n $child['ec_product_categories_id'] = $count;\n\n DB::table('ec_product_categories_translations')->insert(Arr::except($child, ['children']));\n\n $count++;\n\n if (isset($child['children'])) {\n foreach ($child['children'] as $item) {\n\n $item['lang_code'] = 'vi';\n $item['ec_product_categories_id'] = $count;\n\n DB::table('ec_product_categories_translations')->insert(Arr::except($item, ['children']));\n\n $count++;\n }\n }\n }\n }\n }\n }", "function saveCategories($product_id)\n {\n //var_dump(Category::$cats); exit;\n if(is_null($this->categories) || sizeof($this->categories) < 1){\n return;\n }\n \n foreach ($this->categories as $ids) {\n if(empty($ids)){\n continue;\n }\n \tif(isset(Category::$cats[$ids]) && is_object(Category::$cats[$ids])){\n\t $names[] = array('name'=>Category::$cats[$ids]->name);\n\t $cids[] = array('name'=>Category::$cats[$ids]->cid);\n\t $i = 0;\n\t $parent_id = $ids;\n\t \n\t while(($parent_id = Category::$cats[$parent_id]->parent_id) != 0){\n\t \n\t $names[] = array('name'=>Category::$cats[$parent_id]->name);\n\t $cids[] = array('name'=>Category::$cats[$parent_id]->cid);\n\t $i++;\n\t if($i > 7 ){ $i = 0; break; }\n\t }\n\t \t\n\t // \t\n\t \t$this->saveWords(Category::$cats[$ids]->name, $product_id, 2);\n\t \t $this->saveWords(Category::$cats[$ids]->description, $product_id, 1);\n\t\t//\t\t}\n\t\t\t}\n } \n\t\tif(isset($names)){\n \t$this->options['category'] = array('name'=>'category','value'=>$names);\n \t$this->options['category_id'] = array('name'=>'category_id','value'=>$cids);\n\t\t}\n }", "public function createCategory();", "public function catalogo(){\n \n $inicio['recomendado'] = $this->carga_recomendado();\n $inicio['categorias'] = $this->carga_menu_categorias();\n $this->Plantilla(\"catalogo\", $inicio);\n \n }", "public function addCathegory($values)\n\t{\n\t\treturn $this->getTable('kategoria')->insert(array(\n\t\t\t'Nazov' => $values->nazov,\n\t\t));\n\t}", "public function category(){\n\n Excel::import(new ComponentsImport,'/imports/categories.csv');\n $cats = array_values(array_unique(Cache::get('category')));\n for($i=0;$i<count($cats);$i++){\n $sub = new Category();\n $sub->name = $cats[$i];\n $sub->save();\n }\n }", "public function getCategory() {}", "public function catalogos() \n\t{\n\t}", "function productByCategory($id)\n {\n \t\n }", "function cwp_register_taxonomy_produtos(){\n\t \n\t $labels = array(\n\t\t\t'name' => _x('Categorias', 'taxonomy general name'),\n\t );\n\t $posts_types = array(\n\t \t\t'produtos',\n\t\t\t'faq'\n\t );\n\n\t register_taxonomy(\n 'category_prod',\n $posts_types,\n array(\n 'labels' => $labels,\n\t\t\t 'singular_name' => __('Categoria'),\n 'rewrite' => array('slug' => 'categoria_produto'),\n 'hierarchical' => true\n )\n );\n}", "function getCategorias(){\r\n $conector = new Conector();\r\n $banco = new BancoCategoria();\r\n return $banco->getCategorias($conector->getConexao());\r\n }", "function sos_chapter_change_cat_object() {\n global $wp_taxonomies;\n $labels = &$wp_taxonomies['product_cat']->labels;\n $labels->name = 'Topic';\n $labels->singular_name = 'Topic';\n $labels->add_new = 'Add Topic';\n $labels->add_new_item = 'Add Topic';\n $labels->edit_item = 'Edit Topic';\n $labels->new_item = 'Topic';\n $labels->view_item = 'View Topic';\n $labels->search_items = 'Search Topics';\n $labels->not_found = 'No Topics found';\n $labels->not_found_in_trash = 'No Topics found in Trash';\n $labels->all_items = 'All Topics';\n $labels->menu_name = 'Topic';\n $labels->name_admin_bar = 'Topic';\n}", "function __construct()\n {\n $this->productGroupsToCategories = Array(\n 1 => 1, // Power kits => Systems\n 2 => 3, // Solar lanterns => Light\n 14 => 1, // SHS 12V => Systems\n 16 => 3, // LED => Light\n 17 => 2, // Fans => Appliances\n 18 => 2, // Fridges => Appliances\n 19 => 2, // Pumps => Appliances\n 24 => 2, // Various appliances => Appliances\n 20 => 2, // Radios => Appliances\n 21 => 2, // TV => Appliances\n 25 => 0, // PAYG (component) => n/a\n 26 => 1, // SHS <12V => Systems\n );\n\n /*\n * Productsubgroups => Options\n */\n $this->productSubGroupsToOptions = Array(\n 14 => 23, // 21Wp - 50Wp =>\n 15 => 23, // 1Wp - 20Wp =>\n 16 => 24, // 51Wp -100Wp =>\n 17 => 36, // Table =>\n 18 => 37, // Ceiling =>\n 19 => 79, // < 1W =>\n 20 => 80, // 1W =>\n 21 => 81, // 2W =>\n 22 => 82, // 3W =>\n 23 => 83, // 4W =>\n 24 => 84, // 5W =>\n 25 => 85, // > 5W =>\n 26 => 44, // up to 20'' =>\n 27 => 45, // > 20'' =>\n //28 => 0, // Cloth dryers =>\n 29 => 58, // Egg incubators =>\n 30 => 59, // Electric fences =>\n 31 => 60, // Hand drills =>\n 32 => 61, // Kettles =>\n 33 => 62, // Sewing machines =>\n //34 => 0, // Spinning wheels =>\n 35 => 63, // Washing machines =>\n 36 => 25, // > 100Wp =>\n 37 => 35, // Stand =>\n 38 => 41, // Surface =>\n 39 => 40, // Submersible =>\n 40 => 46, // Portable =>\n\n 41 => 57, // Iron =>\n 42 => 56, // Hair dryer =>\n 43 => 55, // Mosquito repellent =>\n 44 => 54, // Cooker/Stove =>\n\n 45 => 2, // <12V =>\n 46 => 3, // 12V =>\n 47 => 4, // 24V =>\n 48 => 5, // 48V =>\n\n 49 => 53, // Refrigerators/Freezers =>\n 50 => 50, // Medical Fridges/Freezers =>\n 51 => 51, // Mobile/Portable =>\n 52 => 52, // Refrigerators =>\n 53 => 49, // Freezers =>\n );\n }", "public function saveProductCategories(Product $product, ProductRequest $request): void;", "public function getCategoriaProductos(){\n\t\t$sql = \"SELECT marca.marca, productos.id_producto, productos.nombre, productos.precio, productos.precio_total, productos.url_imagen, presentaciones.presentacion, proveedores.proveedor, marca.marca, tipo_producto.tipo_producto \n\t\tFROM productos \n\t\tINNER JOIN marca ON productos.id_marca = marca.id_marca \n\t\tINNER JOIN presentaciones ON productos.id_presentacion = presentaciones.id_presentacion \n\t\tINNER JOIN proveedores ON productos.id_proveedor = proveedores.id_proveedor \n\t\tINNER JOIN tipo_producto ON productos.id_tipo_producto = tipo_producto.id_tipo_producto \n\t\tWHERE productos.id_marca = ? AND productos.id_estado = 1 AND proveedores.id_estado = 3\";\n\t\t$params = array($this->id_marca);\n\t\treturn Database::getRows($sql, $params);\n\t}", "public function readProductosCategoria(){\n $sql='SELECT nomCategoria, idProducto, producto.foto, nombre, producto.descripcion,precio FROM producto INNER JOIN categoria USING (idCategoria) WHERE idCategoria = ? AND producto.estado=1 AND producto.estadoEliminacion=1';\n $params=array($this->categoria);\n return Database::getRows($sql, $params);\n }", "public function getCategoria()\n {\n return \"Cliente com Risco\";\n }", "public function action_cat()\n {\n $cat = $this->request->param('cat');\n $cat = mysql_real_escape_string ($cat);\n \n // Получаем список продукций\n // $category = ORM::factory('category')->where('cat_id', '=', $cat)->find();\n $category = ORM::factory('category')->where('path', '=', $cat)->find();\n\n if(!$category->loaded()){\n $this->redirect();\n }\n \n $count = $category->products->where('status', '<>', 0)->count_all();\n $pagination = Pagination::factory(array('total_items'=>$count,'items_per_page'=>2));\n $prods = array();\n $products = $category->products\n ->where('status', '<>', 0)\n ->limit($pagination->items_per_page)\n ->offset($pagination->offset)\n ->find_all();\n $prs = $category->products\n ->select('prod_cats.prod_id')\n ->where('status', '<>', 0)\n ->find_all();\n foreach ($prs as $p)\n {\n $prods[] = $p->prod_id;\n }\n if(count($prods))\n $brands = ORM::factory('brand')\n ->join('products')\n ->on('brand.brand_id', '=', 'products.brand_id')\n ->where('products.prod_id','in',$prods)\n ->group_by('brand.title')\n ->order_by('brand.title', 'ASC')\n ->find_all();\n \n \n \n //$products = $category->products->where('status', '!=', 0)->find_all();\n // $this->breadcrumbs[] = array('name' => $category->title, 'link' => '/catalog/cat/c' . $category->cat_id);\n $this->breadcrumbs[] = array('name' => $category->title, 'link' => '/catalog/cat/' . $category->path);\n $this->template->breadcrumbs = Breadcrumb::generate($this->breadcrumbs);\n \n $content = View::factory('/' . $this->theme . 'index/catalog/v_catalog_cat', array(\n 'products' => $products,\n 'cat' => $cat,\n 'pagination' =>$pagination,\n 'brands' =>$brands,\n \n ));\n \n // Выводим в шаблон\n \n $this->template->title = $category->title;\n $this->template->page_title = $category->title;\n $this->template->page_caption = $category->title;\n $this->template->center_block = array($content);\n $this->template->block_right = null; \n $filter = Filter::factory();\n $filter->loadFiltersOptions($category->cat_id);\n $this->template->filter = $filter->render();\n }", "public function addMultipleCategoriesToGroup();", "public function getCategory();", "public function getCategory();", "public function getCategorias(){\n\t\t$sql = \"SELECT * FROM tipo_producto ORDER BY nombre_tipo_prod\";\n\t\t$params = array(null);\n\t\treturn Database::getRows($sql, $params);\n\t}", "private function packCategory()\n {\n /** @var modCategory $category */\n $category = $this->modx->newObject('modCategory');\n $category->set('category', self::PKG_NAME);\n\n $this->packCategoryElements($category, 'plugins');\n\n $this->builder->putVehicle($this->builder->createVehicle($category, [\n xPDOTransport::UNIQUE_KEY => 'category',\n xPDOTransport::PRESERVE_KEYS => false,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::RELATED_OBJECTS => true,\n xPDOTransport::RELATED_OBJECT_ATTRIBUTES => [\n 'Plugins' => [\n xPDOTransport::PRESERVE_KEYS => true,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::UNIQUE_KEY => 'name'\n ],\n 'PluginEvents' => [\n xPDOTransport::PRESERVE_KEYS => true,\n xPDOTransport::UPDATE_OBJECT => true,\n xPDOTransport::UNIQUE_KEY => ['pluginid','event'],\n ]\n ]\n ]));\n }", "public function get_categories() {\n\t\treturn [ 'dtwcbe-woo-single-product' ];\n\t}", "public function addcategoris($request, $productId)\n {\n if($request->category_id){\n foreach ($request->category_id as $categories[]); \n foreach($categories as $categoryid){\n if(!is_numeric($categoryid))\n {\n $catearr=explode(\" - \",$categoryid);\n\n // if(@count($catearr)==3)\n if(count($catearr)==3)\n {\n $firstcate=Category::where('name', $catearr[0])->first();\n if($firstcate)\n {\n $secondcate=Category::where([\n 'parent_id' => $firstcate->id,\n 'name' => $catearr[1]\n ])->first();\n if($secondcate){\n //add category table\n $category = new Category();\n $category->parent_id=$secondcate->id;\n $category->name=$catearr[2];\n $category->order=3;\n $category->slug=Str::of($catearr[2])->slug('-');\n $category->save();\n\n //add product category table\n $productcategory = new ProductCategory();\n $productcategory->product_id=$productId;\n $productcategory->category_id=$category->id;\n $productcategory->save();\n }else\n {\n $c_category = new Category();\n $c_category->parent_id=$firstcate->id; \n $c_category->name=$catearr[1];\n $c_category->order=2;\n $c_category->slug=Str::of($catearr[1])->slug('-');\n $c_category->save();\n\n $cc_category = new Category();\n $cc_category->parent_id=$c_category->id; \n $cc_category->name=$catearr[2];\n $cc_category->order=3;\n $cc_category->slug=Str::of($catearr[2])->slug('-');\n $cc_category->save();\n\n $productcategory = new ProductCategory();\n $productcategory->product_id=$productId;\n $productcategory->category_id=$cc_category->id;\n $productcategory->save();\n }\n \n }else{\n $category = new Category(); \n $category->name=$catearr[0];\n $category->order=1;\n $category->slug=Str::of($catearr[0])->slug('-');\n $category->save();\n\n $c_category = new Category();\n $c_category->parent_id=$category->id; \n $c_category->name=$catearr[1];\n $c_category->order=2;\n $c_category->slug=Str::of($catearr[1])->slug('-');\n $c_category->save();\n\n $cc_category = new Category();\n $cc_category->parent_id=$c_category->id; \n $cc_category->name=$catearr[2];\n $cc_category->order=3;\n $cc_category->slug=Str::of($catearr[2])->slug('-');\n $cc_category->save();\n\n $productcategory = new ProductCategory();\n $productcategory->product_id=$productId;\n $productcategory->category_id=$cc_category->id;\n $productcategory->save();\n } \n\n \n }\n }else{\n $productcategory = new ProductCategory();\n $productcategory->product_id=$productId;\n $productcategory->category_id=$categoryid;\n $productcategory->save(); \n } \n }\n }\n }", "public function getProductCategoriesForSKU($request);", "public function getCategories();", "public function getCategories();", "public function findCategories();", "public function getIdCategoriaProducto()\n {\n return $this->id_categoria_producto;\n }", "public function get_categories() {\n return [ 'electro-elements' ];\n }", "public function get_categories()\n {\n return ['general'];\n }", "public function get_categories()\n {\n return ['general'];\n }", "function template_preprocess_excur_service_category(&$vars) {\n $city = menu_get_object('taxonomy_term', 2);\n $vars['city'] = $city->name;\n\n $vocabulary = taxonomy_vocabulary_machine_name_load('category');\n foreach (taxonomy_get_tree($vocabulary->vid, 0, NULL, TRUE) as $key => $term) {\n $vars['categories'][$key]['name'] = $term->name;\n $vars['categories'][$key]['id'] = $term->tid;\n $vars['categories'][$key]['icon'] = theme('image_style', array(\n 'style_name' => '50x50',\n 'path' => $term->field_image[LANGUAGE_NONE][0]['uri'],\n 'alt' => $term->name,\n 'title' => $term->name,\n 'attributes' => array(\n 'class' => array('categoty-icon'),\n ),\n ));\n }\n}", "private function seedProductCategories(): void\n {\n $faker = app(Generator::class);\n $key = config('i18n.language_key');\n $locales = I18n::getAllLocale();\n\n ProductCategory::factory(2)->create()\n ->each(function ($productCategory) use ($faker, $key, $locales) {\n foreach ($locales as $locale) {\n DB::table('product_category_translations')->insert([\n 'product_category_id' => $productCategory->id,\n 'locale' => $locale->{$key},\n 'title' => $faker->sentence(),\n 'description' => $faker->paragraph()\n ]);\n }\n });\n }", "public function ActualizarCategorias()\n\t{\n\n\t\tself::SetNames();\n\t\tif(empty($_POST[\"codcategoria\"]) or empty($_POST[\"nomcategoria\"]))\n\t\t{\n\t\t\techo \"1\";\n\t\t\texit;\n\t\t}\n\t\t$sql = \" select nomcategoria from categorias where codcategoria != ? and nomcategoria = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array($_POST[\"codcategoria\"], $_POST[\"nomcategoria\"]) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num == 0)\n\t\t{\n\t\t\t$sql = \" update categorias set \"\n\t\t\t.\" nomcategoria = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codcategoria = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $nomcategoria);\n\t\t\t$stmt->bindParam(2, $codcategoria);\n\n\t\t\t$codcategoria = strip_tags(strtoupper($_POST[\"codcategoria\"]));\n\t\t\t$nomcategoria = strip_tags(strtoupper($_POST[\"nomcategoria\"]));\n\t\t\t$stmt->execute();\n\n\t\t\techo \"<div class='alert alert-info'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<span class='fa fa-check-square-o'></span> LA CATEGORIA DE PRODUCTO FUE ACTUALIZADA EXITOSAMENTE\";\n\t\t\techo \"</div>\";\t\t\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\techo \"2\";\n\t\t\texit;\n\t\t}\n\t}", "function set_categorie($categorie){\n if($categorie == \"vin\" || $categorie == \"eau\" || $categorie == \"jus\"){\n $this->categorie = $categorie;\n }else{\n $this->erreur(\"La categorie doit être : vin, eau ou jus. Or c'est : \".$categorie.\"<br>\");\n }\n }", "function category($title, $id, $page)\n {\n $sort = Input::get('sort');\n\n $aliexpressApi = new AliexpressAPI();\n\n $options = [\n \"sort\" => $sort,\n \"pageNo\" => $page\n ];\n if (Cache::get('aliCategory' . $id . '-' . $page . '-' . $sort) == null) {\n Cache::put('aliCategory' . $id . '-' . $page . '-' . $sort, json_decode($aliexpressApi->getCategoryProducts($id,\n 39, \"USD\", App::getLocale(), $options)), Config::get('cache.storeAliHotProducts'));\n }\n $aliData = Cache::get('aliCategory' . $id . '-' . $page . '-' . $sort);\n\n $similarCategories = $this->model->getSimilarCategory($id);\n $breadCramb = $this->model->getBreadCramb($id);\n $resultsAmount = isset($aliData->result->totalResults) ? $aliData->result->totalResults : 100;\n\n // pagination ( not the perfect of implementations, but it works )\n $totalPages = 100;\n $pagesAvailable = Util::getPaginationList($page, $totalPages);\n\n $categoryData = $this->makeCategoryData($page, $id, $title, $sort, $resultsAmount);\n\n // product forms action route base\n $productBaseRoute = \"/{$this->siteslug}/product\";\n $categoryBaseRoute = \"/{$this->siteslug}/category/$title/$id\";\n\n $paginationResult = Util::getLinksForPagination($pagesAvailable, \"category\", $title, $page, $this->siteslug, null, $id);\n\n $pages = $paginationResult['pages'];\n $pageNext = $paginationResult['pageNext'];\n\n if ($page == 1) {\n $pageForTitle = '';\n } else {\n $pageForTitle = ' ' . 'עמוד' . ' ' . $page;\n }\n /*if (is_null($categoryData['sort'])){\n $sortForTitle='';\n }else{\n $sortForTitle='-' . $categoryData['sort'];\n }*/\n // dd($categoryData);\n if (Lang::getLocale() == 'he') {\n $this->shopName = Lang::get('general.aliexpress');\n } elseif (Lang::getLocale() == 'en') {\n $this->shopName = 'aliexpress';\n };\n $this->title =$categoryData['title']. ' - ' . $breadCramb['category']. ' - ' . $this->shopName . ' - ' . $categoryData['page'] . ' - ' .'עליאקספרס' ;\n// $this->title = $categoryData['title'];\n $this->description = $categoryData['title'] . $pageForTitle . '- ' . \"עליאקספרס בעברית\" . ' - ' . \"שירות לקוחות בעברית,תשלום ללא כ.א בינלאומי,למעלה ממיליארד מוצרים בעברית\";\n return view(\"aliexpress.category\", [\n 'timerTime' => $this->timerTime,\n 'nextPageLink' => $pageNext,\n 'pageLinks' => $pages,\n 'pagination' => $pagesAvailable,\n 'categoryData' => $categoryData,\n 'productBase' => $productBaseRoute,\n 'categoryBase' => $categoryBaseRoute,\n 'aliData' => $this->model->parseCategoryData($aliData),\n 'categories' => $this->categories,\n 'siteslug' => $this->siteslug,\n 'breadCramb' => $breadCramb,\n 'title' => $this->title,\n 'description' => $this->description,\n 'page' => $page,\n 'similarCategories' => $similarCategories,\n ]);\n }", "protected function setupCategories()\n {\n static $done;\n\n if (!empty($done)) {\n return;\n }\n\n $c = new Categories();\n $c->setContext('G_Access');\n $c->setIsActive(true);\n $c->save();\n\n $ci = new CategoriesI18n();\n $ci->setId($c->getId());\n $ci->setTitle('Girl Accessories');\n $ci->setLocale('da_DK');\n $ci->setContent('test 1.2.3');\n $ci->save();\n\n $c = new Categories();\n $c->setContext('LG_Access');\n $c->setIsActive(true);\n $c->save();\n\n $ci = new CategoriesI18n();\n $ci->setId($c->getId());\n $ci->setTitle('Little Girl Accessories');\n $ci->setLocale('da_DK');\n $ci->setContent('test 1.2.3');\n $ci->save();\n\n $done = true;\n }", "public function create()\n {\n $categoris = Category::get()->toArray();\n // dd($categoris);\n return view('site.admin.products.create',compact('categoris'));\n }", "public function getCategoria()\n {\n return $this->categoria;\n }", "public function create()\n {\n //Ürün kategorilerinin eklenmesi\n function getCategoryTree($parent_id=null, $spacing = '', $tree_array = array()) {\n $categories = Productcategories::select('id', 'title', 'parent_id')->where('parent_id' ,'=', $parent_id)->where('status','1')->orderBy('parent_id')->get();\n foreach ($categories as $item){\n $tree_array[] = ['categoryId' => $item->id, 'categoryName' =>$spacing . $item->title] ;\n $tree_array = getCategoryTree($item->id, $spacing . '--', $tree_array);\n }\n return $tree_array;\n }\n //seçili kategorileri bulma\n //$c = Productcategories::all()->where('status','1')->get();\n\n //kategorileri döndürme\n $cats = \"\";\n foreach (getCategoryTree(null,'') as $k){\n $cats .= '<option value=\"'.$k['categoryId'].'\">'.$k['categoryName'].'</option>';\n }\n\n return view('backend.products.create')->with('cats',$cats);\n }", "public function getCategory()\n {\n }", "function afficherCategories2(){\n\t\t$sql=\"SElECT nom From categorie\";\n\t\t$db = config::getConnexion();\n\t\ttry{\n\t\t$liste=$db->query($sql);\n\t\treturn $liste;\n\t\t}\n catch (Exception $e){\n die('Erreur: '.$e->getMessage());\n }\t\n\t}", "public function getCategoria()\n {\n return $this->categoria;\n }", "public function getCategoria()\n {\n return $this->categoria;\n }", "function listar_producto_categoria($lim){\n\t\t$sql=\"SELECT * FROM producto, imagen WHERE galeria_image=id_pro AND tabla_image='producto' AND categoria_pro='4' GROUP BY id_pro DESC ORDER BY categoria_pro DESC, prioridad_pro ASC LIMIT 0 , $lim\";\n\t\t\n\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\twhile ($resultado = mysql_fetch_array($consulta)){\n\t\t\t$this->mensaje=\"si\";\n\t\t\t$resultado['fecha_pro']=$this->convertir_fecha($resultado['fecha_pro']);\n\t\t\t$this->listado[] = $resultado;\n\t\t}\n\t}", "public function testGetProductCategories() {\n \n }", "protected function fijarTabla(){\n \n return \"categorias\";\n \n }", "function acf_wc_product_type_rule_type($choices) {\n // this will be a place to put all custom rules assocaited with woocommerce\n // the reason for checking to see if it exists or not first\n // is just in case another custom rule is added\n if (!isset($choices['Product'])) {\n $choices['Product'] = array();\n }\n // now add the 'Category' rule to it\n if (!isset($choices['Product']['product_cat'])) {\n // product_cat is the taxonomy name for woocommerce products\n $choices['Product']['product_cat_term'] = 'Product Category Term';\n }\n return $choices;\n }", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "public function get_categories() {\n\t\treturn [ 'kodeforest' ];\n\t}", "public function get_categories() {\n return [ 'Alita-elements' ];\n }", "public function get_categories() {\n return [ 'Alita-elements' ];\n }", "public function RegistrarCategorias()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"nomcategoria\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\t$sql = \" select nomcategoria from categorias where nomcategoria = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_POST[\"nomcategoria\"]) );\n\t$num = $stmt->rowCount();\n\tif($num == 0)\n\t{\n\t\t$query = \" insert into categorias values (null, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $nomcategoria);\n\n\t\t$nomcategoria = strip_tags(strtoupper($_POST[\"nomcategoria\"]));\n\t\t$stmt->execute();\n\n\n\t\techo \"<div class='alert alert-success'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> LA CATEGORIA DE PRODUCTO FUE REGISTRADA EXITOSAMENTE\";\n\t\techo \"</div>\";\t\t\n\t\texit;\n\t}\n\telse\n\t{\n\t\techo \"2\";\n\t\texit;\n\t}\n}", "public static function lista_categorias($conexion) {\n //utilizado en el select tipo en registrar activo\n $lista_categorias = array();\n\n if (isset($conexion)) {\n try {\n $sql = \"select * from categoria\";\n $sentencia = $conexion->prepare($sql);\n $sentencia->execute();\n $resultado = $sentencia->fetchAll();\n\n if (count($resultado)) {\n foreach ($resultado as $fila) {\n $categoria = new Categoria();\n $categoria->setCodigo_tipo($fila['codigo_tipo']);\n $categoria->setNombre($fila['nombre']);\n\n $lista_categorias[] = $categoria;\n }\n }\n } catch (PDOException $exc) {\n print('ERROR' . $exc->getMessage());\n }\n }\n\n return $lista_categorias;//eviamos la lista de tipos\n }", "function ObtenerCategorias(){\n\n\t\tinclude_once(\"../Entidades/Categorias.php\");\n\t\t$OBJCategorias = new Categorias;\n\t\t$categorias\t= $OBJCategorias -> ObtenerCategoriasconSeccion();\n\n\t\t$privilegios = $_SESSION['privilegios'];\n\n\t\tinclude_once(\"../ModuloAdministrador/vistas/FormularioCategorias.php\");\n\t\t$OBJFormCategorias = new FormularioCategorias;\n\t\t$OBJFormCategorias -> MostrarFormularioCategorias($categorias,$privilegios);\n\n\n\t}", "public function get_categories()\n {\n return ['careerfy'];\n }", "public function get_categories()\n {\n return ['careerfy'];\n }", "public function products()\n {\n return $this->morphedByMany(Product::class, 'categorables');\n }", "function dbAddCategoriesProduct( $iCategory, $iProduct, $bErase = true ){\n global $oFF;\n if( isset( $bErase ) )\n $oFF->deleteInFile( DB_PRODUCTS_CATEGORIES, $iProduct, 1 );\n $oFF->setRow( Array( $iCategory, $iProduct ) );\n $oFF->addToFile( DB_PRODUCTS_CATEGORIES );\n }", "public function getCategoria()\n {\n return \"Cliente com alta credibilidade\";\n }", "public function create()\n {\n return view('productos::admin.categoriaproductos.create');\n }", "public function traitementCategorie() {\n\n $this->data .= '<div class=\"boutique-droite\">';\n if(isset($_GET['categorie']))\n {\n $donnees = Database::query(\"SELECT id_produit,reference,titre,photo,prix FROM produit WHERE categorie=?\", array($_GET['categorie']));\n foreach($donnees as $key2 =>$produit)\n {\n $this->data .= '<div class=\"boutique-produit\">';\n $this->data .= \"<h3>$produit[titre]</h3>\";\n $this->data .= \"<a href=\\\"fiche_produit.php?id_produit=$produit[id_produit]\\\"><img src=\\\"$produit[photo]\\\" width=\\\"130\\\" height=\\\"100\\\" /></a>\";\n $this->data .= \"<p>$produit[prix] €</p>\";\n $this->data .= '<a href=\"fiche_produit.php?id_produit=' . $produit['id_produit'] . '\">Voir la fiche</a>';\n $this->data .= '</div>';\n }\n }\n $this->data .= '</div></div>';\n }", "public function categories(Request $request)\n {\n $idsCategories = [];\n if (isset($request['categories'])) {\n foreach ($request['categories'] as $idCategory) {\n if ((int) $idCategory != 0) {\n $idsCategories[] = (int) $idCategory;\n }\n }\n }\n $marketId = '0';\n if (isset($request['marketid'])) {\n $marketId = $request['marketid'];\n }\n $promo = '0';\n if (isset($request['promo'])) {\n $promo = $request['promo'];\n }\n try {\n if (count($idsCategories) != 0) {\n $request['categories'] = ['0'];\n }\n $this->productRepository->pushCriteria(new RequestCriteria($request));\n $this->productRepository->pushCriteria(new LimitOffsetCriteria($request));\n $this->productRepository->pushCriteria(new ProductsOfFieldsCriteria($request));\n $this->productRepository->pushCriteria(new ProductsOfCategoriesCriteria($request));\n\n $products = $this->productRepository->all();\n } catch (RepositoryException $e) {\n return $this->sendError($e->getMessage());\n }\n\n // return $this->sendResponse($products->toArray(), 'Products retrieved successfully');\n $productsFinal = [];\n\n $productsArray = $products->toArray();\n if (!isset($request['no_filter'])) {\n if ($promo) {\n return $this->sendResponse($productsArray, 'Promos enviados');\n } else {\n\n if (count($idsCategories) > 0) {\n $idMarket = $marketId;\n $valueActiveCategory = DB::table('categoriesproducts')->where('market_id', '=', $idMarket)->whereIn('category_id', $idsCategories)->pluck('active', 'category_id');\n $idsProducts = DB::table('products')->where('market_id', '=', $idMarket)->get(['featured', 'id'])->toArray();\n $algo = [];\n foreach ($idsProducts as $idP) {\n if ($idP->featured) {\n $algo[] = $idP->id;\n }\n }\n $datosProductosRaw = DB::table('product_categories')->whereIn('category_id', $idsCategories)->whereIn('product_id', $algo)->where('active', '1')->get();\n $idsProducts = [];\n foreach ($datosProductosRaw as $idPR) {\n if ($idPR->active) {\n $idsProducts[] = $idPR->product_id;\n }\n }\n $productsFilter = $this->productRepository->whereIn('id', $idsProducts)->get();\n $productsFinal = $productsFilter;\n } else if (count($productsArray) != 0) {\n\n $idMarket = $productsArray[0]['market_id'];\n $valueActiveCategory = DB::table('categoriesproducts')->where('market_id', '=', $idMarket)->pluck('active', 'category_id');\n $idsCategory = [];\n foreach ($valueActiveCategory as $categoryID => $id) {\n $idsCategory[] = $categoryID;\n }\n $productsTmp = [];\n foreach ($productsArray as $product) {\n $valueActiveProduct = DB::table('product_categories')->whereIn('category_id', $idsCategory)->where('product_id', '=', $product['id'])->pluck('active');\n foreach ($valueActiveProduct as $value) {\n if ($value) {\n $productsTmp[] = $product;\n }\n }\n }\n\n $productsFinal = $productsTmp;\n }\n }\n } else {\n $productsFinal = $productsArray;\n }\n\n return $this->sendResponse($productsFinal, 'Productos filtrados enviados');\n }", "public function categories()\n {\n return $this->belongsToMany(Category::class, 'category_product');\n }", "public function get_categoria() {\n $conectar=parent::conexion();\n parent::set_names();\n $sql=\"SELECT * FROM tm_categoria WHERE est=1\";\n $sql=$conectar->prepare($sql);\n $sql->execute();\n // IMPORTANTE AGREGARLE EL PDO::FETCH_ASSOC PARA QUE HAGA BIEN LA CONSULTA\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\n\n }", "function Register_Product(){\n\t\tregister_taxonomy('location_cat', 'product' , array(\n\t\t\t'hierarchical'\t\t\t=> true,\n\t\t\t'query_var'\t\t\t\t\t=> true,\n\t\t\t'rewrite'\t\t\t\t\t\t=> array( 'slug' => 'location' ), \n\t\t\t'label'\t\t\t\t\t\t\t=> __( 'Locations', 'sharehouse' ),\n\t\t\t'singular_name'\t\t\t=> __( 'Location ', 'sharehouse' ),\n\t\t\t'menu_name'\t\t\t\t\t=> __( 'Locations', 'sharehouse' ), \n\t\t)); \n\t}", "public function getCategory() {\n $productModel = new productModel();\n $categories = $productModel->getCategoryList();\n $this->JsonCall($categories);\n }", "public function getProductCategoriesForASIN($request);", "public static function getActiveCategories(){}", "function getProductCategories () {\r\n $sql = \"SELECT * FROM stockgroups\";\r\n return runQuery($sql);\r\n}", "public function testCategoryMap()\n {\n $this->assertEquals(Record::mapCategory('Labor'), 'labor');\n $this->assertEquals(Record::mapCategory('工具器具備品'), 'tools_equipment');\n $this->assertEquals(Record::mapCategory('広告宣伝費'), 'promotion');\n $this->assertEquals(Record::mapCategory('販売キャンペーン'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO'), 'promotion');\n $this->assertEquals(Record::mapCategory('SEO', true), 'seo');\n $this->assertEquals(Record::mapCategory('地代家賃'), 'rent');\n $this->assertEquals(Record::mapCategory('packing & delivery expenses'), 'delivery');\n $this->assertEquals(Record::mapCategory('Revenue'), 'revenue');\n $this->assertEquals(Record::mapCategory('収益'), 'revenue');\n $this->assertEquals(Record::mapCategory('水道光熱費'), 'utility');\n $this->assertEquals(Record::mapCategory('法定福利費'), 'labor');\n $this->assertEquals(Record::mapCategory('法定福利費', true), 'welfare');\n }", "public function store(CategoriesRequest $request)\n {\n $categorie_product = new Categorie;\n $categorie_product->name = input::get('name');\n $categorie_product->description = input::get('description');\n if (input::get('warranty') == \"on\") {\n $categorie_product->warranty = 1;\n }\n $categorie_product->type = 0;\n $categorie_product->save();\n Session::flash('message', 'Categoria insertada correctamente');\n return Redirect::to('categorie_product');\n }", "function _addCategory()\n\t{\n\t\t// Create categories for our component\n\t\t$basePath = JPATH_ADMINISTRATOR.'/components/com_categories';\n\t\trequire_once $basePath.'/models/category.php';\n\t\t$config\t\t= array('table_path' => $basePath.'/tables');\n\t\t$catmodel\t= new CategoriesModelCategory($config);\n\t\t$catData\t= array('id' => 0, 'parent_id' => 0, 'level' => 1, 'path' => 'uncategorized', 'extension' => 'com_sermonspeaker',\n\t\t\t\t\t\t'title' => 'Uncategorized', 'alias' => 'uncategorized', 'description' => '', 'published' => 1, 'language' => '*');\n\t\t$catmodel->save($catData);\n\t\t$id = $catmodel->getItem()->id;\n\n\t\t$db = JFactory::getDBO();\n\t\t// Updating the example data with 'Uncategorized'\n\t\t$query\t= $db->getQuery(true);\n\t\t$query->update('#__sermon_sermons');\n\t\t$query->set('catid = '.(int)$id);\n\t\t$query->where('catid = 0');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Speakers\n\t\t$query->update('#__sermon_speakers');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\t\t// Series\n\t\t$query->update('#__sermon_series');\n\t\t$db->setQuery($query);\n\t\t$db->execute();\n\n\t\treturn;\n\t}", "public function setCategory() {\n /**\n *\n * @todo make a separate config file for the default category ?!\n */\n $defaultCategory = 1;\n $category = Category::find()->all();\n $newCat = $this->strProcessing($this->category);\n $k = NULL;\n if (!empty($newCat)) {\n foreach ($category as $value) {\n $cat = explode(',', $value['synonyms']);\n $cat = array_map(array($this, 'strProcessing'), $cat);\n $k = array_search($newCat, $cat);\n if ($k !== NULL && $k !== FALSE) {\n $k = $value['id'];\n break;\n }\n }\n }\n if ($k) {\n $this->category = $k;\n } else {\n $this->category = $defaultCategory;\n }\n return TRUE;\n }", "public function actionCategories()\n {\n // $model ->select('category')\n // ->from('product')\n // ->distinct()\n // ->all();\n \n // if ($model) {\n // foreach ($model as $row) {\n // print_r($row['category']);\n // }\n // }\n $query = product::find()->select('category')->distinct();\n foreach($query as $row)\n {\n print_r($row->category);\n }\n \n exit();\n Yii::$app->response->format = \\yii\\web\\Response::FORMAT_JSON;\n return $model;\n\n }", "public function ListarCategorias()\n{\n\tself::SetNames();\n\t$sql = \" select * from categorias\";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\treturn $this->p;\n\t$this->dbh=null;\n}", "function createCategories()\n {\n $currentCategories = $this->loadCategories();\n\n foreach ($this->categories as $category)\n {\n // Skip adding category if it already exists\n if (in_array($category, $currentCategories))\n {\n continue;\n }\n\n // Create a copy of the template array for category properties\n $data = array_merge($this->categoryTemplate);\n\n // Set the category description from the translation key in en-GB.com_cajobboard.sys.ini\n // remove any spaces from the category title when building the translation key\n $data['title'] = Text::_('COM_CAJOBBOARD_CATEGORY_TITLE_' . strtoupper(str_replace(' ', '', $category)));\n\n $data['description'] = $data['title'];\n\n // Initialize a new category\n $category = Table::getInstance('Category');\n\n // Bind passed category parameters to Category model\n $category->bind($data);\n\n // setLocation(integer $referenceId, string $position = 'after')\n $category->setLocation($category->getRootId(), 'last-child');\n\n // Check to make sure our data is valid. check() will auto generate alias if not set above.\n if (!$category->check())\n {\n throw new \\Exception($category->getError(), 500);\n\n return false;\n }\n\n // Store the category\n if (!$category->store(true))\n {\n throw new \\Exception($category->getError(), 500);\n\n return false;\n }\n\n // Build the path for our category and set it in the database\n $category->rebuildPath($category->id);\n }\n\n Table::getInstance('Category')->rebuild();\n }", "function sensible_category() {\n wp_update_term(1, 'category', array(\n 'name' => 'News',\n 'slug' => 'news', \n 'description' => 'News'\n ));\n }", "public function getCategoria()\n {\n return \"Cliente padrão\";\n }", "public function store(Request $request)\n {\n $this->validate($request, ProductCategory::rulesAdd(), [], ProductCategory::attributeNames());\n $category= new ProductCategory();\n $category->parent_id = $request->parentId;\n $category->name = $request->name;\n $category->slug = Str::slug($request->slug, '_');\n $category->user_id = $request->user_id;\n $category->source = $request->source;\n $category->save();\n return redirect()->route('admin.product-categories.index')->with('success','Категория успешно добавлена');\n }", "function getCodigoCategoria()\n {\n return $this->CodigoCategoria;\n }", "public function create()\n {\n $product = Product::get();\n $category = Category::get();\n $categories = array();\n foreach($category as $mycategory)\n $categories[$mycategory->id] = $mycategory->type;\n \n \n return view('product.product-create',compact('categories','product'));\n \n\n }", "public function category()\n {\n return $this->belongsToMany('App\\Models\\V1\\Category', 'product_to_category', 'product_id', 'category_id')->withPivot('selected');\n }", "public function listattr_cat()\n {\n $this->db->where('descripcion_atributo', 'Catalogo');\n $resultados = $this->db->get('atributos_b');\n\n return $resultados->result();\n }", "function crunchify_create_deals_custom_taxonomy2() {\r\n \r\n $labels = array(\r\n 'name' => _x( 'Marca produto', 'marca_produtos' ),\r\n 'singular_name' => _x( 'Marca produto', 'marca_produtos' ),\r\n 'search_items' => __( 'Pesquisar marca produto' ),\r\n 'all_items' => __( 'Todas as marcas' ),\r\n 'parent_item' => __( 'Marca produto pai' ),\r\n 'parent_item_colon' => __( 'Marca produto pai:' ),\r\n 'edit_item' => __( 'Editar Marca produto' ), \r\n 'update_item' => __( 'Atualizar marca produto' ),\r\n 'add_new_item' => __( 'Adicionar marca produto' ),\r\n 'new_item_name' => __( 'Nova marca produto' ),\r\n 'menu_name' => __( 'Marca produto' ),\r\n ); \r\n \r\n register_taxonomy('marca_produtos',array('product'), array(\r\n 'hierarchical' => true,\r\n 'labels' => $labels,\r\n 'show_ui' => true,\r\n 'show_admin_column' => true,\r\n 'query_var' => true,\r\n 'rewrite' => array( 'slug' => 'marca_produtos' ),\r\n ));\r\n}", "public function getCategories()\n {\n return [ 'categories' => self::CATEGORIES ];\n }", "public function definition() {\n return [\n 'name' => 'Categoria Teste',\n ];\n }", "public function run()\n {\n foreach (self::CATEGORIAS as $value) {\n Categoria::create([\n 'nombre' => $value\n ]);\n }\n }", "public function get_categories()\n {\n return ['super-cat'];\n }", "public function categoria()\n {\n return $this->belongsTo(Categoria::class);\n }", "public function _construct(Categoria $categoria){\n\n\t\t$this->categoria = $categoria;\n\t}", "public function actionCreate()\n { $this->layout='inner';\n $model = new Product();\n $cat_list = ArrayHelper::map(ProductCategory::find()->where(['parent_id'=>'0'])->all(), 'id', 'cat_name');\n $vendor = ArrayHelper::map(User::find()->where(['usertype'=>'Vendor'])->all(), 'id', 'username');\n if ($model->load(Yii::$app->request->post())) {\n //$last_cat=end($_POST['Product']['category_id']);\n if($model->save()){\n /*$product_cat= new ProductCat();\n $product_cat->product_id=$model->id;\n $product_cat->category_id=$last_cat;\n $product_cat->save();*/\n \n //Yii::$app->getSession()->setFlash('success','successful added your product');\n return $this->redirect(['add-search-terms','id'=>$model->id]);\n }\n \n } else {\n return $this->render('create', [\n 'model' => $model,\n 'cat_list'=>$cat_list,\n 'vendor'=>$vendor,\n ]);\n }\n }", "public function get_categories() {\n\t\treturn array( 'listeo' );\n\t}", "public function getCategories()\n {\n return $this->hasMany(Category::class, ['id' => 'category_id'])\n ->viaTable('product_category', ['product_id' => 'id']);\n }", "public function categoryProduct(){\n return $this->hasMany(CategoryProduct::class);\n }" ]
[ "0.6765145", "0.6679081", "0.6612438", "0.66014546", "0.6525684", "0.65032905", "0.64860284", "0.63944983", "0.63046205", "0.62934786", "0.6279438", "0.6256861", "0.6247077", "0.62182015", "0.62060547", "0.6166894", "0.6144911", "0.61318815", "0.612425", "0.6116791", "0.6113935", "0.6112024", "0.61117536", "0.6110868", "0.6110868", "0.61029387", "0.6098387", "0.60962784", "0.6040202", "0.6026781", "0.60181177", "0.60181177", "0.59979784", "0.5977747", "0.59775263", "0.5977316", "0.5977316", "0.59765804", "0.59569615", "0.59474134", "0.59440386", "0.5937344", "0.59097797", "0.59071857", "0.5905913", "0.59052116", "0.58907235", "0.58907205", "0.58887887", "0.58887887", "0.58794725", "0.5877642", "0.5877032", "0.58760524", "0.58727515", "0.58727515", "0.5863072", "0.5863072", "0.5862855", "0.58569044", "0.58550787", "0.58497727", "0.58497727", "0.5847972", "0.5827962", "0.5818731", "0.58158326", "0.5806557", "0.58052224", "0.579906", "0.57989687", "0.57929504", "0.5791734", "0.5791399", "0.57864445", "0.5780935", "0.57765615", "0.57742226", "0.5771501", "0.57701457", "0.5766433", "0.5764542", "0.5763403", "0.57631695", "0.57611376", "0.5761019", "0.5755458", "0.5755031", "0.57464415", "0.5744593", "0.57421", "0.5741549", "0.57410985", "0.57287335", "0.5724527", "0.57221097", "0.57205254", "0.5712815", "0.5704746", "0.5697508", "0.5686233" ]
0.0
-1
/ FILTRO CON AJAX
function ajarFilterProducts() { $args = array( 'post_type' => 'producto', 'posts_per_page' => -1, /* REcibir todos los productos */ 'order' => 'ASC', 'orderby' => 'title', ); if ($_POST['categoria']) { $args['tax_query'] = array( array( 'taxonomy' => 'categoria-productos', 'field' => 'slug', 'terms' => $_POST['categoria'] ) ); } $products = new WP_Query($args); $return = array(); if ($products->have_posts()) { while ($products->have_posts()) { $products->the_post(); $return[] = array( 'imagen' => get_the_post_thumbnail(get_the_id(), 'large'), 'link' => get_the_permalink(), 'titulo' => get_the_title(), ); } } wp_send_json($return); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function ajaxGuion() {\n\t\t\tif($this->peticion->ajax() == true):\n\t\t\t\t$this->existenciaDatos();\n\t\t\telse:\n\t\t\t\texit('Guión no fue creado por Error en petición Ajax');\n\t\t\tendif;\n\t\t}", "function ajax()\n {\n $json = \"\";\n $registros = $this->model->getRegistros();\n \n if($registros){\n $url_modificar = \"'\".base_url().\"index.php/\".$this->_subject.\"/abm/\";\n $btn_class = \"'btn btn-default'\";\n $icon_class = \"'fa fa-pencil-square-o'\";\n foreach ($registros as $row) {\n $url_final = $row->id_log.\"'\";\n \n $buttons = '<a class='.$btn_class.' href='.$url_modificar.$url_final.'><i class='.$icon_class.'></i></a> ';\n \n $registro = array(\n $row->date_add,\n $row->accion,\n $row->user_add,\n $row->programa,\n $buttons,\n );\n \n $json .= setJsonContent($registro);\n }\n } \n \n $json = substr($json, 0, -2);\n \n echo '{ \"data\": ['.$json.' ] }';\n }", "public function AJAX() {\n if (isset($_POST['fungsi'])) {\n if ($_POST['fungsi'] == 'encode') {\n echo $this->M_Divisi->AJAXencode($_POST['idDivisi']);\n } if ($_POST['fungsi'] == 'formatDateTime') {\n echo $this->M_Divisi->AJAX_formatDateTime($_POST);\n }\n } else if (!isset($_POST['fungsi'])) {\n echo $this->M_Divisi->getDivisi();\n }\n }", "public function ajax_response()\n {\n }", "public function handleAjaxRequest();", "public function ajaxTraerPrestamo(){\n\n\t\t$item = \"idPrestamo\";\n\t\t$valor = $this->idPrestamo;\n\n\t\t$respuesta = ControladorArticulos::ctrBuscarPrestamo($item, $valor);\n\n\t\techo json_encode($respuesta);\n\n\t}", "public function ajaxVisuaDocente(){\n $item =\"id\";\n $valor = $this->idDocente;\n $respuesta = ControladorDocentes::ctrMostrarDocentes($item,$valor);\n echo json_encode($respuesta);\n\n}", "public function ejecutaAjax() {\n \n $ajaxController = new \\controllers\\ajaxController();\n $respuestaAjax = $ajaxController->addProducto($this->codigo, $this->producto, $this->cantidad, $this->valor);\n echo $respuestaAjax;\n }", "public function ajaxMostrarPerfil(){\n\t\t$item = \"cod_perfil\";\n\t\t$valor = $_POST[\"codPerfil\"];\n\t\t$respuesta = ControladorPerfil::ctrMostrarPerfil($item, $valor);\n\t\techo json_encode($respuesta);\n\t}", "public function ajaxTraerEspecialidad(){\n\n\t\t$item = \"idEspecialidad\";\n\t\t$valor = $this->idEspecialidad;\n\t\t$respuesta = ControladorAdmision::ctrMostrarEspecialidad($item, $valor);\n\n\t\techo json_encode($respuesta);\n\n\t}", "public function ajaxCodsPrestamo(){\n\n\t\t$item = \"idPrestamo\";\n\t\t$valor = $this->idPrestamo;\n\n\t\t$respuesta = ControladorArticulos::ctrMostrarArticulosCodPrestados($item, $valor);\n\t\techo json_encode($respuesta);\n\n\t}", "public function ajaxGuardarCampoFicha()\t{\n\n\t\t$id_ficha = $this->id_ficha;\n\t\t$item = $this->item;\n\t\t$valor = mb_strtoupper($this->valor,'utf-8');\n\t\t$tabla = $this->tabla; \t\n\n\t\t$respuesta = ControladorFichas::ctrGuardarCampoFichaEpidemiologica($id_ficha, $item, $valor, $tabla);\n\n\t\techo $respuesta;\n\n\t}", "public function AjaxMovil() {\n\t\t\tif(AppValidar::PeticionAjax() == true):\n\t\t\t\t$plantilla = new NeuralPlantillasTwig(APP);\n\t\t\t\t$plantilla->Parametro('avisos', $this->Modelo->avisos());\n\t\t\t\techo $plantilla->MostrarPlantilla(implode(DIRECTORY_SEPARATOR, array('Dispositivos', 'AjaxMovil.html')));\n\t\t\telse:\n\t\t\t\techo 'No es posible cargar la información';\n\t\t\tendif;\n\t\t}", "public function ajaxEditarPerfil(){\n\t\t$respuesta = ControladorPerfil::ctrEditarPerfil();\n\t\techo $respuesta;\n\t}", "public function ajax_function()\n\t{\n\t}", "public function ajaxGetAction()\n {\n $this->view->disable();\n $response = new \\Phalcon\\Http\\Response();\n if (!$this->request->isAjax()) {\n echo \"is not Ajax ! \";\n }\n if (!$this->request->isPost()) {\n echo \"is not Post ! \";\n }\n $tokuisaki_bunrui4 = TokuisakiBunrui4Kbns::find(array(\n 'order' => 'cd',\n 'conditions' => ' cd LIKE ?1 ',\n 'bind' => array(1 => $this->request->getPost('cd').'%')\n ));\n $res_flds = [\"id\",\"cd\",\"name\",];\n $resData = array();\n foreach ($tokuisaki_bunrui4 as $bunrui4) {\n $resAdata = array();\n foreach ($res_flds as $res_fld) {\n $resAdata[$res_fld] = $bunrui4->$res_fld;\n }\n $resData[] = $resAdata;\n }\n $response->setContent(json_encode($resData));\n return $response;\n }", "public function ajaxTraerTExam(){\n\n\t\t$item = \"idExamen\";\n\t\t$valor = $this->idEspecialidad;\n\t\t$respuesta = ModeloAdmision::mdlMostrar(\"examen\",$item, $valor);\n\t\techo json_encode($respuesta);\n\n\t}", "public function ajaxEditarEspecialidad(){\n\n\t\t$datos = array(\n\t\t\t\"idEspecialidad\"=>$this->idEspecialidad,\n\t\t\t\"tituloEspecialidad\"=>$this->tituloEspecialidad\n\t\t);\n\t\t$respuesta = ControladorAdmision::ctrEditarEspecialidad($datos);\n\t\n\t\techo $respuesta;\n\n\t}", "public function ajaxMostrarProductos(){\n\n $item = null;\n $valor = null;\n\n $respuesta = ProductosControlador::ctrMostrarProductos($item, $valor);\n\n echo json_encode($respuesta);\n\n }", "private function ajaxController()\n {\n\n switch ($this->request['action']) {\n case 'add_task':\n $result = $this->addTask($this->request);\n break;\n case 'task_edit_popup':\n $result = $this->getEditTaskPopupData($this->request['task_id']);\n break;\n case 'edit_task':\n $result = $this->editTask($this->request);\n break;\n default:\n return false;\n }\n\n echo json_encode($result);\n exit();\n }", "public function postAmplificador()\n {\n //si la peticion es ajax\n if ( Request::ajax() ) {\n $troba = Input::get('troba');\n $nodo = Input::get('nodo');\n $amp = DigTroba::getAmp($troba , $nodo);\n return Response::json(array('rst'=>1,'datos'=>$amp));\n }\n }", "public function ajax() {\n \n // Get action's get input\n $action = $this->CI->input->get('action');\n\n if ( !$action ) {\n $action = $this->CI->input->post('action');\n }\n \n try {\n\n // Call method if exists\n (new MidrubBaseAdminCollectionFrontendControllers\\Ajax)->$action();\n\n } catch (Exception $ex) {\n\n $data = array(\n 'success' => FALSE,\n 'message' => $ex->getMessage()\n );\n\n echo json_encode($data);\n\n }\n \n }", "public function ajaxmethod()\n {\n $result = [\n \"csrfTokenName\" => $this->security->get_csrf_token_name(),\n \"csrfHash\" => $this->security->get_csrf_hash(),\n ];\n $this->output->set_content_type('application/json')->set_output(json_encode($result));\n }", "public function get_resultado_final(){\n if($this->input->is_ajax_request() && $this->input->post()){\n $post = $this->input->post();\n $rf_id = $this->security->xss_clean($post['rf_id']);\n\n $dato_rfinal = $this->model_mestrategico->get_resultado_final($rf_id);\n \n $result = array(\n 'resultado' => $dato_rfinal\n );\n\n echo json_encode($result);\n }else{\n show_404();\n }\n }", "public function postHorariotipo()\n {\n //si la peticion es ajax\n if ( Request::ajax() ) {\n $horarioTipo = HorarioTipo::get(Input::all());\n return Response::json(array('rst'=>1,'datos'=>$horarioTipo));\n }\n }", "public function mostrar_ajax()\n\t{\n\t\t$sentencia = \"select t1.id_materia, t1.nom_materia,t1.puntaje,t1.descripcion from materia t1\";\n\t\t//var_dump($this->pdo);\n\t\t//exit;\n\t\t$resultado = $this->pdo->prepare($sentencia);\n\t\t$html=\"\";\n\t\t$resultado->execute();\n\t\t/*while ($fila = $resultado->fetch(PDO::FETCH_NUM, PDO::FETCH_ORI_NEXT)) {\n\t\t\t$html.=\"<tr>\";\n\t\t\t$html .= \"<th>\".$fila[0].\"</th>\".\"<th>\".$fila[1].\"</th>\".\"<th>\".$fila[2].\"</th>\".\"<th>\".$fila[3].\"</th>\".\"<th>\".$fila[4].\"</th>\";\n\t\t\t$html .=\"</tr>\";\n\t\t}\n\t\t$this->pdo=null;\n\t\techo $html; exit;*/\n\t\t$num = $resultado->fetchAll();\n\n\t\t$valor = array();\n\t\t$valor = array(\n\t\t\"data\"=> $num\n\t\t); \n\t\theader('Content-type: application/json');\n\t\techo json_encode($valor);\n\t\t//return $datos;\n\t}", "public function postTroba()\n {\n //si la peticion es ajax\n if ( Request::ajax() ) {\n $trobas = DigTroba::getTroba(Input::all());\n return Response::json(array('rst'=>1,'datos'=>$trobas));\n }\n }", "public function consultaColaboradoresPuestosAjax(){\n\t\t//$post_data = $this->input->post(NULL, TRUE);\n\t\t$this->output->set_content_type('application/json');\n\t\t$post_data = json_decode(file_get_contents(\"php://input\"), true);\n \tif($post_data!=null){\n \t\t$result = $this->m_colaborador->consultaPuestos($post_data);\n\t\t\tdie(json_encode($result));\n \t}\n\t}", "abstract public function HighAjax();", "public function ajax_content()\n\t{\n\t\t$return_struct = array(\n\t\t\t'status' => 0,\n\t\t\t'code'\t => 501,\n\t\t\t'msg'\t => 'Not Implemented'\n\t\t);\n\t\tif(request::is_ajax())\n\t\t{\n\t\t\t$id = intval($this->input->get('id')); \n $value = $this->single($id);\n \n\t\t\t$return_template = $this->template = new View('template_blank');\n\t\t\t$this->template->content = $value;\n\t\t\t$return_str = $return_template->render();\n\t\t\t$return_struct['status'] = 1;\n\t\t\t$return_struct['code'] = 200;\n\t\t\t$return_struct['msg'] = 'Success';\n\t\t\t$return_struct['content'] = $return_str;\n\t\t\texit(json_encode($return_struct));\n\t\t}\n\t}", "public function postCable()\n {\n //si la peticion es ajax\n if ( Request::ajax() ) {\n $mdf = Input::get('mdf');\n $cables = DigTroba::getCable($mdf);\n return Response::json(array('rst'=>1,'datos'=>$cables));\n }\n }", "public function ajax(){\n\t\t//$where = \"author_id = 1 AND status = 'active'\";\n\t\t//$str = $this->db->update_string('table_name', $data, $where);\n\t\t//$this->db->get_where()\n\t\t//$this->db->get_where('mytable', array('id' => $id));\n\t\t//$this->db->get_where(\"clinc_meta\", \"meta_name\", \"1\")\n\t\t//count of record $this->db->count_all('clinc_meta')\n\t\t\n\t\techo json_encode(array (\n\t\t\t\"msg\" => \"ahmed\"\n\t\t\n\t\t));\n\t}", "public function postCargar()\n {\n if ( Request::ajax() ) {\n $documentos = DocumentoWord::get(Input::all());\n return Response::json(array('rst'=>1,'datos'=>$documentos));\n }\n }", "abstract public function LowAjax();", "public function obtiene_faseetapa(){\n if($this->input->is_ajax_request() && $this->input->post()){\n $post = $this->input->post();\n $proy_id = $this->security->xss_clean($post['proy_id']);\n $proyecto = $this->model_proyecto->get_id_proyecto($proy_id); /// Datos Proyecto\n $fase = $this->model_faseetapa->get_id_fase($proy_id); //// Datos de la Fase\n \n if(count($proyecto)!=0){\n $result = array(\n 'respuesta' => 'correcto',\n 'proyecto' => $proyecto,\n 'fase' => $fase\n );\n }\n else{\n $result = array(\n 'respuesta' => 'error'\n );\n }\n echo json_encode($result);\n }else{\n show_404();\n }\n }", "public function postArmario()\n {\n //si la peticion es ajax\n if ( Request::ajax() ) {\n $mdf = Input::get('mdf');\n $armarios = DigTroba::getArmario($mdf);\n return Response::json(array('rst'=>1,'datos'=>$armarios));\n }\n }", "public function peticion(){\n\t\t//1' el nombre del nonce que creamos\n\t\t//2' par es el argumento de la consulta recibida desde la peticion de js con ajax\n\t\tcheck_ajax_referer('mp_seg', 'nonce');\n\t\t\n\t\tif( isset($_POST['action'] ) ) {\n\t\t\t\n\t\t\n\t\t\t//procesar informacion\n\t\t\t//guardad DDBB, guardar algunas opciomnes un USER_meta, metadato\n\t\t\t$nombre = $_POST['nombre'];\n\t\t\techo json_encode([\"resultado\" => \"Hemos recibido correctamente el nombre: $nombre\"]);\n\t\t\t\n\t\t\twp_die();//cortar toda comunicacion\n\t\t}\n\t}", "public function ajax_response()\n {\n $this->ajax_data_return['data'] = (object) $this->ajax_data_return['data'];\n echo json_encode($this->ajax_data_return);\n }", "function mostrar_duplicados()\r\n {\r\n \r\n $data['sistema'] = $this->sistema;\r\n if($this->acceso(28)){\r\n //**************** inicio contenido ***************\r\n\t\t \r\n if($this->input->is_ajax_request()){\r\n \r\n $resultado = $this->Inventario_model->mostrar_duplicados_inventario();\r\n echo json_encode($resultado); \r\n \r\n }\r\n else echo false;\r\n\t\t\r\n //**************** fin contenido ***************\r\n\t\t\t}\r\n\r\n }", "public function sendAjax($data){\n header(\"Content-Type:application/json\"); // Cabecera que indica el tipo de datos que recibe.\n echo json_encode($data); // Imprime los datos dentro de objetos JSON.\n }", "public function loadAjax() {\n\t \n\t\t$this->classificationFacade->loadAjax($_GET);\n\t\t\n\t}", "public function AjaxTelevision() {\n\t\t\t$data = $this->Modelo->avisos();\n\t\t\t$pagina = (count($data) >= 1) ? array_chunk($data, 4) : array();\n\t\t\t\n\t\t\t$plantilla = new NeuralPlantillasTwig(APP);\n\t\t\t$plantilla->Parametro('cantidad', count($data));\n\t\t\t$plantilla->Parametro('paginas', count($pagina));\n\t\t\t$plantilla->Parametro('listado', $pagina);\n\t\t\techo $plantilla->MostrarPlantilla(implode(DIRECTORY_SEPARATOR, array('Dispositivos', 'AjaxTelevision.html')));\n\t\t}", "public function postEstados()\n {\n //si la peticion es ajax\n if ( Request::ajax() ) {\n $datos = Estado::getAll();\n return Response::json(array('rst'=>1,'datos'=>$datos));\n }\n }", "function getRegistroAJAX() {\n switch (@$_POST['operacao']) {\n /**\n * Retorna registro solicitado por parametro.\n * @return array\n */\n case 'getRegistroErroLog':\n $retorno = [];\n if (Sessao::getUsuario()->getEntidadeDepartamento()->getAdministrador() === 1 || Sessao::getPermissaoUsuario($this->ID_PERMISSAO)) {\n $erroDAO = new ErroLogDAO();\n $retorno = $erroDAO->getVetor(@$_POST['registroID']);\n }\n print_r(json_encode($retorno));\n die();\n /**\n * Retorna registro solicitado por parametro.\n * @return array\n */\n case 'getRegistroErroApi':\n $retorno = [];\n if (Sessao::getUsuario()->getEntidadeDepartamento()->getAdministrador() === 1 || Sessao::getPermissaoUsuario($this->ID_PERMISSAO)) {\n $apiDAO = new ErroAPIDAO();\n $retorno = $apiDAO->getVetor(@$_POST['registroID']);\n }\n print_r(json_encode($retorno));\n die();\n /**\n * Lista de registro cadastrados com paginação.\n * @var array\n */\n case 'getListaRegistroControleErroLog' :\n $retorno = [];\n $erroDAO = new ErroLogDAO();\n //DAO\n $retorno['totalRegistro'] = 0;\n $retorno['listaRegistro'] = [];\n $retorno['paginaSelecionada'] = @$_POST['paginaSelecionada'] ? $_POST['paginaSelecionada'] : 0;\n $retorno['registroPorPagina'] = @$_POST['registroPorPagina'] ? intval($_POST['registroPorPagina']) : 30;\n if (Sessao::getUsuario()->getEntidadeDepartamento()->getAdministrador() === 1 || Sessao::getPermissaoUsuario($this->ID_PERMISSAO)) {\n $retorno['totalRegistro'] = $erroDAO->getListaControleTotal(\n @$_POST['dataInicial'] ? $_POST['dataInicial'] : date('Y-m-01'),\n @$_POST['dataFinal'] ? $_POST['dataFinal'] : date('Y-m-31'),\n @$_POST['pesquisa'] ? $_POST['pesquisa'] : ''\n );\n $retorno['listaRegistro'] = $erroDAO->getListaControle(\n @$_POST['dataInicial'] ? $_POST['dataInicial'] : date('Y-m-01'),\n @$_POST['dataFinal'] ? $_POST['dataFinal'] : date('Y-m-31'),\n @$_POST['pesquisa'] ? $_POST['pesquisa'] : '',\n @$_POST['paginaSelecionada'] ? $_POST['paginaSelecionada'] : 1,\n @$_POST['registroPorPagina'] ? $_POST['registroPorPagina'] : 30\n );\n }\n print_r(json_encode($retorno));\n die();\n /**\n * Lista de registro cadastrados com paginação.\n * @var array\n */\n case 'getListaRegistroControleErroApi' :\n $retorno = [];\n $erroApiDAO = new ErroAPIDAO();\n //DAO\n $retorno['totalRegistro'] = 0;\n $retorno['listaRegistro'] = [];\n $retorno['paginaSelecionada'] = @$_POST['paginaSelecionada'] ? $_POST['paginaSelecionada'] : 0;\n $retorno['registroPorPagina'] = @$_POST['registroPorPagina'] ? intval($_POST['registroPorPagina']) : 30;\n if (Sessao::getUsuario()->getEntidadeDepartamento()->getAdministrador() === 1 || Sessao::getPermissaoUsuario($this->ID_PERMISSAO)) {\n $retorno['totalRegistro'] = $erroApiDAO->getListaControleTotal(\n @$_POST['dataInicial'] ? $_POST['dataInicial'] : date('Y-m-01'),\n @$_POST['dataFinal'] ? $_POST['dataFinal'] : date('Y-m-31'),\n @$_POST['pesquisa'] ? $_POST['pesquisa'] : ''\n );\n $retorno['listaRegistro'] = $erroApiDAO->getListaControle(\n @$_POST['dataInicial'] ? $_POST['dataInicial'] : date('Y-m-01'),\n @$_POST['dataFinal'] ? $_POST['dataFinal'] : date('Y-m-31'),\n @$_POST['pesquisa'] ? $_POST['pesquisa'] : '',\n @$_POST['paginaSelecionada'] ? $_POST['paginaSelecionada'] : 1,\n @$_POST['registroPorPagina'] ? $_POST['registroPorPagina'] : 30\n );\n }\n print_r(json_encode($retorno));\n die();\n /**\n * Retorna estatistica de registros durante o semestre.\n * @return array\n */\n case 'getQuantidadeSemestral':\n $retorno[0] = [0, 0, 0, 0, 0, 0];\n $retorno[1] = [0, 0, 0, 0, 0, 0];\n if (Sessao::getUsuario()->getEntidadeDepartamento()->getAdministrador() === 1 || Sessao::getPermissaoUsuario($this->ID_PERMISSAO)) {\n $erroDAO = new ErroLogDAO();\n $retorno[0] = $erroDAO->getEstatisticaSemestral();\n $apiDAO = new ErroAPIDAO();\n $retorno[1] = $apiDAO->getEstatisticaSemestral();\n }\n print_r(json_encode($retorno));\n die();\n /**\n * Retorna quantidade de registros cadastrado.\n * @return integer\n */\n case 'getQuantidadeErroLog':\n $retorno = 0;\n if (Sessao::getUsuario()->getEntidadeDepartamento()->getAdministrador() === 1 || Sessao::getPermissaoUsuario($this->ID_PERMISSAO)) {\n $erroDAO = new ErroLogDAO();\n $retorno = $erroDAO->getQuantidadeRegistro(\n @$_POST['dataInicial'] ? $_POST['dataInicial'] : date('d/m/Y'),\n @$_POST['dataFinal'] ? $_POST['dataFinal'] : date('d/m/Y')\n );\n }\n print_r(json_encode($retorno));\n die();\n /**\n * Retorna quantidade de registros cadastrado.\n * @return integer\n */\n case 'getQuantidadeErroApi':\n $retorno = 0;\n if (Sessao::getUsuario()->getEntidadeDepartamento()->getAdministrador() === 1 || Sessao::getPermissaoUsuario($this->ID_PERMISSAO)) {\n $apiDAO = new ErroApiDAO();\n $retorno = $apiDAO->getQuantidadeRegistro(\n @$_POST['dataInicial'] ? $_POST['dataInicial'] : date('d/m/Y'),\n @$_POST['dataFinal'] ? $_POST['dataFinal'] : date('d/m/Y')\n );\n }\n print_r(json_encode($retorno));\n die();\n }\n echo 1;\n }", "public function hapusDataajax()\n {\n $data = $this->model_system->hapusData();\n echo json_encode($data);\n\t }", "public function postHorario()\n {\n //si la peticion es ajax\n if ( Request::ajax() ) {\n $horarios = Horario::get(Input::all());\n return Response::json(array('rst'=>1,'datos'=>$horarios));\n }\n }", "public function ajaxAction(){\n $request = $this->getRequest();\n $cat = $request->request->get('cat');\n $pg = $request->request->get('pg');\n $q = $request->request->get('q');\n $sort = $request->request->get('sort');\n if(!$request->isXmlHttpRequest() || !$pg || !$cat){\n throw new AccessDeniedHttpException('Você não tem permissão para acessar esta página.');\n }\n $ret['search'] = (empty ($q)) ? null : $q;\n $ret['cat'] = ($cat == 'all') ? null : $cat;\n if($pg != 1){\n list($field, $pg) = explode('_', $pg);\n }\n $ret['pg'] = $pg;\n $ret['sort'] = $sort;\n return $ret;\n }", "public function ajax()\n {\n /*if($name!=\"\"){\n switch($name){\n case 'change_active':\n $post['active'] = $status;\n $this->User_model->update($post, $id); \n break;\n } \n exit;\n }*/\n \n $this->app->get_table_data('users'); \n }", "public function consultaExtensionCambiosAjax(){\n\t\t//$post_data = $this->input->post(NULL, TRUE);\n\t\t$this->output->set_content_type('application/json');\n\t\t$post_data = json_decode(file_get_contents(\"php://input\"), true);\n \tif($post_data!=null){\n\t\t\t$result['cambios'] = $this->m_proyecto->consultarAllExtensionCambios($post_data);\n\t\t\t$result['cambios_totales'] = $this->m_proyecto->consultarTotalValorOfertaExtension($post_data['filtros']['proyecto_valor_oferta_id']);\n\t\t\tdie(json_encode($result));\n \t}\n }", "public function get_objetivos_estrategicos(){\n if($this->input->is_ajax_request() && $this->input->post()){\n $post = $this->input->post();\n $obj_id = $post['obj_id'];\n $obj_id = $this->security->xss_clean($obj_id);\n\n $dato_obj = $this->model_mestrategico->get_objetivos_estrategicos($obj_id);\n //caso para modificar el codigo de proyecto y actividades\n foreach($dato_obj as $row){\n $result = array(\n 'codigo' => $row['obj_codigo'],\n \"descripcion\" =>$row['obj_descripcion']\n );\n }\n echo json_encode($result);\n }else{\n show_404();\n }\n }", "function listarInterfazProceso(){\n //parametro de entrada, enviado desde la vista por medio de AJAX\n $id = $this->input->post('id_pro');\n //invoca al metodo en la clase modelo que retorna la informacion del proceso\n $result = $this->Interfaz_model->getInterfaz_Proceso($id);\n //envia el resultado del proceso a la vista\n echo json_encode($result);\n }", "public function ajax_details()\n\t{\n\t\t$member_id = $this->input->post(\"id\");\n\t\t\n\t\t$returnAJAX = $this->members_model->read_form($member_id);\n\n\t\techo json_encode($returnAJAX);\n\t}", "public function get_fase_activa(){\n if ($this->input->is_ajax_request() && $this->input->post()) {\n $post = $this->input->post();\n $id_fase = $post['id_fase'];\n $id_proy = $post['id_proy'];\n $dato = $this->model_faseetapa->fase_etapa($id_fase,$id_proy);\n $result = array(\n 'descripcion' => $dato[0]['descripcion'],\n 'eficacia' => $dato[0]['pfec_eficacia'],\n 'financiera' => $dato[0]['pfec_eficiencia'],\n 'ejecucion' => $dato[0]['pfec_eficiencia_pe'],\n 'fisica' => $dato[0]['pfec_eficiencia_fi'],\n );\n echo json_encode($result);\n } else {\n show_404();\n }\n }", "public function mostrar_ajax_grados()\n\t{\n\t\t$sentencia = \"select t2.id_grado, t2.nombre_grado, t2.cant_est from grados t2 \"; \n\t\t//var_dump($this->pdo); \\\"$tagger\\\"\n\t\n\t\t$resultado = $this->pdo->prepare($sentencia);\n\t\t$html=\"\";\n\t\t$resultado->execute();\n\n\t\t$num = $resultado->fetchAll();\n\n\t\t$valor = array();\n\t\t$valor = array(\n\t\t\"data\"=> $num\n\t\t); \n\t\theader('Content-type: application/json');\n\t\techo json_encode($valor);\n\t\t//return $datos;\n\t}", "function getRegistroAJAX() {\n if (@$_POST['operacao']) {\n switch ($_POST['operacao']) {\n /**\n * Retorna quantidade de permissões por departamento cadastrado.\n */\n case 'getEstatisticaPermissaoDepartamento':\n $retorno = [];\n $permissaoDAO = new PermissaoDAO();\n $retorno = $permissaoDAO->getQuantidadePermissaoPadraoDepartamento(15);\n print_r(json_encode($retorno));\n die();\n /**\n * Efetua edição do registro informado por parametro.\n */\n case 'getListaControleRegistro':\n $retorno = [];\n $permissaoDAO = new PermissaoDAO();\n $retorno = $permissaoDAO->getListaRegistroControle($_POST['pesquisa']);\n print_r(json_encode($retorno));\n die();\n /**\n * Retorna quantidade de registros cadastrados dentro do sistema\n */\n case 'getTotalRegistro':\n $permissaoDAO = new PermissaoDAO();\n print_r(json_encode($permissaoDAO->getTotalCadastro()));\n die();\n /**\n * Retorna registro solicitado por parametro.\n */\n case 'getRegistro':\n $retorno = [];\n $permissaoDAO = new PermissaoDAO();\n $retorno = $permissaoDAO->getRegistroVetor(@$_POST['idPermissao']);\n print_r(json_encode($retorno));\n die();\n /**\n * Retorna os cargos que possuem permissão informada.\n */\n case 'getDepartamentoPermissao':\n $retorno = [];\n $departamentoDAO = new DepartamentoDAO();\n $retorno = $departamentoDAO->getListaDepartamentoPermissao(@$_POST['idPermissao']);\n print_r(json_encode($retorno));\n die();\n /**\n * Retorna lista de permissões do usuário.\n */\n case 'getPermissaoUsuario':\n $retorno = [];\n $permissaoDAO = new PermissaoDAO();\n $retorno = $permissaoDAO->getListaUsuarioPermissao(@$_POST['idPermissao']);\n print_r(json_encode($retorno));\n die();\n /**\n * Lista de registros vinculados ao departamento informado.\n */\n case 'getListaDepartamentoRegistroPadrao':\n $retorno = [];\n if (@$_POST['id']) {\n $departamentoDAO = new DepartamentoDAO();\n $resultado = $departamentoDAO->getListaDepartamentoPermissao(intval($_POST['id']));\n foreach ($resultado as $value) {\n $registro['id'] = $value->getId();\n $registro['nome'] = $value->getNome();\n array_push($retorno, $registro);\n }\n }\n print_r(json_encode($retorno));\n die();\n /**\n * Retorna estatistica do controle de permissões.\n */\n case 'getEstatisticaControle':\n $permissaoDAO = new PermissaoDAO();\n print_r(json_encode($permissaoDAO->getRegistroControle()));\n die();\n /**\n * Retorna lista de permissoes disponiveis de acordo com o \n * departamento do usuario.\n */\n case 'getListaPermissaoDisponivel':\n $retorno = [];\n $permissaoDAO = new PermissaoDAO();\n if (Sessao::getUsuario()->getEntidadeDepartamento()->getAdministrador() === 1) {\n $retorno = $permissaoDAO->getListaPermissaoVetor();\n } else {\n $retorno = $permissaoDAO->getListaPermissaoVetor(Sessao::getUsuario()->getId());\n }\n print_r(json_encode($retorno));\n die();\n /**\n * Retorna lista de permissoes do usuario informado por parametro.\n */\n case 'getListaPermissaoUsuario':\n $retorno = [];\n if (@$_POST['idUsuario']) {\n $permissaoDAO = new PermissaoDAO();\n $usuarioDAO = new UsuarioDAO();\n if ($usuarioDAO->getUsuarioAdministrador($_POST['idUsuario'])) {\n $retorno = $permissaoDAO->getListaPermissaoVetor();\n } else {\n $retorno = $permissaoDAO->getListaPermissaoVetor($_POST['idUsuario']);\n }\n }\n print_r(json_encode($retorno));\n die();\n }\n }\n echo 1;\n }", "protected function ajax() {\n\t\t// Ignore invalid AJAX requests, AJAX requests should always contain a vote\n\t\tif ( ! $this->is_ajax or empty( $this->new_vote ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Load results and vote feedback\n\t\t$this->load_results();\n\t\t$this->load_vote();\n\n\t\t// Send the item back in JSON format\n\t\techo json_encode( $this->item );\n\t}", "public function postListar()\n {\n if ( Request::ajax() ) {\n \t/*$listar = DB::table('mesas')\n \t\t\t->select('id','name as nombre')\n ->where('estado',1)\n ->get();*/\n $mesas = Mesa::where('estado',1)->get();\n\n return Response::json(\n array(\n 'rst' => 1,\n 'datos' => $mesas\n )\n );\n }\n }", "function Buscar_Pregunta($codigo,$examen){\n //$respuesta = new xajaxResponse('ISO-8859-1');\n $respuesta = new xajaxResponse();\n $ClsExa = new ClsExamen();\n $result = $ClsExa->get_pregunta_curso($codigo,$examen);\n\t//$respuesta->alert(\"$result\");\n\t\tif(is_array($result)){\n\t\t\tforeach($result as $row){\n\t\t\t\t\t$codigo = $row[\"pre_codigo\"];\n\t\t\t\t\t$respuesta->assign(\"codigo\",\"value\",$codigo);\n\t\t\t\t\t$examen = utf8_decode($row[\"pre_examen\"]);\n\t\t\t\t\t$respuesta->assign(\"examen\",\"value\",$examen);\n\t\t\t\t\t$desc = utf8_decode($row[\"pre_descripcion\"]);\n\t\t\t\t\t$respuesta->assign(\"pregunta\",\"value\",$desc);\n\t\t\t\t\t$tipo = $row[\"pre_tipo\"];\n\t\t\t\t\t$respuesta->assign(\"tipo\",\"value\",$tipo);\n\t\t\t\t\t$puntos = $row[\"pre_puntos\"];\n\t\t\t\t\t$respuesta->assign(\"puntos\",\"value\",$puntos);\n\t\t\t}\n\t\t\t//--\n\t\t\t$respuesta->script(\"document.getElementById('mod').className = 'btn btn-primary';\");\n\t\t\t$respuesta->script(\"document.getElementById('grab').className = 'btn btn-primary hidden';\");\n\t\t\t$respuesta->script(\"cerrar();\");\n\t\t}\n return $respuesta;\n}", "public function gr_webforms_ajax_request()\n\t{\n\t\t$forms = $this->grApiInstance->getWebforms(array('sort' => array('name' => 'asc')));\n\t\t$response = json_encode(array('success' => $forms));\n\t\theader(\"Content-Type: application/json\");\n\t\techo $response;\n\t\texit;\n\t}", "public function ajax_update_keluarga()\n {\n $data['user_id'] = $this->user['id'];\n $update = $this->home->update_keluarga($data);\n\n if($update){\n echo json_encode(array(\"response\" => 'SUKSES', 'act' => \"upd\"));\n }else{\n echo json_encode(array(\"response\" => 'GAGAL', 'act' => \"upd\"));\n }\n }", "public function get_data_berita_on_slider_page(){\r\r\n\t\tif( $this->input->is_ajax_request() ){\r\r\n\t\t\t$this->get_data_ajax_berita_on_slider_page();\r\r\n\t\t}else{\r\r\n\t\t\tredirect(base_url());\r\r\n\t\t}\r\r\n\t}", "function add_indicador(){\n if ($this->input->is_ajax_request() && $this->input->post()) {\n $post = $this->input->post();\n $id_fase = $post['id_fase'];\n $eficacia = $post['eficacia'];\n $financiera = $post['financiera'];\n $ejecucion = $post['ejecucion'];\n $fisica = $post['fisica'];\n if($this->model_faseetapa->add_indicador_fase($id_fase,$eficacia,$financiera,$ejecucion,$fisica)){\n $result = array(\n 'respuesta' => 'true',\n );\n }else{\n $result = array(\n 'respuesta' => 'false',\n );\n }\n echo json_encode($result);\n } else {\n show_404();\n }\n }", "private function loadAjax(): void {\n // ID på tabellen skal være sat enten i $_GET eller $_POST\n if (isset($_POST['RCMSTable']) || isset($_GET['RCMSTable'])) {\n $id = $_POST['RCMSTable'] ?? $_GET['RCMSTable'];\n } else {\n return;\n }\n\n if (!isset($this->table[$id])) {\n return;\n }\n\n ob_get_clean();\n ob_start();\n header(\"Content-Type: application/json\");\n\n $table = $this->table[$id];\n $columns = $this->columns[$id];\n $where = $this->where[$id];\n $order = $this->order[$id];\n $settings = $this->settings[$id];\n\n if (isset($_POST['pageNum'])) {\n $settings['pageNum'] = $_POST['pageNum'];\n }\n\n if (isset($_POST['searchTxt'])) {\n $settings['searchTxt'] = $_POST['searchTxt'];\n }\n\n if (isset($_POST['sortKey'])) {\n $settings['sortKey'] = $_POST['sortKey'];\n }\n\n if (isset($_POST['sortDir'])) {\n $settings['sortDir'] = $_POST['sortDir'];\n }\n\n $this->settings[$id] = $settings;\n\n $rows = $this->retrieveData($table, $columns, $where, $order, $settings);\n\n $this->buildRows($id, $rows);\n\n exit;\n }", "public function ajax_load() {\n\t\t$wrapper = new netxRestWrapper();\n\t\t$netx = $wrapper->getNetx();\n\t\t$cats = $netx->getCategoryTree();\n\t\t$options = get_option('netx_options');\n\t\t?>\n\t\t<form id=\"netx-form\" class=\"media-upload-form validate\" action=\"<?php echo get_bloginfo(\"url\"); ?>/wp-admin/media-upload.php?post_id=<?php echo $postID; ?>&tab=netx\" method=\"post\" enctype=\"multipart/form-data\">\n\t\t\t<div id=\"category-tree\">\n\t\t\t\t<ul>\n\t\t\t\t\t<?php $this->tree_node_view($this->getRootCategoryFromTree($cats['1']['children'], $options['netx_base_category_id']), $options['netx_base_category_id']); ?>\n\t\t\t\t</ul>\n\t\t\t</div>\n\n\t\t\t<div id=\"media-items\">\n\t\t\t\t<div class=\"netx-upload-loading-area\">\n\t\t\t\t\t<div class=\"netx-spinner\">\n\t\t\t\t\t\t<div class=\"netx-dot1\"></div>\n\t\t\t\t\t\t<div class=\"netx-dot2\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class=\"clear-fix\"></div>\n\t\t</form>\n\t\t<?php\n\t\twp_die();\n\t}", "public function AjaxTablet() {\n\t\t\tif(AppValidar::PeticionAjax() == true):\n\t\t\t\t$plantilla = new NeuralPlantillasTwig(APP);\n\t\t\t\t$plantilla->Parametro('avisos', $this->Modelo->avisos());\n\t\t\t\techo $plantilla->MostrarPlantilla(implode(DIRECTORY_SEPARATOR, array('Dispositivos', 'AjaxTablet.html')));\n\t\t\telse:\n\t\t\t\techo 'No es posible cargar la información';\n\t\t\tendif;\n\t\t}", "public function ajaxcomisiones() { //OK\n $db = & $this->POROTO->DB;\n $ses = & $this->POROTO->Session;\n $lib = & $this->POROTO->Libraries['siteLibrary'];\n\n $idMateria = $_POST['materia'];\n $idCarrera = $_POST['carrera'];\n $idAlumnoCarrera = $_POST['idalumnocarrera'];\n $idAlumno = $_POST['alumno'];\n $permiteLibre = 0;\n\n $db->dbConnect(\"matriculacion/ajaxcomisiones/\" . $idMateria . \"/\" . $idCarrera . \"/\" . $idAlumno . \"/\" . $idAlumnoCarrera);\n\n //traer de alumnocarrera, si la inscripcion tiene instrumento/area y CURSANDO.\n $sql = \"select idarea,idinstrumento from alumnocarrera where idcarrera=\";\n $sql .= $idCarrera . \" and idpersona=\" . $idAlumno . \" and fechafinalizada is null and estado in (1,3) \";\n $sql .= \"and idalumnocarrera=\" . $idAlumnoCarrera;\n //Aca se podria sacar el estado ya que siempre voy a traer la q corresponda...\n\n $arrAlumno = $db->getSQLArray($sql);\n\n //Verifico si la materia permite anotarse libre.\n $sql = \"select idmateria,libre from viewmaterias m where idmateria=\" . $db->dbEscape($idMateria);\n $arrMatLibre = $db->getSQLArray($sql);\n $permiteLibre = $arrMatLibre[0]['libre'];\n\n //Trae las comisiones disponibles para anotarse, siempre y cuando esten activas y en coincidencia con iinstr.\n $sql = \"SELECT c.idcomision, c.codigo, c.nombre, c.turno, c.aula \";\n $sql .= \" FROM comisiones c \";\n $sql .= \" WHERE c.idmateria=\" . $db->dbEscape($idMateria);\n $sql .= \" AND c.estado=1 \";\n //Cambio 20180206 para traer solo las comisiones del año actual\n $sql .= \" AND c.anio=\" . date(\"Y\");\n //Fin cambio 20180206\n //Solo el alumno puede matricularse en las habilitadas.\n //20180315 A pedido de Pablo se asigno este permiso tambien a admin y directivos para que desde el modulo de matriculacion\n //solamente se pueda matricular a comisiones con matriculacionhabilitada=1\n if ($ses->tienePermiso('', 'Matricularme Permitir solo en Comisiones Habilitadas')) {\n $sql .= \" and matriculacionhabilitada=1 \";\n }\n $sql .= \" and (idarea=0 or idarea=\" . $arrAlumno[0]['idarea'] . \")\";\n $sql .= \" and (idinstrumento=0 or idinstrumento=\" . $arrAlumno[0]['idinstrumento'] . \")\";\n\n //Para el caso de ALUMNOS, deben tener el permiso siguiente, pero a su vez la materia debe permitir LIBRE\n //Solo asi puede matricularse libre.\n if ($ses->tienePermiso('', 'Matricularme Permitir en materias LIBRE (Alumno)') && $permiteLibre) {\n //Agrego una linea mas para anotarlo sin comision\n $sql .= \" UNION \";\n $sql .= \" SELECT 0 as idcomision,'----' AS codigo,'LIBRE (SIN COMISIÓN)' as nombre,'' as turno, '' as aula \";\n }\n\n //Para el caso de Administrativos o Directivos, tienen el siguiente permiso, \n //y pueden matricular libre en una materia sin importar si la materia permite libre o no.\n if ($ses->tienePermiso('', 'Matricularme Permitir en materias LIBRE (Admin)')) {\n //Agrego una linea mas para anotarlo sin comision\n $sql .= \" UNION \";\n $sql .= \" SELECT 0 as idcomision,'----' AS codigo,'LIBRE (SIN COMISIÓN)' as nombre,'' as turno, '' as aula \";\n }\n\n $arrComisiones = $db->getSQLArray($sql);\n\n foreach ($arrComisiones as &$comision) {\n if ($comision['idcomision'] > 0) { //Solo traigo datos si es una comision real, sino es LIBRE\n //Traigo los horarios\n $sql = \"SELECT dia, date_format(inicio,'%H:%i') inicio, date_format(fin,'%H:%i') fin\";\n $sql .= \" FROM comhorario\";\n $sql .= \" WHERE idcomision=\" . $comision['idcomision'];\n $arrHorarios = $db->getSQLArray($sql);\n $comision['horarios'] = \"\";\n foreach ($arrHorarios as $horario)\n $comision['horarios'] .= \"~**~\" . $horario['dia'] . \" \" . $horario['inicio'] . \" a \" . $horario['fin'];\n\n $comision['horarios'] = substr($comision['horarios'], 4);\n unset($arrHorarios);\n\n //Traigo los cupos\n $sql = \"SELECT idcomcupo, descripcion, cantidad, cantdisponible\";\n $sql .= \" FROM comcupos\";\n $sql .= \" WHERE idcomision=\" . $comision['idcomision'];\n $comision['cupos'] = $db->getSQLArray($sql);\n $cupoCupos = \"\";\n $cupoTotal = 0;\n $dispTotal = 0;\n foreach (($comision['cupos']) as $cupo) {\n $cupoCupos .= $cupo['descripcion'] . \"~***~\" . $cupo['cantidad'] . \"~***~\";\n $cupoCupos .= $cupo['cantdisponible'] . \"~***~\" . $cupo['idcomcupo'] . \"~**~\";\n $cupoTotal += $cupo['cantidad'];\n $dispTotal += $cupo['cantdisponible'];\n }\n //Traigo los datos del profesor de la comision\n $sql = \"SELECT p.apellido, p.nombre, sr.descripcion\";\n $sql .= \" FROM comprofesor cp\";\n $sql .= \" INNER JOIN personas p on cp.idpersona=p.idpersona and p.estado=1\";\n $sql .= \" INNER JOIN situacionrevista sr on cp.situacionrevista_id=sr.id\";\n $sql .= \" WHERE cp.idcomision=\" . $comision['idcomision'];\n $arrProfesores = $db->getSQLArray($sql);\n $comision['profesores'] = \"\";\n foreach ($arrProfesores as $profesor)\n $comision['profesores'] .= \"~**~\" . $profesor['apellido'] . \",\" . $profesor['nombre'] . \" (\" . $profesor['descripcion'] . \")\";\n\n $comision['profesores'] = substr($comision['profesores'], 4);\n unset($arrProfesores);\n $comision['cupoCupos'] = substr($cupoCupos, 0, -4);\n $comision['cupoTotal'] = $cupoTotal;\n $comision['cupoDisponible'] = $dispTotal;\n }\n }\n $db->dbDisconnect();\n echo json_encode($arrComisiones);\n }", "function ajax_query()\n {\n }", "private function ajaxResponse()\n {\n echo json_encode($this->response);\n die(1);\n }", "public function AjaxPC() {\n\t\t\t$data = $this->Modelo->avisos();\n\t\t\t$pagina = (count($data) >= 1) ? array_chunk($data, 8) : array();\n\t\t\t\n\t\t\t$plantilla = new NeuralPlantillasTwig(APP);\n\t\t\t$plantilla->Parametro('cantidad', count($data));\n\t\t\t$plantilla->Parametro('paginas', count($pagina));\n\t\t\t$plantilla->Parametro('listado', $pagina);\n\t\t\techo $plantilla->MostrarPlantilla(implode(DIRECTORY_SEPARATOR, array('Dispositivos', 'AjaxPC.html')));\n\t\t}", "public function ajaxTrearCamposFotoProducto(){\n \n $idDetallePedido = $this->idProducto;\n \n $imagenes = ControladorPedidos::ctrTraerFotosProducto($idDetallePedido);\n echo json_encode($imagenes);\n\n }", "public function postDia()\n {\n //si la peticion es ajax\n if ( Request::ajax() ) {\n $dias = Dia::get(Input::all());\n return Response::json(array('rst'=>1,'datos'=>$dias));\n }\n }", "protected function processGetRequest()\n {\n $this->ajaxDie(json_encode([\n 'success' => true,\n 'operation' => 'get'\n ]));\n }", "function ajaxList() {\r\n $this->rdAuth->noStudentsAllowed();\r\n // Set up the list\r\n $this->setUpAjaxList();\r\n // Process the request for data\r\n $this->AjaxList->asyncGet();\r\n }", "public function postAjax_proyecto_detalles()\n\t{\n\t\tif( Request::ajax() ){\n\t\t\t\n\t\t\t$id = Input::get('p_id', 0);\n\t\t\t$ver = Input::get('ver', '');//puede ser mayor o menor que \">\" o \"<\"\n\t\t\t\n\t\t\t$proyecto = Proyectos::with('imagenes');\n\t\t\t\n\t\t\tif( empty($ver) ){\n\t\t\t\t$proyecto->where('id', '=', $id);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$order = 'desc';\n\t\t\t\tif( $ver == '>' ){\n\t\t\t\t\t$order = 'asc';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$order = 'desc';\n\t\t\t\t}\n\t\t\t\t$proyecto->where('id', $ver, $id)->orderBy('id', $order);\n\t\t\t}\n\t\t\t\n\t\t\t$proyecto = $proyecto->first();\n\t\t\t\n\t\t\tif( $proyecto ){\n\t\t\t\treturn Response::json(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'success'\t=> true,\n\t\t\t\t\t\t'proyecto'\t\t=> $proyecto,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\treturn Response::json(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'success'\t=> false,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\t\t\t \n\t\t}\n\t}", "function get_formulariorequisitos()\n {\n //if($this->acceso(103)) {\n if ($this->input->is_ajax_request()) {\n $postulante_id = $this->input->post('postulante_id');\n $this->load->model('Formulario_autentificacion_model');\n $datos = $this->Formulario_autentificacion_model->get_all_formulario_postulante($postulante_id);\n echo json_encode($datos);\n }else{ \n show_404();\n }\n //}\n }", "function func_lista_motivos ($idmotivo) {\n $ids ['0'] = substr($idmotivo, 0, 1);\n $ids ['1'] = substr($idmotivo, 1, 2);\n $consulta_motivos = mysql_query (\"SELECT * FROM motivos ORDER BY 3\");\n $html_salida = '<select name=\"s_list_motivos\"\n onchange=\"xajax_busca_motivos(document.formulario.s_list_motivos.value);\n xajax_lista_color(document.formulario.s_list_motivos.value);\" >\n <option value=\"0\"> MOTIVOS </option>';\n while ($fila=mysql_fetch_array($consulta_motivos))\n {\n if (($fila['idmotivo'] == $ids['0']) && ($fila['idmotivo2'] == $ids['1']))\n $html_salida.= '<option selected=\"selected\" value=\"'.$fila['idmotivo'].''.$fila['idmotivo2'].'\" >'.$fila['desc'].'</option>';\n else\n $html_salida.= '<option value=\"'.$fila['idmotivo'].''.$fila['idmotivo2'].'\" >'.$fila['desc'].'</option>';\n }\n $html_salida.= '</select>';\n #--\n $html_pre_arribo = '\n <td colspan=\"\">\n <input type=\"button\" value=\"PRE-ARRIBO\" \n onClick=\"window.open(\\'pre_arribo.php?id_motivo=\\'+\\''.$idmotivo.'\\', \n\t\t\t\t \\'INSTRUCCIONES\\', \\'width=480,height=600,scrollbars=yes\\');\" \n />\n </td> ';\n \n\n $salida = $html_salida;\n $respuesta = new xajaxResponse();\n $respuesta->addAssign(\"div_lista_motivos\",\"innerHTML\",$salida);\n $respuesta->addAssign(\"div_pre_arribo\",\"innerHTML\",$html_pre_arribo);\n return $respuesta;\n}", "public function index_ajax()\n {\n $this->department->getDepartmentAjax();\n }", "public function showArticleAjax(): void\n {\n // On vérifie si on est logué et si on a les droits administrateur.\n if(!\\Session::isLogged() || \\Session::get('role') != 'admin') {\n \\FlashMessage::setMessage('danger', 'Vous n’avez pas les droits pour accéder à cette page, veuillez vous connecter et réessayer.');\n \\Http::redirectTo('home');\n }\n \n // On récupère tous les articles\n $articles = $this->model->selectAll(['created_at DESC']);\n\n // On inclut la table des articles\n include 'views/admin/table-article.phtml';\n }", "public function adminAjax()\r\n\t{\r\n\t\treturn;\r\n\t}", "protected function ajaxRechercherUnVelo()\n\t{\n\t\t$lesVelos = null;\n\n\t\t\t/** si valeur, on lance la recherche */\n\t\tif(isset($_GET['valeur']) and $_GET['valeur'] !== '')\n\t\t\t$lesVelos = $this->odbVelo->searchVelos($_GET['valeur']);\n\t\telse\n\t\t\t$lesVelos = $this->odbVelo->getNouveauxVelos();\n\n\t\t\t// si pas de velo, erreur\n\t\tif (empty($lesVelos))\n\t\t\t$_SESSION['tampon']['error'][] = 'Pas de v&eacute;lo...';\n\n\t\t\t/**\n\t\t\t * Load des vues\n\t\t\t */\n\t\tview('contentAllVelo', array('lesVelos'=>$lesVelos, 'isAjax'=>true));\n\t}", "public function getAjaxAddDefisAction()\n {\n $request = $this->container->get('request');\n\n if($request->isXmlHttpRequest())\n {\n $current_user = $this->container->get('security.context')->getToken()->getUser();\n\n $id_montre = $request->query->get('montre');\n\n $date_deb = explode('/', $request->query->get('dateDebPerf'));\n $data['date_deb'] = $date_deb[2].'-'.$date_deb[1].'-'.$date_deb[0];\n\n $date_fin = explode('/', $request->query->get('dateFinPerf'));\n $data['date_fin'] = $date_fin[2].'-'.$date_fin[1].'-'.$date_fin[0];\n\n $pas_or_km = $request->query->get('pas_or_km');\n $data['pas_or_km'] = $pas_or_km;\n\n //Calcule de time\n $time1 = strtotime($data['date_deb']);\n $time2 = strtotime($data['date_fin']);\n\n if($time2 < $time1){\n $data['error'] = true;\n }\n elseif($data['date_deb'] == $data['date_fin']){\n $data['time'] = 1;\n }\n else{\n $data['time'] = ($time2 - $time1)/(60*60*24);\n }\n\n $possessedDevice = $this->getDoctrine()->getRepository('AppBundle:PossessedDevice')->find($id_montre);\n\n $namePossessedDevice = $possessedDevice->getDeviceType()->getName();\n $data['montre']['name'] = $namePossessedDevice;\n\n switch ($namePossessedDevice) {\n case 'Withings Activité Pop':\n $withings = $this->get('app.withings');\n $withings->authenticate($possessedDevice);\n $json = $withings->getActivities($withings->getUserID() , $data['date_deb'], $data['date_fin']);\n $data['nbPas'] = $json['global']['steps'];\n $data['nbKm'] = round($json['global']['distance']/1000, 2);\n break;\n case 'Jawbone UP 24':\n $jawbone = $this->get('app.jawbone');\n $json = $jawbone->getMoves($possessedDevice->getAccessTokenJawbone(), $data['date_deb'], $data['date_fin']);\n $data['nbPas'] = $json['global']['steps'];\n $data['nbKm'] = round($json['global']['distance']/1000, 2);\n break;\n case 'Googlefit':\n $montre_service = $this->get('app.googlefit');\n break;\n default:\n $data['json'] = null;\n break;\n }\n\n if($data['nbPas'] == null || $data['nbKm'] == null){\n $data['error'] = true;\n }\n\n return $this->render('AppBundle:Ajax:ajax_add_defis.html.twig', array(\n \"data\" => $data\n ));\n }\n }", "public function actionAjax()\n {\n $url = $_POST['url'];\n $video_id = VideoLibrary::get_video_id($url);\n //check if link was parsed succesfully\n if ( $video_id ) \n {\n $json_output = VideoLibrary::get_json_output($video_id);\n $title = VideoLibrary::get_info($json_output,'title');\n $description = VideoLibrary::get_info($json_output,'description');\n $image = VideoLibrary::get_info($json_output,'thumbnails')->high->url;\n $video_url = \"http://www.youtube.com/embed/\" . $video_id;\n $json_array = [\"title\"=>$title, \"description\"=>$description, \"image\"=>$image, \"video_url\"=> $video_url ];\n echo json_encode($json_array);\n\n }\n }", "final public function action_ajax_get_lot() {\n\n if (HTTP_Request::POST == $this->request->method()) {\n $postData = $this->request->post();\n $projet_id = $postData['projet_id'];\n //$cur_us = $this->current_user;\n try {\n $where = '';\n if ($projet_id != 'tous') {\n $where = \"WHERE projet_id in (\" . $projet_id . \")\";\n }\n\n if ($projet_id != \"\") {\n $sql = \"SELECT lot_id,nom_zip FROM lot \" . $where . \"AND termine IN (0,1)\";\n $sql2 = \"SELECT lot_id, nom_zip_original FROM lot \" . $where . \"AND termine IN (0,1) ORDER BY nom_zip_original\";\n\t\t\t\t\t$sql3 = \"SELECT DISTINCT(commande_vivetic) commande_vivetic FROM lot \" . $where . \"AND termine IN (0,1) ORDER BY commande_vivetic ASC\";\n $data_projet = DB::query(Database::SELECT, $sql)->execute();\n $data_nomzip = DB::query(Database::SELECT, $sql2)->execute();\n\t\t\t\t\t$data_commande_vivetic = DB::query(Database::SELECT, $sql3)->execute();\n $return = array();\n $return2 = array();\n\t\t\t\t\t$return3 = array();\n foreach ($data_projet as $p) {\n $return[] = $p;\n }\n foreach ($data_nomzip as $p) {\n $return2[] = $p;\n }\n\t\t\t\t\tforeach ($data_commande_vivetic as $p) {\n $return3[] = $p;\n }\n $data = array();\n $data['projet'] = $return;\n $data['nomzip'] = $return2;\n\t\t\t\t\t$data['commande_vivetic'] = $return3;\n $this->response->body(json_encode($data));\n }\n else\n throw new HTTP_Exception_500();\n } catch (Exception $exc) {\n $this->response->body(Kohana::message('misc', 'database.error_connexion') . ' - ' . $exc->getMessage());\n }\n }\n }", "public function initAjax()\n {\n }", "function ajax_add()\n {\n\t\n }", "function ajax()\n\t{\n\t\t$method = $this->input->post('method');\n\t\tswitch( $method )\n\t\t{\n\t\t\tcase \"add\" :\n\t\t\t\t$this->form_validation->set_rules($this->config->item('insert', 'language_validation'));\n\t\t\t\tif($this->form_validation->run($this, 'insert') == FALSE)\n\t\t\t\t\techo json_encode( array(\"event\" => \"error\", \"msg\" => validation_errors() ) );\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$insertedrows = $this->lng->insertInto($this->input->post());\n\t\t\t\t\tif($insertedrows)\n\t\t\t\t\t\techo json_encode( array(\"event\" => \"success\", \"msg\" => _e('language added')) );\n\t\t\t\t\telse\n\t\t\t\t\t\techo json_encode( array(\"event\" => \"error\", \"msg\" => _e('language add fail')) );\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"edit\" :\n\t\t\t\t$this->form_validation->set_rules($this->config->item('update', 'language_validation'));\n\t\t\t\tif($this->form_validation->run($this, 'update') == FALSE)\n\t\t\t\t\techo json_encode( array(\"event\" => \"error\", \"msg\" => validation_errors() ) );\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$row_id = $this->input->post('row_id');\n\t\t\t\t\techo json_encode( doAction('lng', 'update', $row_id, false, $this->input->post()) );\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tbreak;\t\n\t\t\t\t\n\t\t\tcase \"langedit\" :\n\t\t\t\t$data['language'] = $this->input->post('language');\n\t\t\t\t$data['domain'] = $this->input->post('domain');\n\t\t\t\t\n\t\t\t\t$information = $this->template->admin_view(\"lang_list\", $data, true, \"language\");\n\t\t\t\techo json_encode( array(\"event\" => \"success\", \"msg\" => _e('success') , \"data\" => $information, \"lang\" => $data['language']));\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"change\":\n\t\t\t\t $filename = $this->input->post('filename');\n\t\t\t\t $key = $this->input->post('key');\n\t\t\t\t $lan = $this->input->post('lan');\n\t\t\t\t $domain = $this->input->post('domain'); \n\t\t\t\t $content = $this->input->post('content');\n\t\t\t\t $langdata = include(APPPATH.'/modules/'.$domain.'/language/'.$lan.'/'.$domain.'_lang.php');\n\t\t\t\t if($langdata != 1)\n\t\t\t\t {\n\t\t\t\t\t $path = $_SERVER['SCRIPT_FILENAME'];\n\t\t\t\t\t $path_done = str_replace('index.php', '', $path);\n\t\t\t\t\t $folder = $path_done.APPPATH.'modules/'.$domain.'/language/';\n\t\t\t\t\t mkdir(\"$folder/$lan\");\t\t\t\t\t \n\t\t\t\t\t $myFile = $path_done.APPPATH.'modules/'.$domain.'/language/'.$lan.'/'.$domain.'_lang.php';\n\t\t\t\t\t $lang[$key] = $content;\t\t\n\t\t\t\t\t\t foreach($lang as $key => $value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$php_start = '<?php';\n\t\t\t\t\t\t\t\t$total_language .= '$lang'.\"['\".$key.\"'] = '\".$value.\"';\\n\";\n\t\t\t\t\t\t\t\t$php_end = '?>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\tfile_put_contents($myFile, $php_start.\"\\n\".$total_language.\"\\n\".$php_end, FILE_APPEND);\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t\t\t $lang[$key] = $content;\t\t\n\t\t\t\t\t\t foreach($lang as $key => $value)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$php_start = '<?php';\n\t\t\t\t\t\t\t\t$total_language .= '$lang'.\"['\".$key.\"'] = '\".$value.\"';\\n\";\n\t\t\t\t\t\t\t\t$php_end = '?>';\n\t\t\t\t\t\t\t}\t\t\t\t\n\t\t\t\t\t\t$data_to_write = $php_start.\"\\n\".$total_language.\"\\n\".$php_end;\n\t\t\t\t\t\t$file_path = $filename;\n\t\t\t\t\t\t$file_handle = fopen($file_path, 'w'); \n\t\t\t\t\t\tfwrite($file_handle, $data_to_write);\n\t\t\t\t\t\tfclose($file_handle);\n\t\t\t\t }\n\t\t\t\techo json_encode( array(\"event\" => \"success\", \"msg\" => _e('success')) );\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase \"delete\":\n\t\t\t\t $filename = $this->input->post('filename');\n\t\t\t\t $key = $this->input->post('key');\n\t\t\t\t $lan = $this->input->post('lan');\n\t\t\t\t $domain = $this->input->post('domain'); \n\t\t\t\t $content = $this->input->post('content');\n\t\t\t\t $langdata = include(APPPATH.'/modules/'.$domain.'/language/'.$lan.'/'.$domain.'_lang.php');\n\t\t\t\t $lang[$key] = $content;\t\t\n\t\t\t\t foreach($lang as $key => $value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$php_start = '<?php';\n\t\t\t\t\t\t$total_language .= '$lang'.\"['\".$key.\"'] = '\".$value.\"';\\n\";\n\t\t\t\t\t\t$php_end = '?>';\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t$data_to_write = $php_start.\"\\n\".$total_language.\"\\n\".$php_end;\n\t\t\t\t$file_path = $filename;\n\t\t\t\t$file_handle = fopen($file_path, 'w'); \n\t\t\t\tfwrite($file_handle, $data_to_write);\n\t\t\t\tfclose($file_handle);\n\t\t\t\techo json_encode( array(\"event\" => \"success\", \"msg\" => _e('success'), \"id\" => $this->input->post('id')) );\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t case 'getlanguage':\n\t\t\t\t$type = array();\n\t\t\t\t$lang = array('english'=>'English','hindi'=>'Hindi');\n\t\t\t\techo json_encode($lang);\t\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t case \"langadd\" :\n\t\t\t\t$information = $this->template->admin_view(\"lang_add\", $data, true, \"language\");\n\t\t\t\techo json_encode( array(\"event\" => \"success\", \"msg\" => _e('language add bellow') , \"data\" => $information) );\n\t\t\t\tbreak;\t\t\n\t\t\t\t\t\n\t\t case \"add_language_key\":\n\t\t\t\t $lan = $this->input->post('lan');\n\t\t\t\t $domain = $this->input->post('domain'); \n\t\t\t\t $content = $this->input->post('content');\n\t\t\t\t $langdata = include(APPPATH.'/modules/'.$domain.'/language/english/'.$domain.'_lang.php');\n\t\t\t\t $filename = APPPATH.'modules/'.$domain.'/language/english/'.$domain.'_lang.php';\n\t\t\t\t $content_remov = strtolower(str_replace(' ', '_', $content));\n \t\t $lang[$content_remov] = $content;\t\n\t\t\t\t foreach($lang as $key => $value)\n\t\t\t\t\t{\n\t\t\t\t\t\t$php_start = '<?php';\n\t\t\t\t\t\t$total_language .= '$lang'.\"['\".$key.\"'] = '\".$value.\"';\\n\";\n\t\t\t\t\t\t$php_end = '?>';\n\t\t\t\t\t}\t\n\t\t\t\t$data_to_write = $php_start.\"\\n\".$total_language.\"\\n\".$php_end;\n\t\t\t\t$file_path = $filename;\n\t\t\t\t$file_handle = fopen($file_path, 'w'); \n\t\t\t\tfwrite($file_handle, $data_to_write);\n\t\t\t\tfclose($file_handle);\n\t\t\t\techo json_encode( array(\"event\" => \"success\", \"msg\" => _e('language update successful')) );\n\t\t\t\tbreak;\t\t\t\n\t\t}\n\t}", "public function recuperarhtmlAction() {\n\n //$this->_helper->layout->disableLayout();\n $idDocumento = Zend_Filter::FilterStatic($this->_getParam('id'), 'Alnum');\n $numeroDocumento = Zend_Filter::FilterStatic($this->_getParam('dcmto'), 'Alnum');\n $tipoDoc = Zend_Filter::FilterStatic($this->_getParam('tipo', 1), 'Alnum');\n $versao = Zend_Filter::FilterStatic($this->_getParam('versao'), 'Alnum');\n $userNs = new Zend_Session_Namespace('userNs');\n $matricula = $userNs->matricula;\n $response = new stdClass();\n try {\n $arquivo = $this->recuperar($idDocumento, $numeroDocumento, $matricula);\n $response->success = true;\n $response->arquivo = $arquivo;\n $this->_helper->json->sendJson($response);\n } catch (Exception $exc) {\n $response->success = false;\n $response->erro = $exc->getMessage();\n $this->_helper->json->sendJson($response);\n }\n }", "public function ajax()\n {\n $ajax_data = array();\n $user_id = $this->user_session->getUserId();\n $post = $this->request->request->all();\n\n if ($user_id) {\n $user = $this->user_logic->getUserById($user_id);\n if ($user !== false) {\n if (! empty($user) AND is_array($user)) {\n\n $user = array_pop($user);\n\n $ajax_data['code'] = 0;\n $ajax_data['data']['user'] = $user;\n $ajax_data['message'] = 'User Data Found;';\n\n switch($post['action']) {\n\n case 'update' : $result = $this->user_logic->ajaxUpdate($user,$post['unit_id'],$post['fields'],$post['values']);\n $ajax_data['message'] = $result;\n break;\n\n default : $ajax_data['message'] .= ' Processing unit_id: '. $post['unit_id'] . ';';\n $ajax_data['message'] .= ' Action: '. $post['action'] . ';';\n\n }\n\n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'User does not exist'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Failed to get user info'; \n } \n } else {\n $ajax_data['code'] = 1;\n $ajax_data['message'] = 'Invalid user id';\n }\n \n $this->ajax_respond($ajax_data);\n }", "public function ajax_add()\t{\n\t\t\n $text = $this->input->post('value');\n\t\t\n\t\tif ($text=='') {\n $d['result'] = 0;\n $d['message'] = \"La tâche ne peut pas être vide.\";\n } else {\n\t\t\t$echappe = array('text' => $text);\n $noechappe=array('status'=>0,'created'=>'NOW()');\n\t\t\t$insert = $this->todos->insert($echappe,$noechappe);\n\t\t\tif($insert) {\n\t\t\t\t$d['result'] = 1;\n\t $d['message'] = \"La tâche a été ajoutée.\";\n\t\t\t\t// Pour le refresh\n\t $d['url'] = \"todo/ajax_refresh\";\n\t $d['data'] = $insert; // Car la fonction insert de ma classe MY_Model renvoi l'id du dernier enregistrement\n\t $d['div'] = \"#todos\";\n\t\t\t} else {\n $d['result'] = 0;\n $d['message'] = \"Impossible d'ajouter la tâche.\";\n\t\t\t}\n } \n \t\theader('Content-Type: application/json');\n \techo json_encode( $d );\n\t}", "public function echoAjaxContent() {\n\t\t\n\t\t$sSection = trim( $_GET[ 'section' ] );\n\t\t$sMethod = '';\n\t\t\n\t\tif ( $sSection ) {\n\t\t\t$sMethod = sprintf( 'get%sAjax', Geko_Inflector::camelize( $sSection ) );\n\t\t\tif ( !method_exists( $this, $sMethod ) ) $sMethod = '';\n\t\t}\n\t\t\n\t\tif ( $sMethod ) {\n\t\t\t$aAjaxResponse = $this->$sMethod();\n\t\t\techo Zend_Json::encode( $aAjaxResponse );\n\t\t}\n\t}", "function ajax_getFacturas(){\n $id = $this->input->post('id');\n\n $query = \"SELECT F.id, F.fecha, F.usuario, F.cliente, F.contacto, F.reporte_servicio, F.orden_compra, F.forma_pago, F.pagada, F.conceptos, F.notas, F.estatus_factura, F.documentos_requeridos, F.serie, F.folio, F.codigo_impresion, (SELECT count(id) from recorrido_conceptos where id_concepto = F.id and tipo = 'FACTURA') as Recorridos, (SELECT count(id) from envios_factura where factura = F.id) as Envios, E.nombre as Cliente, concat(U.nombre, ' ', U.paterno) as User, U.correo, ifnull(EC.correo, 'N/A') as CorreoContacto from solicitudes_facturas F inner join empresas E on E.id = F.cliente inner join usuarios U on U.id = F.usuario left join empresas_contactos EC on EC.id = F.contacto\";\n $query .= \" where F.folio > 0 and F.estatus = 'ACEPTADO'\";\n\n if($id)\n {\n $query .= \" and F.id = '$id'\";\n }\n \n if(isset($_POST['estatus']))\n {\n $estatus = $this->input->post('estatus');\n $query .= \" and F.estatus = '$estatus'\";\n }\n\n $res = $this->Conexion->consultar($query, $id);\n if($res)\n {\n echo json_encode($res);\n }\n }", "public function RenderContentAjax(): void {\n $this->showContent(TRUE);\n }", "public function mp_hook_smsabo_ajax(){\n\t\treturn $this->mp_hook_payment_ajax('smsabo');\n\t\t}", "public static function handle_ajax() {\n\t\tHelpers::ajax_wrapper( array( self::class, 'ajax_handler_body' ) );\n\t}", "function Buscar_Informacion($codigo){\n //$respuesta = new xajaxResponse('ISO-8859-1');\n $respuesta = new xajaxResponse();\n $ClsInf = new ClsInformacion();\n\t\n\t//$respuesta->alert(\"$codigo\");\n $result = $ClsInf->get_informacion($codigo);\n if(is_array($result)){\n foreach($result as $row){\n $codigo = $row[\"inf_codigo\"];\n $respuesta->assign(\"codigo\",\"value\",$codigo);\n $nombre = utf8_decode($row[\"inf_nombre\"]);\n $respuesta->assign(\"nom\",\"value\",$nombre);\n $desc = utf8_decode($row[\"inf_descripcion\"]);\n $respuesta->assign(\"desc\",\"value\",$desc);\n $desde = $row[\"inf_fecha_inicio\"];\n $desde = cambia_fechaHora($desde);\n $fecini = substr($desde,0,10);\n $horini = substr($desde,11,18);\n $respuesta->assign(\"fecini\",\"value\",$fecini);\n $respuesta->assign(\"horini\",\"value\",$horini);\n $hasta = $row[\"inf_fecha_fin\"];\n $hasta = cambia_fechaHora($hasta);\n $fecfin = substr($hasta,0,10);\n $horfin = substr($hasta,11,18);\n $respuesta->assign(\"fecfin\",\"value\",$fecfin);\n $respuesta->assign(\"horfin\",\"value\",$horfin);\n $link = $row[\"inf_link\"];\n $respuesta->assign(\"link\",\"value\",$link);\n //--\n $imagen = $row[\"inf_imagen\"];\n $respuesta->assign(\"imagenold\",\"value\",$imagen);\n if($imagen != \"\"){\n $oldimg = '<label>Imagen:</label> <span>'.$imagen.'</span><br>';\n $oldimg.= '<img src=\"../../CONFIG/Actividades/'.$imagen.'\" class=\"img-thumbnail\" width = \"100%\" >';\n $respuesta->assign(\"oldimg\",\"innerHTML\",$oldimg);\n }else{\n $oldimg = '<label>Imagen:</label> <span>(No hay imagen cargada)</span><br>';\n $oldimg.= '<img src=\"../../CONFIG/images/noimage.png\" class=\"img-thumbnail\" width = \"100%\" >';\n $respuesta->assign(\"oldimg\",\"innerHTML\",$oldimg);\n }\n }\n //--\n $respuesta->script('document.getElementById(\"nom\").focus();');\n $respuesta->script(\"cerrar();\");\n\t}\n return $respuesta;\n}", "public function actionAjaxListadoEmpleados(){\n\t\t$empleados = $this->getPersonaService()->listaPersonasPorCondicion(18);\n\n\t\tUtil::renderJSON($empleados);\n\t}", "public function ajaxCrearFichaControl()\t{\n\n\t\t/*=============================================\n\t\tALMACENANDO LOS DATOS EN LA BD\n\t\t=============================================*/\n\n\t\t$datos = array( \"id_establecimiento\"\t=> \"\", \n\t\t\t\t\t\t\"cod_establecimiento\"\t=> \"\", \n\t\t\t\t\t\t\"red_salud\" \t => \"\",\n\t\t\t\t\t\t\"id_departamento\" \t=> \"\",\n\t\t\t\t\t\t\"id_localidad\" \t\t=> \"\",\n\t\t\t\t\t\t\"fecha_notificacion\" => \"\",\n\t\t\t\t\t\t\"semana_epidemiologica\" => \"\",\n\t\t\t\t\t\t\"busqueda_activa\" \t=> \"\",\n\t\t\t\t\t\t\"nro_control\" \t\t \t=> \"\",\n\t\t\t\t\t\t\"paterno_notificador\" => $this->paterno_notificador,\n\t\t\t\t\t\t\"materno_notificador\" => $this->materno_notificador,\n\t\t\t\t\t\t\"nombre_notificador\" \t=> $this->nombre_notificador,\n\t\t\t\t\t\t\"cargo_notificador\" \t=> $this->cargo_notificador,\n\t\t\t\t\t\t\"tipo_ficha\" \t \t=> \"FICHA CONTROL Y SEGUIMIENTO\",\n\t\t\t\t\t\t);\t\n\n\t\t$respuesta = ControladorFichas::ctrCrearFicha($datos);\n\n\t\techo $respuesta;\n\n\t}", "function get_ajax_produk()\n\t{\n\t\t$list = $this->Produk_model->get_datatables();\n\t\t$data = array();\n\t\t$no = @$_POST['start'];\n\t\tforeach ($list as $item) {\n\t\t\t$no++;\n\t\t\t$row = array();\n\t\t\t$row[] = $no . \".\";\n\t\t\t$row[] = $item->kode_produk;\n\t\t\t$row[] = $item->nama_produk;\n\t\t\t$row[] = rupiah($item->harga_produk);\n\t\t\t// add html for aksi\n\t\t\t$row[] = '<div>\n\t\t\t\t<a class=\"btn btn-success btn-xs\" href=\"javascript:void(0)\" title=\"Edit\" onclick=\"edit_produk(' . \"'\" . $item->id_produk . \"'\" . ')\"><span class=\"fas fa-pencil-alt\"></span> Edit</a>\n\t\t\t\t<a class=\"btn btn-danger btn-xs\" href=\"javascript:void(0)\" title=\"Hapus\" onclick=\"delete_produk(' . \"'\" . $item->id_produk . \"'\" . ')\"><span class=\"fas fa-trash\"></span> Hapus</a>\n\t\t\t\t</div>';\n\n\t\t\t$data[] = $row;\n\t\t}\n\t\t$output = array(\n\t\t\t\"draw\" => @$_POST['draw'],\n\t\t\t\"recordsTotal\" => $this->Produk_model->count_all(),\n\t\t\t\"recordsFiltered\" => $this->Produk_model->count_filtered(),\n\t\t\t\"data\" => $data,\n\t\t);\n\t\t// output to json format\n\t\techo json_encode($output);\n\t}", "public function getSettingsAjax()\n {\n $formId = absint($_REQUEST['form_id']);\n wp_send_json_success(array(\n 'custom_css' => $this->getData($formId, '_custom_form_css'),\n 'custom_js' => $this->getData($formId, '_custom_form_js'),\n ), 200);\n }", "public function ajax_update_alamat()\n {\n $data['user_id'] = $this->user['id'];\n $update = $this->home->update_alamat($data);\n\n if($update){\n echo json_encode(array(\"response\" => 'SUKSES', 'act' => \"upd\"));\n }else{\n echo json_encode(array(\"response\" => 'GAGAL', 'act' => \"upd\"));\n }\n }", "function handleRequest(){\n\n check_ajax_referer( 'mvc-ajax' );\n \n $class = apply_filters( 'mvc_theme_ajax_handle_class', $this->getControllerObject( $_POST['controller'] ), $_POST );\n\n if( !$this->no_priv ){\n if( !isset( $class->ajax_allow ) || !in_array( $_POST['method'], $class->ajax_allow ) ){\n echo 'This method has not been added to the ajax_allow allowed list';\n exit();\n } \n }\n\n $data = $class->{$_POST['method']}($_POST['args']);\n \n if( !is_string( $data ) ){\n echo json_encode( $data );\n } else {\n echo $data;\n }\n exit(); \n }" ]
[ "0.75795424", "0.74617815", "0.73454183", "0.7271826", "0.7200468", "0.70974076", "0.70492023", "0.702892", "0.7021116", "0.70072687", "0.7004007", "0.69680905", "0.69569266", "0.69335335", "0.6930644", "0.6929063", "0.68486786", "0.6817128", "0.6781986", "0.6744803", "0.66974896", "0.6688375", "0.66695535", "0.6658511", "0.6651305", "0.6649479", "0.6628387", "0.6627476", "0.6608745", "0.65919375", "0.65837854", "0.65824986", "0.65791714", "0.6571559", "0.65713334", "0.65569556", "0.65503305", "0.655017", "0.6544104", "0.65332335", "0.6525364", "0.6501059", "0.6485585", "0.6484897", "0.6483067", "0.64778656", "0.6475342", "0.6474348", "0.6436153", "0.6433296", "0.6430492", "0.64243895", "0.6420346", "0.64151484", "0.6410253", "0.6397917", "0.6372206", "0.63671315", "0.63585013", "0.635822", "0.63550735", "0.634077", "0.6338575", "0.63238114", "0.6322179", "0.631494", "0.63089734", "0.6302352", "0.62975967", "0.6275138", "0.6274239", "0.62646824", "0.6263924", "0.6241992", "0.6240159", "0.62284905", "0.6226087", "0.6224792", "0.6219488", "0.621632", "0.62077326", "0.6200726", "0.6200325", "0.6196165", "0.6193212", "0.61895305", "0.61869246", "0.6185132", "0.61764395", "0.6173825", "0.6173633", "0.615796", "0.61494863", "0.6146743", "0.6146342", "0.6140304", "0.61303025", "0.6126848", "0.61223465", "0.6110486", "0.6109648" ]
0.0
-1
/ API REST para mostrar las ultimas entradas o posts
function novedadesAPI() { register_rest_route( 'ajar/v1', '/novedades/(?P<cantidad>\d+)', array( 'method' => 'GET', 'callback' => 'pedidoNovedades', )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index()\n {\n //get all post resource from the database\n $posts = PostResource::Collection(Post::paginate(10));\n return $this->apiResponse($posts);\n }", "public function index()\n {\n try {\n $items = Posts::ignoreRequest(['perpage'])->filter()\n ->orderByDesc('id');\n\n $items = $items->paginate(request()->get('perpage'),['*'],'page');\n $collection = collect(PostResource::collection($items));\n $items = collect($items);\n $items['data'] = $collection;\n $items['code'] = 200;\n $items['message'] = \"success\";\n $items->forget('first_page_url');\n $items->forget('last_page_url');\n $items->forget('next_page_url');\n $items->forget('prev_page_url');\n $items->forget('path');\n return response()->json($items, 200);\n } catch (\\Exception $e) {\n return response()->json(['data' => $e, 'message' => 'Error', 'code' => 500], 500);\n }\n }", "public function index()\n {\n $post = Post::all();\n \n return $this->sendResponse(PostResource::collection($post), 'Post retrieved successfully.');\n }", "public function index()\n {\n $posts = Post::all();\n return $this->sendResponse(PostResource::collection($posts), 'Posts retrieved successfully');\n }", "public function index()\n {\n $posts = Post::with('users');\n\n if (Auth::check()) {\n $client = Auth::user();\n \n if ($client->cannot('edit_article')) {\n $posts = $posts->where('status', '=', 'published');\n\n if ($client->can('view_pending')) {\n $posts = $posts->orWhere('status', '=', 'scheduled')\n ->orWhere('status', '=', 'pending');\n }\n\n if ($client->can('create_article')) {\n $posts = $posts->orWhereHas('users', function ($query) use ($client) {\n $query->where('id', '=', $client->id);\n });\n }\n\n $posts = $posts->orderBy('created_at', 'desc');\n }\n\n $posts = $posts->orderBy('published_at', 'desc')\n ->orderBy('updated_at', 'desc');\n }\n else {\n $posts = $posts->where('status', '=', 'published')\n ->orderBy('published_at', 'desc');\n }\n\n return $this->jsonResponse(\n PostResource::collection($posts->paginate(10))\n );\n }", "public function index() {\n $posts = Post::all();\n //devo passarli al json che li passerà alla rotta api che ho creato\n return response()->json($posts);\n }", "public function list()\n {\n $data = Post::all(); // 5= registros por pagina\n return response()->json($data, 200);\n }", "public function getPost ();", "public function actionList() {\n $models = Post::model()->findAll();\n $rows = array();\n foreach($models as $model) \n $rows[] = $model->attributes;\n\t\t$data_response = array(\n\t\t\t'error'=> array('status'=>200, 'message'=>''),\n\t\t\t'datas'=>$rows\n\t\t);\n $this->response($data_response);\n }", "public function index(){\n $posts = Post::orderBy('id', 'desc')->get();\n return PostResource::collection($posts);\n }", "public function index()\n {\n $posts = Post::with('comments')->orderBy('created_at','desc')\n ->where('privacy',1)\n ->get();\n return response()->json([\n 'data' => PostResource::collection($posts)\n ]);\n }", "public function index()\n {\n $posts = Post::with('user')->where('situacao', '=', 'pub')->exclude('conteudo')->get();\n\n return response()->json($posts);\n }", "public function index()\n {\n $data = TenantPostAdd::where('user_id','4')->paginate(10);\n $response = [\n 'pagination' => [\n 'total' => $data->total(),\n 'per_page' => $data->perPage(),\n 'current_page' => $data->currentPage(),\n 'last_page' => $data->lastPage(),\n 'from' => $data->firstItem(),\n 'to' => $data->lastItem()\n ],\n 'data' => $data\n ];\n return response()->json($response);\n }", "public function list_post()\n\t{\n\t\t$this->db->distinct();\n\t\t$this->db->select('scene_id,scene_name');\n\t\t$this->db->order_by('id', 'asc');\n\t\t//$res = $this->db->get('Scene_Activity');\n\n\t\t//echo $res;\n\t\t$res = $this->db->get('Scene_Activity')->result();\n\t\t$this->response($res, REST_Controller::HTTP_OK);\n\t}", "public function posts()\n {\n // $name = 'Dipu';\n // $age = 25;\n\n // return 'Name: '. $name . ' Age: ' . $age;\n\n // Objects\n // $user = new stdClass();\n // $user->name = 'dipu';\n // $user->age = 25;\n\n // print_r($user);\n\n //Multiple data /Array\n $post[] = \"\";\n $single_post = new stdClass();\n\n $single_post->name = 'Dipu';\n $single_post->age = 25;\n $single_post->gender = 'male';\n array_push($post, $single_post);\n\n $single_post = new stdClass();\n\n $single_post->name = 'Munna';\n $single_post->age = 20;\n $single_post->gender = 'male';\n array_push($post, $single_post);\n\n print_r($post);\n\n }", "public function index()\n {\n $post = Post::paginate(5);\n return postresource::collection($post);\n }", "public function index()\n {\n // $posts = \\App\\Models\\Post::all();\n // return $this->sendResponse(PostResource::collection($posts), 'Posts retrieved Successfully!' );\n \n $users= \\App\\Models\\User::with(relations:['Posts','Comments','Likes'])->get();\n return response()-> json(['status'=>true,'message'=>trans('admin.success'),'items'=>$users]); \n }", "public function index()\n {\n $posts = PostResource::collection(Post::orderByDesc('created_at')->whereIn('id', PostProfil::pluck('post_id')->all())->where('public', 0)->paginate(10));\n\n if ($posts) {\n return $posts;\n } else\n return response('No posts found', 440);\n }", "public function showApi()\n {\n return Post::All();\n }", "public function index()\n {\n $posts = Post::latest()->with('author')->paginate(5);\n $filtered = $posts->whereIn('audience', ['public']);\n return PostResource::collection($filtered);\n }", "public function index()\n {\n $posts = Post::all();\n if($posts) {\n foreach ($posts as $post) {\n $post->post_link = [\n 'href' => 'api/v1/post/' . $post->slug,\n 'method' => 'GET'\n ];\n }\n $response = $this->createResponse(false,$posts,'List of Posts',null);\n return response()->json($response, 200);\n }\n $response = $this->createResponse(true,null,'An error occurred',null);\n return response()->json($response, 501);\n }", "public function index()\n {\n $posts = post::all();\n\n return response()->json([\n 'error' => false,\n 'posts' => $posts\n ], 200);\n }", "public function testShouldReturnAllPosts(){\n $this->get(\"/api/v1/post\", []);\n $this->seeStatusCode(200);\n $this->seeJsonStructure([\n 'data' => ['*' =>\n [\n 'id_post',\n 'username',\n 'tanggal',\n 'caption'\n ]\n ]\n ]);\n }", "public function index()\n {\n try {\n if ($postWithTag = PostWithTag::get()) {\n return Response()->json([\n 'status' => 'ok',\n 'data' => PostWithTagResource::collection($postWithTag)\n ], 200);\n } else {\n return Response()->json([\n 'status' => 'no_content',\n 'data' => null\n ], 204);\n }\n } catch (Exception $e) {\n return Response()->json([\n 'status' => 'internal_server_error',\n 'data' => $e->getMessage(),\n ], 500);\n }\n }", "public function index()\n\t{\n\t\treturn Response::json(Post::get());\n\t}", "public function index()\n {\n $posts = Posts::all()->sortByDesc('updated_at');\n $response = [\n 'status' => '200',\n 'message' => 'Ok',\n 'data' => PostsResource::collection($posts)\n ];\n return response()->json($response, 200);\n }", "public function index()\n {\n // $posts = postModel::with('user')->paginate(4);\n // return response()->json(['posts' => $posts,'pagination' => (string)$posts->links()], 200);\n }", "public function getPosts() {}", "public function index()\n {\n $posts = Post::with(['user', 'tags'])->latest()->paginate(5);\n return response()->json($posts);\n }", "public function getPosts();", "public function getPosts();", "public function post_post()\n\t{\n\t\ttry {\n\t\t\t$results = Articles::regist( self::$_JSON );\n\t\t\t//\\Log::warning(print_r($results, true));\n\n\t\t\treturn $this->response($results, 200);\n\t\t} catch (\\MarcoPandaException $e) {\n\t\t\t$this->error($e);\n\t\t}\n\t}", "function index_post() {\n $this->crud_post($this->post());\n }", "public function indexApi()\n {\n return Post::orderBy('votes', 'DESC')->get();\n }", "public function index()\n {\n try{\n $units = Unit::paginate(env('API_POSTS_PER_PAGE') );\n return response()->json( $units);\n }catch (\\Exception $e) { return response()->json(['error' => 'Something went wrong. Could not fetch units','error code' => '500'], 500); } \n }", "public function index()\n {\n //$users = User::with('posts')->get();\n $posts = Post::select('*')\n // ->join('posts', 'posts.id', '=', 'users.id' )\n ->get();\n //$users = User::with('posts')->get();\n return response()->json([\n // 'users' => $users,\n 'posts' => $posts,\n 'message' => 'Users!'\n ], 201);\n }", "public function posts()\n\t{\n\t\t//To do : Blog Posts by Category, Author, tags\n\n\t\t$wheres = $this->checkInputData(array('category_id', 'id', 'author_id', 'tag'));\n\n\t\t$before_after = $this->checkInputData(array('after_id', 'before_id', 'since', 'until'));\n\n\t\t$limit = (Input::get('limit')) ?: 0;\n\n\t\t$offset = (Input::get('offset')) ?: 0;\n\n\t\tif (empty($wheres) and empty($before_after)) {\n\n\t\t\t$blog = Provider::allPublicPosts($limit, $offset);\n\n\t\t} else {\n\n\t\t\tif (!empty($wheres)) {\n\t\t\t\t$conditions['wheres'] = $wheres;\n\t\t\t}\n\n\t\t\tif (!empty($before_after)) {\n\t\t\t\t$conditions['before_after'] = $before_after;\n\t\t\t}\n\n\t\t\t$blog = Provider::getPostsBy($conditions, $limit, $offset);\n\n\t\t}\n\n\t\t$data = $this->transform($blog);\n\n\t\treturn Response::json(array(\n\t\t\t'total_items' => count($data),\n\t\t\t'type'\t\t => 'posts',\n\t\t\t'items'\t\t => $data\n\t\t));\n\n\t}", "public function index()\n {\n $posts = Post::with(['categories','createdBy','publishedBy'])->orderBy('id','desc')->get();\n return response()->json($posts);\n }", "public function index()\n {\n $post = Post::paginate(3);\n //$post->withPath('custom/url');\n return response()->json($post);\n }", "public function getPost() {\n //get json post list\n echo $this->model->getPost();\n }", "public function index()\n {\n return $this->post->all();\n }", "public function index_post(){\n\n // Comprobar que venga un objeto revista_author en la peticion\n if( !$this->post() ){\n $this->response( null, 400 );\n }\n\n $id = $this->rautor_model->save( $this->post() );\n\n // Comprobar que el id tiene informacion\n if( !is_null( $id ) ){\n $this->response( array( 'response' => \"True\" ), 200 );\n }\n\n else {\n $this->response( array('error' => \"Algo ha falldo en el servidor. No se pudo añadir revista-autor\" ), 400 );\n }\n }", "public function index()\n {\n return Post::latest()->paginate()->toJson();\n }", "public function index()\n {\n return Post::with('category:id,name,slug', 'user:id,name,email')\n ->select([\n 'id', 'title', 'slug', 'content', 'image', 'category_id', 'user_id'\n ])\n ->paginate(); // json_encode(Post::all());\n }", "public function index()\n {\n //\n $posts = Posts::all();\n\n return response($posts);\n }", "public function index()\n {\n $posts = Post::orderBy('updated_at', 'DESC')->get();\n return response()->json(['posts'=>$posts]);\n }", "public function action_index()\n\t{\n\t\t$svc = MMI_API::factory(MMI_API::SERVICE_DELICIOUS);\n\t\tif ( ! $svc->is_valid_token(NULL, TRUE))\n\t\t{\n\t\t\tdie(HTML::anchor($svc->get_auth_redirect(), $svc->service().' authorization required'));\n\t\t}\n//\t\t$response = $svc->get('posts/recent');\n\n\t\t$requests = array\n\t\t(\n\t\t\t'posts/recent' => array('url' => 'posts/recent'),\n\t\t\t'posts/dates' => array('url' => 'posts/dates'),\n\t\t);\n\t\t$response = $svc->mget($requests);\n\t\t$this->_set_response($response, $svc->service());\n\t}", "public function index()\n {\n\n $posts = Post::latest()\n ->paginate(20);\n\n return PostResource::collection($posts);\n }", "public function index()\n {\n $posts = Post::with( ['category', 'user'] )->latest()->get();\n\n return response()->json( [\n 'posts' => $posts,\n ], 200 );\n }", "public function index()\n {\n return Response::json(['posts' => Post::all()]);\n }", "public function post();", "public function post();", "public function post();", "public function index()\n {\n try {\n $responses =Post::with(['user','comments','views'])->get();\n return response()->json(['status' => 1, 'data' => $responses], 200);\n } catch (\\Throwable $th) {\n return response()->json(['status' => 0, 'error' => $th->getMessage()], 200);\n }\n }", "public function index()\n {\n // get from cache if exist\n $posts = Cache::rememberForever('posts', function () {\n return Post::orderBy('created_at', 'desc')->get();\n });\n\n return $this->responseJson('success', $posts);\n }", "public function post()\n {\n $postId = $this->request->getParameter(\"id\"); /* le parametre disparait lors de l'annonce de \"public function post($postId)\". On l'annonce\n du coup en début de la méthode en faisant appel à la méthode getParameter de la class Request */\n $post = $this->post->getPost($postId); // va chercher la méthode GetPost($postId) dans le Model Post.php l.33\n $this->buildView(array('post' => $post));\n }", "public function index() {\n\t\t$data['posts'] = $this->post->getLast();\n\t\t$this->set($data);\n\t}", "public function index()\n {\n $comments = Comment::orderBy('updated_at', 'desc')->get();\n $comments->filter->user;\n $comments->filter->post;\n //return PostResource::collection($comments);\n return response()->json([\n 'comments' => $comments,\n ], 200);\n }", "public function index()\n {\n //\n $posts = Post::latest()->with('user')->paginate(1);\n foreach($posts as $post){\n $post->setAttribute('added_at',$post->created_at->diffForHumans());\n $post->setAttribute('comments_count',$post->comments->count());\n }\n return response()->json($posts);\n }", "public function index()\n {\n // $data = User::with(['posts','comments'])\n // ->where('id',\\Auth::user()->id)\n // ->first();\n // return $data->posts;\n return Post::with('posteable')->get();\n }", "protected function restBlogsPostsGetRequest()\n {\n\n $resourcePath = '/rest/blogs/posts';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'GET',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function index() {\n\n $posts = null;\n\n if ($this->request->is('post')) {\n\n $this->Post->create();\n\n $searchField = $this->request->data['lstField'];\n $searchValue = $this->request->data['searchValue'];\n\n if (!empty($searchField) && !empty($searchValue)) {\n $posts = $this->Post->search($searchField, $searchValue);\n $this->set('posts', $posts);\n }\n } else {\n $posts = $this->Post->viewPosts();\n }\n\n $this->set('posts', $posts);\n }", "public function index()\n {\n //\n $post = Post::query()->with(['categories' => function($CategoryQuery){\n $CategoryQuery;\n }])->paginate(10);\n\n return response()->json($post);\n }", "public function listsgenericpost()\r\n {\r\n $input = Request::all();\r\n $new_generic = Generic::create($input);\r\n if($new_generic){\r\n return response()->json(['msg' => 'Created new generic']);\r\n }else{\r\n return response('Oops, seemes like something went wrong while trying to create a new generic');\r\n }\r\n }", "public function actionPost() {\n\t\t// Inisialisasi\n\t\t$id = $this->request->get('id');\n\t\t$this->data->set('parseCode', true);\n\n\t\t// Cek ACL\n\t\tif ($this->acl->isAllowed(Acl::WRITE, $id)) $this->data->set('allowWriteArticle', true);\n\t\tif ($this->acl->isAllowed(Acl::EDIT, $id)) $this->data->set('allowEditor', true);\n\n\t\tif ($this->data->get('getData[new]','false',true) == 'true') {\n\t\t\t$this->data->set('allowEditor', true);\n\t\t\t$isList = true;\n\t\t\t$editorTitle = 'Buat Post';\n\t\t\t$editor = ModelBase::buildEditor('/provider/post','Masukkan judul tulisan','/community/post');\n\t\t\t$data = ModelBase::factory('Template')->getComPostData(compact('isList', 'editorTitle', 'editor'));\n\t\t} elseif (empty($id)) {\n\t\t\t// Inisialisasi post section\n\t\t\t$isList = true;\n\t\t\t$listTitle = 'Semua Post';\n\t\t\t$page = $this->data->get('getData[page]',1,true);\n\t\t\t$query = $this->data->get('getData[query]','',true);\n\t\t\t$filter = array();\n\n\t\t\tif ($_POST && isset($_POST['query'])) {\n\t\t\t\t$query = $_POST['query'];\n\n\t\t\t\t// Reset page\n\t\t\t\t$page = 1;\n\t\t\t}\n\n\t\t\tif ( ! empty($query)) {\n\t\t\t\t$listTitle = 'Pencarian \"'.$query.'\"';\n\n\t\t\t\t$filter = array(\n\t\t\t\t\tarray('column' => 'Title', 'value' => '%'.$query.'%', 'chainOrStatement' => TRUE),\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$searchQuery = $query;\n\n\t\t\t$posts = ModelBase::factory('Node')->getAllpost(7, $page, $filter);\n\n\t\t\t// Tambahkan filter post\n\t\t\t$filter[] = array('column' => 'Type', 'value' => 'post');\n\t\t\t$pagination = ModelBase::buildPagination($posts,'PhpidNodeQuery', $filter, $page, 10);\n\n\t\t\t$data = ModelBase::factory('Template')->getComPostData(compact('isList','posts','listTitle','listPage','pagination','searchQuery'));\n\t\t} else {\n\t\t\t// Detail post\n\t\t\t$isList = false;\n\n\t\t\t$post = ModelBase::factory('Node')->getPost($id,true);\n\n\t\t\tif ( ! $post->get('Nid')) {\n\t\t\t\tthrow new \\RuntimeException('Post tidak dapat ditemukan');\n\t\t\t}\n\n\t\t\t// Ambil comments data\n\t\t\t$comments = $post->get('comments') instanceof \\PropelObjectCollection ? $post->get('comments')->toArray() : array();\n\t\t\t$title = strip_tags($post->get('previewText'));\n\t\t\t$posts = ModelBase::factory('Node')->getAllpost(5);\n\n\t\t\t$data = ModelBase::factory('Template')->getComPostData(compact('title','isList','posts', 'post','comments'));\n\t\t}\n\n\t\t// Template configuration\n\t\t$this->layout = 'modules/community/post.tpl';\n\n\t\t// Render\n\t\treturn $this->render($data);\n\t}", "public function index()\n {\n $posts = Posts::all();\n return response($posts, 200);\n }", "public function getPost(): array;", "public function index() {\n\n\t\treturn [\n\t\t\t\"code\"\t\t=>\t200,\n\t\t\t\"data\"\t\t=>\tPost::orderBy('id', 'DESC')->get(),\n\t\t\t\"message\"\t=>\t\"Successful operation.\",\n\t\t\t\"status\"\t=>\t\"success\",\n\t\t];\n\t}", "public function index_post()\n\t {\n\t \t\t$user= [\n\t \t\t\t'us_type'=>$this->post('post_type'),\n\t \t\t\t'id_user'=>$this->post('post_id'),\n \t'us' => $this->post('post_us'),\n\t 'email'=> $this->post('post_email'),\n\t 'born'=> $this->post('post_born'),\n\t 'status'=> $this->post('post_status'),\n\t 'pass'=> $this->post('post_pass'),\n \t];\n \t$us=$this->User_Model->add_user($user);\n \tif ($us) {\n \t\t$this->response(array(\"code\" =>200, \"response\"=>\"Se agrego el usuario\"+$user->us));\n \t} else {\n \t\t$this->response(array(\"code\" =>204, \"response\"=>\"NO se agrego el usuario\"+$user->us));\n \t}\n\t }", "public function showRequestPost();", "protected function restBlogsPostPostRequest()\n {\n\n $resourcePath = '/rest/blogs/post';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n\n // body params\n $_tempBody = null;\n\n if ($multipart) {\n $headers = $this->headerSelector->selectHeadersForMultipart(\n ['*/*']\n );\n } else {\n $headers = $this->headerSelector->selectHeaders(\n ['*/*'],\n []\n );\n }\n\n // for model (json/xml)\n if (isset($_tempBody)) {\n // $_tempBody is the method argument, if present\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($_tempBody));\n } else {\n $httpBody = $_tempBody;\n }\n } elseif (count($formParams) > 0) {\n if ($multipart) {\n $multipartContents = [];\n foreach ($formParams as $formParamName => $formParamValue) {\n $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue];\n foreach ($formParamValueItems as $formParamValueItem) {\n $multipartContents[] = [\n 'name' => $formParamName,\n 'contents' => $formParamValueItem\n ];\n }\n }\n // for HTTP post (form)\n $httpBody = new MultipartStream($multipartContents);\n\n } elseif ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode($formParams);\n\n } else {\n // for HTTP post (form)\n $httpBody = \\GuzzleHttp\\Psr7\\build_query($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if ($this->config->getAccessToken() !== null) {\n $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken();\n }\n\n $defaultHeaders = [];\n if ($this->config->getUserAgent()) {\n $defaultHeaders['User-Agent'] = $this->config->getUserAgent();\n }\n\n $headers = array_merge(\n $defaultHeaders,\n $headerParams,\n $headers\n );\n\n $query = \\GuzzleHttp\\Psr7\\build_query($queryParams);\n return new Request(\n 'POST',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function encuentros_post()\n {\n $this->Encuentro->Evento_Id = $this->post('Evento_Id');\n $this->Encuentro->Ronda = $this->post('Ronda');\n $this->Encuentro->Lugar = $this->post('Lugar');\n $this->Encuentro->Partes = $this->post('Partes');\n $this->Encuentro->Duracion = $this->post('Duracion');\n $this->Encuentro->Estado = 0;\n $this->Encuentro->Fecha = $this->post('Fecha');\n $this->Encuentro->Hora = $this->post('Hora');\n $this->Encuentro->FechaInicio = $this->post('Fecha');\n $this->Encuentro->HoraInicio = $this->post('Hora');\n $this->Encuentro->TiempoTranscurrido = $this->post('Hora');\n\n $status = REST_Controller::HTTP_CREATED; // CREATED (201) HTTP response code\n if ($this->Encuentro->insert())\n {\n $msg =sprintf('Encuentro %s creado con exito', $this->Encuentro->Id);\n $message = [\n 'status' => FALSE,\n 'message' => $msg\n ];\n }\n else\n {\n $msg = sprintf('Error al insertar el Encuentro %s', $this->Encuentro->Id);\n $message = [\n 'status' => TRUE,\n 'message' => $msg\n ];\n $status = REST_Controller::HTTP_BAD_REQUEST; // BAD_REQUEST (400) HTTP response code\n }\n $this->set_response($message, $status);\n }", "public function index()\n {\n $posts = Post::included()->filter()->sort()->getOrPaginate();\n // return $categories;\n return PostResource::collection($posts); //Para una o varias respuestas\n }", "public function index(Request $request)\n {\n // $posts = $this->postsRepo->getAll()->map(function($post) use($situazione){\n // aggiungia situazione a post->impostaSitauzione()\n // });\n\n\n // return new PostsCollection($this->postsRepo->getAll()); // effetivamente una risorsa\n // return new PostResource($this->postsRepo->show($post)); --> singola risorsa\n return PostResource::collection($this->postsRepo->getAll()); // --> collection di singole rirsose\n }", "public function index()\n {\n $posts = Post::all();\n\n return response()->json(['data' => $posts]);\n }", "public function postsActionGet() : object\n {\n $page = $this->app->page;\n $title = \"Alla inlägg\";\n $db = $this->app->db;\n\n $db->connect();\n $sql = \"SELECT * FROM content;\";\n $resultset = $db->executeFetchAll($sql);\n\n $page->add(\"cms/header\");\n $page->add(\"cms/posts\", [\n \"resultset\" => $resultset\n ]);\n return $page->render([\n \"title\" => $title\n ]);\n }", "public function getPostes() {\n $id = $_GET['poste_id'];\n $poste = Poste::where('id',$id)->get();\n\n return json_encode($poste);\n }", "public function index(Request $request)\n {\n $paginate = $request->per_page;\n return PostResource::collection(Post::query()->orderBy('title')->paginate($paginate));\n \n }", "public function fetch_post(Request $request)\n {\n\n $fetch_post = Post::find($request->id);\n return $this->responsejson(true , 'success' , $fetch_post);\n\n }", "public function index() {\n $data = $this->Post->find('all');\n $this->set('data', $data);\n }", "public function index()\n {\n $posts = QueryBuilder::for(Post::class)\n ->allowedIncludes(['comments'])\n ->get();\n\n return PostGetResource::collection($posts);\n }", "public function provideAction(){\n if($this->request->hasArgument('post')){\n $post = $this->postRepository->findByUid($this->request->getArgument('post'));\n if($post){\n $array['uid'] = $this->request->getArgument('post');\n $array['content'] = $post->getContent();\n $array['crdate'] = $post->getCrdate();\n $array['owner'] = $post->getOwner();\n $this->view->assign('dataJson',json_encode($array));\n }\n else{\n $this->view->assign('dataJson',json_encode(['content' => '<div class=\"alert alert-warning\">Post ('.$this->request->getArgument('post').') is not accessible or could not be loaded!</div>']));\n }\n }\n else{\n $this->view->assign('dataJson',json_encode(['content' => '<div class=\"alert alert-danger\">No post ID given!</div>']));\n }\n }", "public function index()\n {\n $author_id = '1';\n\n $posts = DB::table('posts')\n ->select('id as post_id','title as post_title', 'body as post_body', 'user_id as author_id', 'total_comments as total_number_of_comments')\n ->where('user_id', '=', $author_id)\n ->orderBy('total_comments', 'desc')\n ->get();\n\n return response()->json($posts, 200, [], \\JSON_PRETTY_PRINT);\n }", "public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n $posts = $this->repository->news();\n\n if (request()->wantsJson()) {\n\n return response()->json([\n 'data' => $posts,\n ]);\n }\n\n return view('front.posts.index', compact('posts'));\n }", "public function postAction()\n {\n $manager = new \\Art4\\JsonApiClient\\Utils\\Manager();\n $manager->setConfig('optional_item_id', true);\n // @todo handle validation errors\n $document = $manager->parse($this->request->getRawBody());\n $resource = $this->resource->getModel();\n\n // basic attributes\n foreach ($document->get('data')->get('attributes')->asArray(true) as $key => $value) {\n $resource->{$key} = $value;\n }\n\n // @todo handle saving errors\n $resource->save();\n\n return $this->renderSerialized($resource);\n }", "function index()\n {\n $perPage = 1;\n $this->lordModel('Post');\n $condition = array('online' => 1, 'type' => 'post');\n $d['posts'] = $this->Post->find(array(\n 'condition' => $condition,\n 'limit' => ($perPage * ($this->request->page - 1)) . ',' . $perPage\n ));\n $d['total'] = $this->Post->findCount($condition);\n if (empty($d['posts'])) {\n $this->e404('page introuvable');\n }\n $d['nbrPage'] = ceil($d['total'] / $perPage);\n //print_r($d);\n $this->setvars($d);\n //$this->setvars('phrase', 'bienvenue sur ma page');\n //$this->render('view');\n }", "public function listAction()\n {\n $this->denyAccessUnlessGranted('POST_LIST');\n\n $source = new Entity($this->get('opifer.form.post_manager')->getClass());\n\n $formColumn = new TextColumn(['id' => 'posts', 'title' => 'Form', 'source' => false, 'filterable' => false, 'sortable' => false, 'safe' => false]);\n $formColumn->manipulateRenderCell(function ($value, $row, $router) {\n return '<a href=\"'.$this->generateUrl('opifer_form_form_edit', ['id'=> $row->getEntity()->getForm()->getId()]).'\">'.$row->getEntity()->getForm()->getName().'</a>';\n });\n\n $viewAction = new RowAction('view', 'opifer_form_post_view');\n $viewAction->setRouteParameters(['id']);\n\n $deleteAction = new RowAction('delete', 'opifer_form_post_delete');\n $deleteAction->setRouteParameters(['id']);\n\n $grid = $this->get('grid');\n $grid->setId('posts')\n ->setSource($source)\n ->setDefaultOrder('id', 'desc')\n ->addColumn($formColumn, 2)\n ->addRowAction($viewAction)\n ->addRowAction($deleteAction);\n\n return $grid->getGridResponse('@OpiferCms/Backend/Post/list.html.twig');\n }", "public function index()\n {\n $posts = Post::where('user_id', Auth::id())->orderBy('id', 'DESC')->get();\n dd($posts);\n }", "public function index()\n {\n $posts = Post::with( 'user', 'category' )->latest()->get();\n\n return response()->json( [\n 'posts' => $posts,\n ], 200 );\n }", "public function index()\n {\n return new PostoResource(Posto::paginate());\n }", "public function index()\n {\n //$articles = Articles::all(); //get all the articles\n //get a list of articles by pagination\n $articles = Articles::take(20)->paginate(10);\n return ArticlesApiResource::collection($articles);\n }", "public function get_posts() {\n $posts = self::get_rendered_posts();\n $json_data = json_encode($posts);\n header( 'Content-Type: application/json' );\n echo $json_data;\n }", "public function index()\n {\n return Post::where('user_id', auth()->id())->get();\n }", "public function posts(): AdminApi\n {\n return $this->setResource(Post::class);\n }", "public function post($post);", "public function index()\n {\n $AllPosts = Post::with('User', 'Spot')->orderBy('like_count', 'desc')->get();\n\n return response()->json($AllPosts);\n }", "public function index()\n {\n return Post::all();\n\n }", "public function actionAddPost()\n {\n return Post::addPost(self::jsonDecoder());\n //return self::jsonDecoder()[0];\n }", "public function posts()\n {\n session_start();\n $posts = new PostManager;\n $resultat = $posts->getPosts(100);\n echo $this->getRender()->render('listPostsView.twig', [\n 'posts' => $resultat,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }", "function getAllPostings() {\n return getAll(\"select * from posting\");\n}", "public function api_entry_list() {\n $data = $this->Mdl_Users->get_list(\n $_POST['rp'],\n $_POST['page'],\n $_POST['query'],\n $_POST['qtype'],\n $_POST['sortname'],\n $_POST['sortorder']);\n\n echo json_encode(array(\n 'page'=>$_POST['page'],\n 'total'=>$this->Mdl_Users->get_length(),\n 'rows'=>$data,\n ));\n }" ]
[ "0.69057626", "0.68020386", "0.6730842", "0.6632398", "0.6619964", "0.6606061", "0.65822464", "0.65781224", "0.6567628", "0.6542438", "0.6464589", "0.6451413", "0.64450467", "0.6412039", "0.6411232", "0.6408458", "0.63985074", "0.6393059", "0.6371362", "0.6352216", "0.63511527", "0.63499135", "0.63391024", "0.6336066", "0.6316635", "0.6309468", "0.6295524", "0.62875414", "0.6266347", "0.6249325", "0.6249325", "0.6249188", "0.6245015", "0.6232228", "0.62236077", "0.62136215", "0.61932147", "0.6186041", "0.6172435", "0.61518276", "0.61455375", "0.6144681", "0.6127636", "0.6124908", "0.61244226", "0.6117859", "0.6117815", "0.61064583", "0.6100272", "0.6100023", "0.6094664", "0.6094664", "0.6094664", "0.6094335", "0.6090808", "0.60904926", "0.60860914", "0.6085728", "0.608001", "0.6051494", "0.6049825", "0.603113", "0.60304445", "0.60191065", "0.6016698", "0.60046965", "0.59958833", "0.5989896", "0.5979863", "0.59795284", "0.59753656", "0.5970621", "0.5955966", "0.5953607", "0.5944321", "0.5940718", "0.59381664", "0.5905479", "0.5901118", "0.5897861", "0.58960176", "0.5893852", "0.5875399", "0.5863065", "0.58610505", "0.5855032", "0.5849884", "0.5848822", "0.5848167", "0.5843879", "0.5842708", "0.58398396", "0.5826136", "0.58257425", "0.5814788", "0.5812476", "0.58090806", "0.5808981", "0.58067197", "0.5806498", "0.5806268" ]
0.0
-1
/ Registro de bloques de reack
function ajarRegisterBlock() { //Archivo php generado del builds $assets = include_once get_template_directory().'/blocks/build/index.asset.php'; wp_register_script( 'ajar-block', // handle del script get_template_directory_uri().'/blocks/build/index.js', //url del directorio $assets['dependencies'], //all dep $assets['version'] // cada build cambia la version, para evitaas conflictos de cache ); register_block_type( 'ajar/basic', array( 'editor_script' => 'ajar-block', //copiar el script ya registrado 'attributes' => array( //repetimos los attr del block de index.js 'content' => array( 'type' => "string", 'default' => 'Hello World' ), 'mediaURL' => array( "type" => 'string' ), 'mediaAlt' => array( "type" => 'string' ), ), 'render_callback' => 'ajarRenderDinamycBlock' //funcion para generar el SSR(server side render) ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function Queues();", "function ArmarBloque($data,$id){\n \n $datos = array(); //creamos un array\n//bien ll\n \n for($i=1;isset($_POST[\"datoL\".$i]);$i++){\n\n $datoL=$_POST['datoL'.$i];\n $datoR=$_POST['datoR'.$i];\n $datos[] = array($datoL=>$datoR); \n }\n \n $json_string = json_encode($datos);\n//bien\n $file = 'datos.json';\n file_put_contents($file, $json_string); \n $Block = array();\n $datos=file_get_contents($data);\n /*$Block = 'id'=>\"{\".$id.\"}\",'data'=>(json_decode($datos));\n $json_string = json_encode($Block);\n $eliminado=str_replace(\"[\",\"\",$json_string);\n $eliminado=str_replace(\"]\",\"\",$eliminado);\n $eliminado=substr($eliminado,1);\n $eliminado=substr($eliminado,0,-1);*/\n \n $extra = json_encode($datos);\n $extra= str_replace(\"[\",\"\",$extra);\n $extra= str_replace(\"]\",\"\",$extra);\n $extra= str_replace(\"},{\", \",\", $extra);\n \n $bloque='{\"id\":\"'.$id.'\",\"data\":'. $extra .'}';\n \n \n $url = 'http://localhost:3001/mineBlock';\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $bloque);\n $output = curl_exec($ch);\n \n \n $bloques='{\"to\":\"/topics/news\",\"notification\":{\"body\":\"mensaje\",\"title\":\"mensajote\"}, data\" : {\"id\":\"'.$id.'\",\"secret\":\"'.$output[0].'\", \"name\":\"Hospital 12\"}}';\n $urls = 'https://fcm.googleapis.com/fcm/send';\n $chs = curl_init();\n curl_setopt($chs, CURLOPT_URL, $urls);\n curl_setopt($chs, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($chs, CURLOPT_POST, true);\n curl_setopt($chs, CURLOPT_HTTPHEADER, array('Content-type: application/json','Authorization: key=AIzaSyA9tIjPIgI3MGlsI9bKLRlfNIUF9rDfRXA'));\n curl_setopt($chs, CURLOPT_POSTFIELDS, $bloques);\n $outputs = curl_exec($chs);\n \n file_put_contents(\"log.txt\", var_dump($outputs));\n \n // $bloque=$eliminado;\n \n $BlockFile='Block.json';\n file_put_contents($BlockFile, $bloque); \n \n}", "function\tbuche() {\n\t\tFDbg::dumpL( 0x00000100, \"AbKorr.php::AbKorrPosten::buche(): begin\") ;\n\t\t$this->_buche( 1) ;\n\t\tFDbg::dumpL( 0x00000100, \"AbKorr.php::AbKorrPosten::buche(): end\") ;\n\t}", "function bloqueosCambiar(){\n global $tsCore, $tsUser;\n //\n $auser = $tsCore->setSecure($_POST['user']);\n $bloquear = empty($_POST['bloquear']) ? 0 : 1;\n // EXISTE?\n $exists = $tsUser->getUserName($auser);\n // SI EXISTE Y NO SOY YO\n if($exists && $tsUser->uid != $auser){\n if($bloquear == 1){\n // YA BLOQUEADO?\n $query = $this->select(\"u_bloqueos\",\"bid\",\"b_user = {$tsUser->uid} AND b_auser = {$auser}\",\"\",1);\n $noexists = $this->num_rows($query);\n $this->free($query);\n // NO HA SIDO BLOQUEADO\n if(empty($noexists)) {\n if($this->insert(\"u_bloqueos\",\"b_user, b_auser\",\"{$tsUser->uid}, {$auser}\"))\n return \"1: El usuario fue bloqueado satisfactoriamente.\"; \n } else return '0: Ya has bloqueado a este usuario.';\n // \n } else{\n if($this->delete(\"u_bloqueos\",\"b_user = {$tsUser->uid} AND b_auser = {$auser}\"))\n return \"1: El usuario fue desbloqueado satisfactoriamente.\";\n } \n } else return '0: El usuario seleccionado no existe.';\n }", "function Bloquer($bloqueur,$bloque){\r\n\t\t$conn = mysqli_connect(\"localhost\", \"root\", \"\", \"bddfinale\");\r\n\t\t$requete = \"INSERT INTO blocage VALUES(NULL,'$bloqueur','$bloque')\";\r\n\t\t$ligne= mysqli_query($conn, $requete);\r\n\t\tmysqli_close($conn);\r\n\t\t}", "private function _putBans()\r\n\t{\r\n\t\t$ban_file_name = md5($this->CI->config->config['encryption_key'].$this->ban_file);\r\n\t\t\r\n\t\t// Get group object from DB\r\n\t\t$bans = $this->db->get_where('bans', array('type' => 'user'));\r\n\t\tforeach($bans->result() as $ban)\r\n\t\t{\r\n\t\t\t$this->ban_list[$ban->ip] = array('ip' => $ban->ip, 'time' => $ban->time, 'type' => 'user');\r\n\t\t}\r\n\t\t\r\n\t\t// Save the group object to cache for increased performance\r\n\t\tfile_put_contents(CACHEPATH . $ban_file_name, base64_encode(serialize($this->ban_list)));\r\n\t}", "public function add_data_to_tombstone(){\n }", "public function ajaxDescargarEscribanos(){\n\n #DESCARGAR ESCRIBANOS DEL ENLACE\n $item = null;\n $valor = null;\n \n $escribanos = ControladorEnlace::ctrMostrarEscribanosEnlace($item,$valor);\n \n #ELIMINAR LOS ESCRIBANOS DE LOCALHOST\n ControladorEnlace::ctrEliminarEnlace('escribanos');\n\n foreach ($escribanos as $key => $value) {\n\n $tabla = \"escribanos\";\n $datos =array(\"id\"=>$value[\"id\"],\n \"nombre\"=>strtoupper($value[\"nombre\"]),\n \"documento\"=>$value[\"documento\"],\n \"id_tipo_iva\"=>$value[\"id_tipo_iva\"],\n \"tipo\"=>$value[\"tipo\"],\n \"facturacion\"=>$value[\"facturacion\"],\n \"tipo_factura\"=>$value[\"tipo_factura\"],\n \"cuit\"=>$value[\"cuit\"],\n \"direccion\"=>strtoupper($value[\"direccion\"]),\n \"localidad\"=>strtoupper($value[\"localidad\"]),\n \"telefono\"=>$value[\"telefono\"],\n \"email\"=>strtoupper($value[\"email\"]),\n \"id_categoria\"=>$value[\"id_categoria\"],\n \"id_escribano_relacionado\"=>$value[\"id_escribano_relacionado\"],\n \"id_osde\"=>$value[\"id_osde\"],\n \"ultimolibrocomprado\"=>strtoupper($value[\"ultimolibrocomprado\"]),\n \"ultimolibrodevuelto\"=>strtoupper($value[\"ultimolibrodevuelto\"]),\n \"inhabilitado\"=>$value[\"inhabilitado\"]);\n #registramos los productos\n $respuesta = ModeloEnlace::mdlIngresarEscribano($tabla, $datos);\n\t }\n echo count($escribanos);\n $datos = array(\"nombre\"=>\"escribanos\",\"fecha\"=>date(\"Y-m-d\"));\n $respuesta=ControladorModificaciones::ctrMostrarModificaciones($datos);\n \n \n if (empty($respuesta)){\n\n ControladorModificaciones::ctrIngresarModificaciones($datos); \n }\n \n }", "function commandes_bank_traiter_reglement($flux){\r\n\t// Si on est dans le bon cas d'un paiement de commande et qu'il y a un id_commande et que la commande existe toujours\r\n\tif (\r\n\t\t$id_transaction = $flux['args']['id_transaction']\r\n\t\tand $transaction = sql_fetsel(\"*\",\"spip_transactions\",\"id_transaction=\".intval($id_transaction))\r\n\t\tand $id_commande = $transaction['id_commande']\r\n\t\tand $commande = sql_fetsel('id_commande, statut, id_auteur, echeances, reference', 'spip_commandes', 'id_commande='.intval($id_commande))\r\n\t){\r\n\t\t$statut_commande = $commande['statut'];\r\n\t\t$montant_regle = $transaction['montant_regle'];\r\n\t\t$transaction_mode = $transaction['mode'];\r\n\t\t$statut_nouveau = 'paye';\r\n\r\n\r\n\t\t// Si la commande n'a pas d'échéance, le montant attendu est celui du prix de la commande\r\n\t\tinclude_spip('inc/commandes_echeances');\r\n\t\tif (!$commande['echeances']\r\n\t\t\tor !$echeances = unserialize($commande['echeances'])\r\n\t\t or !$desc = commandes_trouver_prochaine_echeance_desc($id_commande, $echeances, true)\r\n\t\t or !isset($desc['montant'])) {\r\n\t\t\t$fonction_prix = charger_fonction('prix', 'inc/');\r\n\t\t\t$montant_attendu = $fonction_prix('commande', $id_commande);\r\n\t\t}\r\n\t\t// Sinon le montant attendu est celui de la prochaine échéance (en ignorant la dernière transaction OK que justement on cherche à tester)\r\n\t\telse {\r\n\t\t\t$montant_attendu = $desc['montant'];\r\n\t\t}\r\n\t\tspip_log(\"commande #$id_commande attendu:$montant_attendu regle:$montant_regle\", 'commandes');\r\n\r\n\t\t// Si le plugin n'était pas déjà en payé et qu'on a pas assez payé\r\n\t\t// (si le plugin était déjà en payé, ce sont possiblement des renouvellements)\r\n\t\tif (\r\n\t\t\t$statut_commande != 'paye'\r\n\t\t\tand (floatval($montant_attendu) - floatval($montant_regle)) >= 0.01\r\n\t\t){\r\n\t\t\t$statut_nouveau = 'partiel';\r\n\t\t}\r\n\t\t\r\n\t\t// S'il y a bien un statut à changer\r\n\t\tif ($statut_nouveau !== $statut_commande){\r\n\t\t\tspip_log(\"commandes_bank_traiter_reglement marquer la commande #$id_commande statut: $statut_commande -> $statut_nouveau mode=$transaction_mode\",'commandes');\r\n\t\t\t// On met a jour la commande\r\n\t\t\tinclude_spip(\"action/editer_commande\");\r\n\t\t\tcommande_modifier($id_commande, array('statut'=>$statut_nouveau, 'mode'=>$transaction_mode));\r\n\t\t}\r\n\r\n\t\t// un message gentil pour l'utilisateur qui vient de payer, on lui rappelle son numero de commande\r\n\t\t$flux['data'] .= \"<br />\"._T('commandes:merci_de_votre_commande_paiement',array('reference'=>$commande['reference']));\r\n\t}\r\n\r\n\treturn $flux;\r\n}", "private function criarBarraDeBuscaAction(){\n $cidades = $this->Localidades()->getCidades(\"RJ\");\n $busca = new form_busca();//1- primeiro eu instancio o formularioarray('selecione'=>'selecione','nome' => 'nome','cidade' => 'cidade')\n $busca->get('cidade')->setAttribute('options',$cidades);\n $busca->get('bairro')->setAttribute('options', array(0=>'Selecione uma Cidade'));\n //\n $categoriaDao = \\Base\\Model\\daoFactory::factory('SubCategoriaImovel');\n $dadosCategoria = $categoriaDao->recuperarTodos();\n $categorias = $this->SelectHelper()->getArrayData(\"selecione\",$dadosCategoria);\n $busca->get('tipo')->setAttribute('options', $categorias);\n //\n $transacaoDao = \\Base\\Model\\daoFactory::factory('TipoTransacao');\n $dadosTransacoes = $transacaoDao->recuperarTodos();\n $transacoes = $this->SelectHelper()->getArrayData(\"selecione\",$dadosTransacoes);\n $busca->get('transacao')->setAttribute('options', $transacoes);\n //\n $arrayPreco = array(array(\"value\"=>0, \"label\"=>\"selecione\", \"disabled\" => \"disabled\", \"selected\" => \"selected\"),array(\"value\" => 1, \"label\" => \"R$ 100.000 a R$ 200.000\"),array(\"value\" => 2, \"label\" => \"R$ 200.000 a R$ 300.000\"),array(\"value\" => 3, \"label\" => \"R$ 300.000 a R$ 400.000\"),array(\"value\" => 4, \"label\" => \"R$ 400.000 a R$ 500.000\"),array(\"value\" => 5, \"label\" => \"acima de R$ 500.000\"));\n $busca->get('valor')->setAttribute('options', $arrayPreco);\n return $busca;\n }", "function buscar($datos, $idSubcategoria) {\n global $textos, $sql, $configuracion, $sesion_usuarioSesion;\n\n $objeto = new BulletinBoardItem();\n $destino = '/ajax'.$objeto->urlBase.'/search';\n\n if (empty($datos)) {\n\n $forma2 = HTML::campoOculto('datos[criterio]', 'titulo');\n $forma2 .= HTML::campoOculto('procesar', true);\n $forma2 .= HTML::campoOculto('datos[id_subcategoria]', $idSubcategoria);\n $forma2 .= HTML::parrafo($textos->id('TITULO'), 'negrilla margenSuperior');\n $forma2 .= HTML::parrafo(HTML::campoTexto('datos[patron]', 30, 255).HTML::boton('buscar', $textos->id('BUSCAR')), 'margenSuperior');\n\n $codigo1 = HTML::forma($destino, $forma2);\n $codigo = HTML::contenedor($codigo1, 'bloqueBorde');\n $codigo .= HTML::contenedor('','margenSuperior', 'resultadosBusqueda');\n\n $respuesta['generar'] = true;\n $respuesta['codigo'] = $codigo;\n $respuesta['destino'] = '#cuadroDialogo';\n $respuesta['titulo'] = HTML::contenedor(HTML::frase(HTML::parrafo($textos->id('BUSCAR_ITEM'), 'letraNegra negrilla'), 'bloqueTitulo-IS'), 'encabezadoBloque-IS');\n $respuesta['ancho'] = 530;\n $respuesta['alto'] = 400;\n\n } else {\n\n if (!empty($datos['criterio']) && !empty($datos['patron'])) {\n\n if ($datos['criterio'] == 'titulo') {\n\n $palabras = explode(' ', htmlspecialchars($datos['patron']));\n\n foreach ($palabras as $palabra) {\n $palabrasResaltadas[] = HTML::frase($palabra, 'resaltado');\n $palabrasMarcadas[] = '%'.$palabra.'%';\n } \n \n }\n\n $condicion = \"(n.titulo REGEXP '(\".implode(\"|\", $palabras).\")' OR n.resumen REGEXP '(\".implode(\"|\", $palabras).\")' OR n.descripcion REGEXP '(\".implode(\"|\", $palabras).\")' \";\n\n if(isset($sesion_usuarioSesion)){\n $condicion .= \" OR n.id_usuario = '$sesion_usuarioSesion->id')\";\n } else {\n $condicion .= \" )\";\n }\n\n $condicion .= \" AND sc.id_subcategoria = '\".$datos['id_subcategoria'].\"' \";\n\n //$sql->depurar = true;\n $consulta = $objeto->listar(0, 0, array(0), $condicion);\n\n //print_r($consulta);\n \n if (sizeof($consulta) > 0) {\n $listaNoticias = array();\n\n foreach ($consulta as $key => $fila) {\n $titulo = str_ireplace($palabras, $palabrasMarcadas, $fila->titulo);\n\n $autor = $sql->obtenerValor('usuarios', 'sobrenombre', 'id = \"'.$fila->idAutor.'\"');\n $item3 = HTML::parrafo(str_replace('%1', $autor, $textos->id('CREADO_POR')), 'negrilla');\n $item3 .= HTML::parrafo(HTML::enlace(str_ireplace($palabrasMarcadas, $palabrasResaltadas, $titulo).' '.' '.HTML::imagen($configuracion['SERVIDOR']['media'].$configuracion['RUTAS']['imagenesEstilos'].'goButton.png'), HTML::urlInterna('ITEMS_BB', $fila->id)), 'negrilla');\n $item3 .= HTML::parrafo(str_replace('%1', date('D, d M Y h:i:s A',$fila->fechaCreacion), $textos->id('PUBLICADO_EN')), 'negrilla cursiva pequenia'); \n\n $item = HTML::contenedor($item3, 'fondoBuscadorNoticias');//barra del contenedor gris\n\n $listaNoticias[] = $item; \n\n }\n } else {\n $listaNoticias[] = HTML::frase($textos->id('SIN_REGISTROS'));\n } \n\n $listaNoticias = HTML::lista($listaNoticias, 'listaVertical listaConIconos bordeSuperiorLista');\n\n\n $respuesta['accion'] = 'insertar';\n $respuesta['contenido'] = $listaNoticias;\n $respuesta['destino'] = '#resultadosBusqueda';\n $respuesta['limpiaDestino'] = true;\n\n } else {\n $respuesta['error'] = true;\n $respuesta['mensaje'] = $textos->id('ERROR_FALTA_CADENA_BUSQUEDA');\n\n }\n\n }\n\n Servidor::enviarJSON($respuesta);\n}", "public function RegistrarAbonos()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"codcliente\"]) or empty($_POST[\"codventa\"]) or empty($_POST[\"montoabono\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\n\tif($_POST[\"montoabono\"] > $_POST[\"totaldebe\"])\n\t{\n\t\techo \"2\";\n\t\texit;\n\n\t} else {\n\n\t\t$query = \" insert into abonoscreditos values (null, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $codventa);\n\t\t$stmt->bindParam(2, $codcliente);\n\t\t$stmt->bindParam(3, $montoabono);\n\t\t$stmt->bindParam(4, $fechaabono);\n\t\t$stmt->bindParam(5, $codigo);\n\t\t$stmt->bindParam(6, $codcaja);\n\n\t\t$codventa = strip_tags($_POST[\"codventa\"]);\n\t\t$codcliente = strip_tags($_POST[\"codcliente\"]);\n\t\t$montoabono = strip_tags($_POST[\"montoabono\"]);\n\t\t$fechaabono = strip_tags(date(\"Y-m-d h:i:s\"));\n\t\t$codigo = strip_tags($_SESSION[\"codigo\"]);\n\t\t$codcaja = strip_tags($_POST[\"codcaja\"]);\n\t\t$stmt->execute();\n\n\n$sql = \"select ingresos from arqueocaja where codcaja = '\".$_POST[\"codcaja\"].\"' and statusarqueo = '1'\";\n\t\tforeach ($this->dbh->query($sql) as $row)\n\t\t{\n\t\t\t$this->p[] = $row;\n\t\t}\n\t\t$ingreso = $row['ingresos'];\n\n\t\t$sql = \" update arqueocaja set \"\n\t\t.\" ingresos = ? \"\n\t\t.\" where \"\n\t\t.\" codcaja = ? and statusarqueo = '1';\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $txtTotal);\n\t\t$stmt->bindParam(2, $codcaja);\n\n\t\t$txtTotal = strip_tags($_POST[\"montoabono\"]+$ingreso);\n\t\t$codcaja = strip_tags($_POST[\"codcaja\"]);\n\t\t$stmt->execute();\n\n\n############## ACTUALIZAMOS EL STATUS DE LA FACTURA ##################\n\t\tif($_POST[\"montoabono\"] == $_POST[\"totaldebe\"]) {\n\n\t\t\t$sql = \" update ventas set \"\n\t\t\t.\" statusventa = ? \"\n\t\t\t.\" where \"\n\t\t\t.\" codventa = ?;\n\t\t\t\";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1, $statusventa);\n\t\t\t$stmt->bindParam(2, $codventa);\n\n\t\t\t$codventa = strip_tags($_POST[\"codventa\"]);\n\t\t\t$statusventa = strip_tags(\"PAGADA\");\n\t\t\t$stmt->execute();\n\t\t}\n\n\t\techo \"<div class='alert alert-success'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> EL ABONO AL CR&Eacute;DITO DE FACTURA FUE REGISTRADO EXITOSAMENTE <a href='reportepdf.php?codventa=\".base64_encode($codventa).\"&tipo=\".base64_encode(\"TICKETCREDITOS\").\"' class='on-default' data-placement='left' data-toggle='tooltip' data-original-title='Imprimir Ticket' target='_black'><strong>IMPRIMIR TICKET</strong></a>\";\n\t\techo \"</div>\";\n\t\texit;\n\t}\n}", "function commandes_trig_bank_reglement_en_echec($flux){\r\n\t// Si on est dans le bon cas d'un paiement de commande et qu'il y a un id_commande et que la commande existe toujours\r\n\tif ($id_transaction = $flux['args']['id_transaction']\r\n\t AND $transaction = sql_fetsel(\"*\",\"spip_transactions\",\"id_transaction=\".intval($id_transaction))\r\n\t\tAND $id_commande = $transaction['id_commande']\r\n\t\tAND $commande = sql_fetsel('id_commande, statut, id_auteur', 'spip_commandes', 'id_commande='.intval($id_commande))){\r\n\r\n\t\t$statut_commande = $commande['statut'];\r\n\t\t$transaction_mode = $transaction['mode'];\r\n\t\t$statut_nouveau = $statut_commande;\r\n\r\n\t\t// on ne passe la commande en erreur que si le reglement a effectivement echoue,\r\n\t\t// pas si c'est une simple annulation (retour en arriere depuis la page de paiement bancaire)\r\n\t\tif (strncmp($transaction['statut'],\"echec\",5)==0){\r\n\t\t\t$statut_nouveau = 'erreur';\r\n\t\t}\r\n\t\tif ($statut_nouveau !== $statut_commande){\r\n\t\t\tspip_log(\"commandes_trig_bank_reglement_en_attente marquer la commande #$id_commande statut=$statut_nouveau\",'commandes');\r\n\t\t\t//on met a jour la commande\r\n\t\t\tinclude_spip(\"action/editer_commande\");\r\n\t\t\tcommande_modifier($id_commande,array('statut'=>$statut_nouveau,'mode'=>$transaction_mode));\r\n\t\t}\r\n\t}\r\n\r\n\treturn $flux;\r\n}", "public function actionRecall()\n {\n $query = SmsplusCharging::find();\n $query->select(\"*\");\n\n // tim kiem theo id\n $query->andWhere(['>=', 'id', 19145]);\n // tim kiem response game that bai\n $query->andWhere(['=', 'response_game_status', 0]);\n $rows = $query->all();\n\n // add lai vao queue\n if(!empty($rows)){\n foreach($rows as $row){\n $row->addToQueue();\n }\n }\n echo \"Done!\\n\";\n exit;\n //var_dump($rows);die;\n }", "public function guardar(){\n \n $_vectorpost=$this->_vcapitulo;\n $_programadas=[1,3,4,5,6,7,8,2,11,15,26];\n \n if(!empty($this->_relaciones)){\n \n $_vpasspregunta=explode(\"%%\",$this->_relaciones);\n \n /*Iniciando Transaccion*/\n $_transaction = Yii::$app->db->beginTransaction();\n try {\n foreach($_vpasspregunta as $_clguardar){\n\n /*Aqui se debe ir la funcion segun el tipo de pregunta\n * la variable $_clguardar es un string que trae\n * name_input ::: id_pregunta ::: id_tpregunta ::: id_respuesta\n * cada funcion de guardar por tipo se denomina gr_tipo...\n */\n\n $_ldata=explode(\":::\",$_clguardar);\n\n //Recogiendo codigos SQL\n //Se envia a la funcion de acuerdo al tipo\n // @name_input \"0\"\n // @id_pregunta \n // @id_tpregunta\n // @id_respuesta ==========================//\n \n /*Asociando Respuesta*/\n $_nameq = 'rpta'.$_ldata[0];\n \n \n \n if(!empty($_ldata[2]) and in_array($_ldata[2], $_programadas) === TRUE and isset($_vectorpost['Detcapitulo'][$_nameq])){\n \n \n //Yii::trace(\"Llegan tipos de preguntas \".$_ldata[2].\" Para idpregunta \".$_ldata[1],\"DEBUG\");\n /*Recogiendo Id_respuesta si existe*/ \n $_idrespuesta=(!empty($_ldata[3]))? $_ldata[3]:'';\n $id_pregunta= $_ldata[1];\n $this->_idcapitulo = $_ldata[4];\n \n \n /*Armando Trama SQL segun el tipo de pregunta*/\n $_valor = $_vectorpost['Detcapitulo'][$_nameq];\n \n //Yii::trace(\"que respuestas llegan \".$_valor,\"DEBUG\");\n \n if(isset($this->_agrupadas[$id_pregunta])){\n \n /*1) Buscando si existe una respuesta asociada a la agrupacion*/\n $idrpta_2a = Yii::$app->db->createCommand(\n 'SELECT id_respuesta FROM fd_respuesta\n LEFT JOIN fd_pregunta ON fd_pregunta.id_pregunta = fd_respuesta.id_pregunta\n WHERE fd_pregunta.id_agrupacion= :agrupacion \n and fd_respuesta.id_conjunto_pregunta= :idconjprta \n and fd_respuesta.id_conjunto_respuesta= :idconjrpta\n and fd_respuesta.id_capitulo= :idcapitulo\n and fd_respuesta.id_formato = :idformato\n and fd_respuesta.id_version = :idversion ')\n ->bindValues([\n ':idconjrpta' => $this->_idconjrpta,\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion, \n ':agrupacion' =>$this->_agrupadas[$id_pregunta],\n ])->queryOne();\n \n $_idrespuesta = $idrpta_2a['id_respuesta'];\n \n /*2) Si existe respuesta asociada se envia como _idrespuesta*/\n \n $v_rpta= $this->{\"gr_tipo2a\"}($_idrespuesta,$_valor,$id_pregunta); //Preguntas tipo 2 agrupadas\n $_ldata[1]= $v_rpta[2];\n \n }else{\n \n //Averiguando si la pregunta es tipo multiple y si la respuesta es null si es asi \n //Salta a la siguiente pregunta\n if(!empty($this->multiples[$id_pregunta]) and empty($_valor)){\n continue;\n }else if(!empty($this->multiples[$id_pregunta]) and !is_null($_valor)){\n $_idrespuesta=''; \n } \n \n /*Si la pregunta es tipo 3 se averigua si la respuesta es tipo especifique*/\n $_otros=null;\n if($_ldata[2]=='3' and isset($_vectorpost['Detcapitulo']['otros_'.$_ldata[0]])){\n \n $_otros = $_vectorpost['Detcapitulo']['otros_'.$_ldata[0]];\n $v_rpta= $this->{\"gr_tipo\".$_ldata[2]}($_idrespuesta,$_valor,$_otros);\n \n }else{\n \n if($_ldata[2]==11 and isset($this->_tipo11[$_nameq])){\n $_valor=count($this->_tipo11[$_nameq]);\n $v_rpta= $this->{\"gr_tipo\".$_ldata[2]}($_idrespuesta,$_valor);\n }else if ($_ldata[2]!=11 and !isset($this->_tipo11[$_nameq])){\n $v_rpta= $this->{\"gr_tipo\".$_ldata[2]}($_idrespuesta,$_valor,$_otros,$id_pregunta);\n }else{\n continue;\n } \n }\n } \n \n /*Asignando valor == null*/\n $v_rpta[1]=(!isset($v_rpta[1]))? NULL:$v_rpta[1];\n \n \n /*Generado comando SQL*/\n if(!empty($v_rpta[0])){\n \n if(empty($this->_idjunta))$this->_idjunta=0;\n if(is_null($_otros)){ \n \n if (strpos($v_rpta[0], ';') !== false) {\n $sep_qu = explode(\";\", $v_rpta[0]);\n \n Yii::$app->db->createCommand($sep_qu[0])\n ->bindValues([\n ':valor' => $v_rpta[1],\n ':idconjrpta' => $this->_idconjrpta,\n ':idpregunta' => $_ldata[1],\n ':idtpregunta' => $_ldata[2],\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion,\n ':idjunta' =>$this->_idjunta,\n ])->execute();\n \n Yii::$app->db->createCommand($sep_qu[1])\n ->bindValues([\n ':valor' => $v_rpta[1],\n ])->execute();\n \n \n }\n else\n {\n Yii::$app->db->createCommand($v_rpta[0])\n ->bindValues([\n ':valor' => $v_rpta[1],\n ':idconjrpta' => $this->_idconjrpta,\n ':idpregunta' => $_ldata[1],\n ':idtpregunta' => $_ldata[2],\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion,\n ':idjunta' =>$this->_idjunta,\n ])->execute();\n }\n \n \n }else{ \n Yii::$app->db->createCommand($v_rpta[0])\n ->bindValues([\n ':valor' => $v_rpta[1],\n ':idconjrpta' => $this->_idconjrpta,\n ':idpregunta' => $_ldata[1],\n ':idtpregunta' => $_ldata[2],\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion,\n ':idjunta' =>$this->_idjunta,\n ':otros' =>$_otros, \n ])->execute();\n }\n\n /*Se averigua con que id quedo guardada la respuesta si es tipo 11 -> guarda en SOP SOPORTE*/\n if($_ldata[2]=='11' and !empty($this->_tipo11[$_nameq])){\n\n $id_rpta = Yii::$app->db->createCommand(\n 'SELECT id_respuesta FROM fd_respuesta '\n . 'WHERE id_pregunta = :_prta'\n . ' and fd_respuesta.id_conjunto_pregunta= :idconjprta \n and fd_respuesta.id_conjunto_respuesta= :idconjrpta\n and fd_respuesta.id_capitulo= :idcapitulo\n and fd_respuesta.id_formato = :idformato\n and fd_respuesta.id_version = :idversion' )\n ->bindValues([\n ':_prta' => $_ldata[1], \n ':idconjrpta' => $this->_idconjrpta,\n ':idcapitulo' =>$this->_idcapitulo,\n ':idformato' =>$this->_idformato,\n ':idconjprta' => $this->_idconjprta,\n ':idversion' =>$this->_idversion, \n ])->queryOne();\n\n\n foreach($this->_tipo11[$_nameq] as $_cltp11){\n\n $_vctp11=explode(\":::\",$_cltp11);\n $_namefile = $_vctp11[0].\".\".$_vctp11[2];\n\n $_sqlSOP=\"INSERT INTO sop_soportes ([[ruta_soporte]],[[titulo_soporte]],[[tamanio_soportes]],[[id_respuesta]]) VALUES (:ruta, :titulo, :tamanio, :_idrpta)\";\n\n Yii::$app->db->createCommand($_sqlSOP)\n ->bindValues([\n ':ruta' => $_vctp11[1],\n ':titulo' => $_namefile,\n ':tamanio' => $_vctp11[3],\n ':_idrpta' => $id_rpta[\"id_respuesta\"],\n ])->execute();\n\n }\n \n }\n /*Fin guardando en SOP_SOPORTES para tipo 11*/\n \n } \n }\n\n }\n \n \n \n $_transaction->commit();\n \n }catch (\\Exception $e) {\n $_transaction->rollBack();\n throw $e;\n return FALSE;\n } catch (\\Throwable $e) {\n $_transaction->rollBack();\n throw $e;\n return FALSE;\n } \n \n }\n return TRUE;\n }", "function commandes_trig_bank_reglement_en_attente($flux){\r\n\t// Si on est dans le bon cas d'un paiement de commande et qu'il y a un id_commande et que la commande existe toujours\r\n\tif ($id_transaction = $flux['args']['id_transaction']\r\n\t AND $transaction = sql_fetsel(\"*\",\"spip_transactions\",\"id_transaction=\".intval($id_transaction))\r\n\t\tAND $id_commande = $transaction['id_commande']\r\n\t\tAND $commande = sql_fetsel('id_commande, statut, id_auteur, mode', 'spip_commandes', 'id_commande='.intval($id_commande))){\r\n\r\n\t\t$statut_commande = $commande['statut'];\r\n\t\t$transaction_mode = $transaction['mode'];\r\n\t\t$commande_mode = $commande['mode'];\r\n\t\t$statut_nouveau = 'attente';\r\n\t\tif ($statut_nouveau !== $statut_commande OR $transaction_mode !==$commande_mode){\r\n\t\t\tspip_log(\"commandes_trig_bank_reglement_en_attente marquer la commande #$id_commande statut=$statut_nouveau mode=$transaction_mode\",'commandes');\r\n\t\t\t//on met a jour la commande\r\n\t\t\tinclude_spip(\"action/editer_commande\");\r\n\t\t\tcommande_modifier($id_commande,array('statut'=>$statut_nouveau,'mode'=>$transaction_mode));\r\n\t\t}\r\n\t}\r\n\r\n\treturn $flux;\r\n}", "function inc_forum_insert($force_statut = NULL) {\n\n\t// On deroute inc/forum_insert\n\trequire_once _DIR_RESTREINT.'inc/forum_insert.php';\n\n\t// [fr] Si Spipbb ou le filtrage ne sont pas actifs->traitement classique\n\tif ( !spipbb_is_configured()\n\t\tor $GLOBALS['spipbb']['configure']!='oui'\n\t\tor $GLOBALS['spipbb']['config_spam_words']!='oui' )\n\t\treturn inc_forum_insert_dist($force_statut);\n\n\t$id_article = intval(_request('id_article'));\n\t$id_breve = intval(_request('id_breve'));\n\t$id_forum = intval(_request('id_forum'));\n\t$id_rubrique = intval(_request('id_rubrique'));\n\t$id_syndic = intval(_request('id_syndic'));\n\t$afficher_texte = _request('afficher_texte');\n\t$ajouter_mot = _request('ajouter_mot');\n\t$retour_forum = _request('retour_forum');\n\n\t$retour_forum = rawurldecode($retour_forum);\n\n\t// Antispam : si 'nobot' a ete renseigne, ca ne peut etre qu'un bot\n\tif (strlen(_request('nobot'))) {\n\t\ttracer_erreur_forum('champ interdit (nobot) rempli');\n\t\treturn $retour_forum; # echec silencieux du POST\n\t}\n\n\t// id_rubrique est parfois passee pour les articles, on n'en veut pas\n\tif ($id_rubrique > 0 AND ($id_article OR $id_breve OR $id_syndic))\n\t\t$id_rubrique = 0;\n\n\t$statut = controler_forum($id_article);\n\n\t// Ne pas autoriser de changement de nom si forum sur abonnement\n\tif ($statut == 'abo') {\n\t\tcontroler_forum_abo($retour_forum);\n\t\tset_request('auteur', $GLOBALS['auteur_session']['nom']);\n\t\tset_request('email_auteur', $GLOBALS['auteur_session']['email']);\n\t}\n\n\t$statut = ($statut == 'non') ? 'off' : (($statut == 'pri') ? 'prop' :\n\t\t\t\t\t\t'publie');\n\n\tif (isset($force_statut))\n\t\t$statut = $force_statut;\n\n\t//\n\t// Check spam words config\n\t//\n\n\t$id_auteur = $GLOBALS['auteur_session']['id_auteur'];\n\t$login = _request('auteur') ;\n\n\t$spam = check_spam($id_auteur,$login,$id_forum,$id_article,_request('texte'), _request('titre')) ;\n\n\tif ($spam) $force_statut = \"spam\";\n\treturn inc_forum_insert_dist($force_statut);\n}", "function creaChampionnatFantome($id_tournoi, $tab_c, Tournoi $tournoi, Concurrent $concurrent)\n{ \n $manager_concurrent = connect('Concurrent');\n //gestion des fantomes\n if($tournoi->getNbEquipe()!=4 ||\n $tournoi->getNbEquipe()!=6 ||\n $tournoi->getNbEquipe()!=8 ||\n $tournoi->getNbEquipe()!=12 ||\n $tournoi->getNbEquipe()!=16 ||\n $tournoi->getNbEquipe()!=24 ||\n $tournoi->getNbEquipe()!=32)\n {\n if($tournoi->getNbEquipe()<=4){$nb_fantome= 4-$tournoi->getNbEquipe();}\n else if($tournoi->getNbEquipe()<=6){$nb_fantome= 6-$tournoi->getNbEquipe();}\n else if($tournoi->getNbEquipe()<=8){$nb_fantome= 8-$tournoi->getNbEquipe();}\n else if($tournoi->getNbEquipe()<=12){$nb_fantome= 12-$tournoi->getNbEquipe();}\n else if($tournoi->getNbEquipe()<=16){$nb_fantome= 16-$tournoi->getNbEquipe();}\n else if($tournoi->getNbEquipe()<=24){$nb_fantome= 24-$tournoi->getNbEquipe();}\n else if($tournoi->getNbEquipe()<=32){$nb_fantome= 32-$tournoi->getNbEquipe();}\n\n for($i=1; $i<=$nb_fantome; $i++)\n {\n $concurrent->setIdTournoi($id_tournoi);\n $concurrent->setNomConcurrent(\"~~free win~~\");\n $concurrent->setNbConcurrent(1);\n $tab_fantome[] = $concurrent->getNomConcurrent();\n $manager_concurrent->addConcurrent($concurrent); \n }\n \n $nb_equipe_total = $tournoi->getNbEquipe()+$nb_fantome;\n //fusion des 2 tableaux fantome et real concurrent\n $tab_co = array_reverse($tab_c);\n $x=0;\n $espace_fantome=0;\n foreach($tab_co as $value_concurrent)\n {\n \n if($x<$nb_fantome)\n { \n if((($espace_fantome%3)==0) && (($nb_equipe_total==6) || ($nb_equipe_total==12) || ($nb_equipe_total==24)))\n {\n $tab_con[] = $tab_fantome[$x];\n $x++;\n }\n else if((($espace_fantome%3)==0) && (($nb_equipe_total==4) || ($nb_equipe_total==8) || ($nb_equipe_total==16) || ($nb_equipe_total==32)))\n {\n $tab_con[] = $tab_fantome[$x]; \n $x++;\n } \n }\n $tab_con[] = $value_concurrent;\n $espace_fantome++;\n }\n $tab_concurrent = array_reverse($tab_con);\n }\n $tab_fantome_championnat = array('nb_fantome' => $nb_fantome, 'tab_concurrent' => $tab_concurrent);\n \n return $tab_fantome_championnat;\n}", "function queue ($elemento)\n\t\t\t\t{\n\t\t\t\t\tarray_push($this->arreglo, $elemento);\n\t\t\t\t}", "function carrinho(){\n\t\t\t$this->items = array();\n\t\t}", "function\tunbuche() {\n\t\tFDbg::dumpL( 0x00000100, \"AbKorr.php::AbKorrPosten::unbuche(): begin\") ;\n\t\t$this->_buche( -1) ;\n\t\tFDbg::dumpL( 0x00000100, \"AbKorr.php::AbKorrPosten::unbuche(): end\") ;\n\t}", "public function agregar_banco(){\r\n $conectar=parent::conexion();\r\n parent::set_names();\r\n if(empty($_POST[\"pregunta\"])){\r\n header(\"Location:\".Conectar::ruta().\"admin/banco/crear.php?m=1\");\r\n exit();\r\n }\r\n $contra='activo';\r\n $conectar=parent::conexion();\r\n $sql=\"insert into banco values(null,?,?,?,now());\";\r\n $sql=$conectar->prepare($sql);\r\n $sql->bindValue(1, $_POST[\"pregunta\"]);\r\n $sql->bindValue(2, $_SESSION[\"id\"]);\r\n $sql->bindValue(3, $contra);\r\n $sql->execute();\r\n $resultado=$sql->fetch(PDO::FETCH_ASSOC);\r\n \r\n header(\"Location:\".Conectar::ruta().\"admin/banco/index.php?m=2\");\r\n \r\n }", "private function _getBans()\r\n\t{\r\n\t\t$ban_file_name = md5($this->CI->config->config['encryption_key'].$this->ban_file);\r\n\t\t\r\n\t\t// Check if the cache file previously exists\r\n\t\tif(file_exists(CACHEPATH . $ban_file_name))\r\n\t\t{\r\n\t\t\t// Dont wast time with the DB, load the cached version\r\n\t\t\t$this->ban_list = unserialize(base64_decode($this->CI->load->file(CACHEPATH . $ban_file_name, true)));\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t// Get group object from DB\r\n\t\t\t$bans = $this->db->get_where('bans', array('type' => 'user'));\r\n\t\t\tforeach($bans->result() as $ban)\r\n\t\t\t{\r\n\t\t\t\t$this->ban_list[] = array('ip' => $ban->ip, 'time' => $ban->time, 'type' => 'user');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Save the group object to cache for increased performance\r\n\t\t\tfile_put_contents(CACHEPATH . $ban_file_name, base64_encode(serialize($this->ban_list)));\r\n\t\t}\r\n\t}", "public function addAll($_request)\n\t{\n\t\t$_request[\"id_taller\"] = $_SESSION['user_info']['id_taller'];\n\t\t$_request[\"id_user\"] = $_SESSION['user_id'];\n\t\t$_request[\"total\"] = $_request['total-globalgasto'];\n\t\t$data=fromArray($_request,'gastos',$this->db,\"add\");\n\t\t$sql= \"INSERT INTO gastos (\".$data[0].\") VALUES(\".$data[1].\"); \";\n\t\t$res=$this->db->query($sql);\n\t\t$sql= \"SELECT LAST_INSERT_ID();\";//. $num ;\n\t\t$res=$this->db->query($sql);\n\t\t$set=array();\n\t\t$id=\"\";\n\t\tif(!$res){ die(\"Error getting result\"); }\n\t\telse{\n\t\t\twhile ($row = $res->fetch_assoc())\n\t\t\t\t$id= $row;\n\t\t}\n\t\t$id = $id[\"LAST_INSERT_ID()\"];\n\t\t$gastostipo\t= $_request[\"id_gastostiporegistros\"];\n\t\t$total\t\t= $_request[\"totalesregistros\"];\n\t\t$cantidad\t= $_request[\"cantidad\"];\n\t\t$detalles\t= $_request[\"detalles\"];\n\t\t\n\t\tforeach ($gastostipo as $key => $value) {\n\t\t\t$total = ($total[$key]) ? $total[$key] : 0 ;\n\t\t\t$cant = $cantidad[$key];\n\t\t\t$detalle = $detalles[$key];\n\t\t\t$id_gastostipo = $value;\n\t\t\t$_requestgastos[\"id_gastos\"] = $id;\n\t\t\t$_requestgastos[\"id_gastostipo\"] = $id_gastostipo;\n\t\t\t$_requestgastos[\"detalles\"] \t = $detalle;\n\t\t\t$_requestgastos[\"cantidad\"] = $cant;\n\t\t\t$_requestgastos[\"total\"] = $total;\n\t\t\t$objGastosRegistros = new GastosRegistros();\n\t\t\tif(!$objGastosRegistros->addAll($_requestgastos)){\n\t\t\t\techo \"Falla en insert pedido refaccion\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\tif($id_gastostipo==7){//nomina\n\t\t\t\t$objNomina = new Nomina();\n\t\t\t\t$_requestnomina[\"available\"] = 0;\n\t\t\t\tif(!$objNomina->updateAll($detalle,$_requestnomina)){\n\t\t\t\t\techo \"Falla en update de nomina available\";\n\t\t\t\t\texit;\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\treturn $id;\n\t}", "function enqueue(){\n\t\t}", "function getBloqueado() {\n return $this->bloqueado;\n }", "function setAgregarUnPais(){\n\t\t$this->comienza_con++;\n\t}", "public function readerStore(Request $request)\n {\n $data = $request->except('_token');\n //validação cheque\n $cheque = new Cheque();\n \n $rules = $cheque->rules();\n \n if($request['che_status'] == 'REPASSADO'){\n $rules = $rules + ['che_cliente_repassado' => 'required'];\n } \n \n $validation = Validator::make($request->all(),$cheque->rules(),$cheque->messages());\n \n $response = [];\n $errosMessage = '';\n \n if($validation->fails()){\n \n foreach ($validation->errors()->messages() as $error) {\n foreach ($error as $key => $value) {\n if($key == 0){\n $errosMessage .= '<br>'.$value;\n } else {\n $errosMessage .= $value.'<br>';\n }\n \n }\n }\n \n $response['erros'] = $errosMessage;\n $response['status'] = 'failed';\n return $response;\n \n } else {\n try {\n\n $banco = Banco::where('ban_codigo',$data['che_banco_codigo'])->first();\n \n if(!$banco){\n $response['erros'] = 'Banco não encontrado';\n $response['status'] = 'failed';\n return $response;\n }\n \n DB::beginTransaction();\n\n $data['che_idbanco'] = $banco->ban_id;\n //insere cheque\n $data['che_data_emissao'] = convertData($data['che_data_emissao']);\n $data['che_data_vencimento'] = convertData($data['che_data_vencimento']);\n\n $data['che_data_adicionado'] = date('Y-m-d H:i:s');\n \n # Se não repassado, che_cliente_repassado é nulo\n if($request['che_status'] != 'REPASSADO'){\n $data['che_cliente_repassado'] = null;\n } \n \n $cheque->create($data);\n\n DB::commit();\n\n $response['erros'] = $errosMessage;\n $response['status'] = 'success';\n \n return $response;\n \n } catch (Exception $ex) {\n \n DB::rollBack();\n $response['erros'] = $errosMessage;\n $response['status'] = 'failed';\n \n return $response;\n }\n }\n }", "function xthreads_admin_forumcommit() {\r\n\tglobal $fid, $db, $cache, $mybb;\r\n\tif(!$fid) {\r\n\t\t// bad MyPlaza Turbo! (or any other plugin which does the same thing)\r\n\t\t$fid = intval($mybb->input['fid']);\r\n\t}\r\n\t\r\n\t// handle additional filters\r\n\t$afefields = array(\r\n\t\t'uid',\r\n\t\t'lastposteruid',\r\n\t\t'prefix',\r\n\t\t'icon',\r\n\t);\r\n\t$addfiltenable = '';\r\n\tforeach($afefields as &$afe)\r\n\t\tif($db->field_exists($afe, 'threads') && $mybb->input['xthreads_afe_'.$afe]) {\r\n\t\t\t$addfiltenable .= ($addfiltenable?',':'').$afe;\r\n\t\t\tif($afe != 'uid') {\r\n\t\t\t\t// try to add key - if it already exists, MySQL will fail for us :P\r\n\t\t\t\t$db->write_query('ALTER TABLE `'.$db->table_prefix.'threads` ADD KEY `xthreads_'.$afe.'` (`'.$afe.'`)', true);\r\n\t\t\t}\r\n\t\t} elseif($afe != 'uid') {\r\n\t\t\t// check if any other forum is using this field\r\n\t\t\tif(!isset($afe_usage_cache)) {\r\n\t\t\t\t$afe_usage_cache = array();\r\n\t\t\t\t$query = $db->simple_select('forums', 'DISTINCT xthreads_addfiltenable', 'xthreads_addfiltenable != \"\" AND fid != '.$fid);\r\n\t\t\t\twhile($fafelist = $db->fetch_field($query, 'xthreads_addfiltenable')) {\r\n\t\t\t\t\tforeach(explode(',', $fafelist) as $fafe)\r\n\t\t\t\t\t\t$afe_usage_cache[$fafe] = 1;\r\n\t\t\t\t}\r\n\t\t\t\t$db->free_result($query);\r\n\t\t\t\tunset($fafelist, $fafe);\r\n\t\t\t}\r\n\t\t\tif(!$afe_usage_cache[$afe]) {\r\n\t\t\t\t// this filter isn't being used anywhere - try to drop the key\r\n\t\t\t\t$db->write_query('ALTER TABLE `'.$db->table_prefix.'threads` DROP KEY `xthreads_'.$afe.'`', true);\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t\r\n\t$db->update_query('forums', array(\r\n\t\t'xthreads_tplprefix' => $db->escape_string(implode(',', array_map('trim', explode(',', $mybb->input['xthreads_tplprefix'])))),\r\n\t\t'xthreads_grouping' => intval(trim($mybb->input['xthreads_grouping'])),\r\n\t\t'xthreads_firstpostattop' => intval(trim($mybb->input['xthreads_firstpostattop'])),\r\n\t\t'xthreads_allow_blankmsg' => intval(trim($mybb->input['xthreads_allow_blankmsg'])),\r\n\t\t'xthreads_nostatcount' => intval(trim($mybb->input['xthreads_nostatcount'])),\r\n\t\t'xthreads_inlinesearch' => intval(trim($mybb->input['xthreads_inlinesearch'])),\r\n\t\t'xthreads_threadsperpage' => intval(trim($mybb->input['xthreads_threadsperpage'])),\r\n\t\t'xthreads_postsperpage' => intval(trim($mybb->input['xthreads_postsperpage'])),\r\n\t\t'xthreads_force_postlayout' => trim($mybb->input['xthreads_force_postlayout']),\r\n\t\t'xthreads_hideforum' => intval($mybb->input['xthreads_hideforum']),\r\n\t\t'xthreads_hidebreadcrumb' => intval($mybb->input['xthreads_hidebreadcrumb']),\r\n\t\t'xthreads_addfiltenable' => $db->escape_string($addfiltenable),\r\n//\t\t'xthreads_deffilter' => $db->escape_string($deffilter),\r\n\t\t'xthreads_wol_announcements' => $db->escape_string(trim($mybb->input['xthreads_wol_announcements'])),\r\n\t\t'xthreads_wol_forumdisplay' => $db->escape_string(trim($mybb->input['xthreads_wol_forumdisplay'])),\r\n\t\t'xthreads_wol_newthread' => $db->escape_string(trim($mybb->input['xthreads_wol_newthread'])),\r\n\t\t'xthreads_wol_attachment' => $db->escape_string(trim($mybb->input['xthreads_wol_attachment'])),\r\n\t\t'xthreads_wol_newreply' => $db->escape_string(trim($mybb->input['xthreads_wol_newreply'])),\r\n\t\t'xthreads_wol_showthread' => $db->escape_string(trim($mybb->input['xthreads_wol_showthread'])),\r\n\t\t'xthreads_wol_xtattachment' => $db->escape_string(trim($mybb->input['xthreads_wol_xtattachment'])),\r\n\t), 'fid='.$fid);\r\n\t\r\n\t$cache->update_forums();\r\n}", "protected function _balanceQueues(){\n// $this->RUNNING = false;\n }", "function getInfosBanque($id_bqe=NULL,$id_ag=NULL) {\n\n global $dbHandler;\n\n $db = $dbHandler->openConnection();\n $sql = \"SELECT * FROM adsys_banque\";\n if ($id_bqe != NULL) {\n if ($id_ag == NULL)\n $sql .=\" WHERE id_banque = $id_bqe\";\n else\n $sql .=\" WHERE id_banque = $id_bqe and id_ag = $id_ag \";\n }\n elseif ($id_ag != NULL) $sql .=\" WHERE id_ag = $id_ag\";\n $sql.= \";\";\n\n $result=$db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__,__LINE__,__FUNCTION__);\n }\n\n $dbHandler->closeConnection(true);\n\n if ($result->numRows() == 0) return NULL;\n\n while ( $row = $result->fetchRow(DB_FETCHMODE_ASSOC) )\n $DATAS[$row[\"id_banque\"]] = $row;\n\n return $DATAS;\n\n}", "function Cargar($recuperanombre,$recuperacif,$recuperavisible,$recuperacic,$recuperatipo,$recuperagrupo_gestion,$recuperadireccion,$recuperalocalidad,$recuperacodigo_postal,$recuperaprovincia,$recuperapais, $recuperatelefono,$recuperafax,$recuperamail,$recuperaresponsable,\r\n\t$recuperacargo_responsable,$recuperagrupo_comision,$recuperasituacion,$recuperaobservaciones,$recuperanombre_fiscal,$recuperadireccion_fiscal,$recuperalocalidad_fiscal,$recuperacodigo_postal_fiscal,\r\n\t$recuperapais_fiscal,$recuperaswift,$recuperacc_iban,$recuperanombre_banco,$recuperadireccion_banco,$recuperamail_contabilidad){\r\n\r\n\t\t$conexion = $this ->Conexion;\r\n\r\n\t\t//Consulta\r\n\t\t$Filadesde = $this ->Filadesde;\r\n\t\t$Usuario = $this ->Usuario;\r\n\r\n\t\t//ESPECIFICO: Cargamos las lineas solicitadas para esta pantalla\r\n\t\t$buscar_codigo = $this ->Buscar_codigo;\r\n\t\t$buscar_nombre = $this ->Buscar_nombre;\r\n\t\t$buscar_grupo_gestion = $this ->Buscar_grupo_gestion;\t\r\n\r\n\r\n\r\n\t\tif($buscar_codigo != null){\r\n\t\t\t$CADENA_BUSCAR = \" WHERE ID = '\".$buscar_codigo.\"'\";\r\n\t\t}elseif($buscar_nombre != null){\r\n\t\t\t$CADENA_BUSCAR = \" WHERE NOMBRE LIKE '%\".$buscar_nombre.\"%'\";\r\n\t\t}elseif($buscar_grupo_gestion != null){\r\n\t\t\t$CADENA_BUSCAR = \" WHERE GRUPO_GESTION = '\".$buscar_grupo_gestion.\"'\";\r\n\t\t}else{\r\n\t\t\t$CADENA_BUSCAR = \" WHERE NOMBRE = 'XX' \";\r\n\t\t\t//$CADENA_BUSCAR = \"\";\r\n\t\t}\r\n\r\n\t\t$resultado =$conexion->query(\"SELECT id,nombre,cif,visible,cic,tipo,grupo_gestion,direccion,localidad,codigo_postal,provincia,pais,telefono,fax,mail,responsable,\r\n\tcargo_responsable,grupo_comision,situacion,observaciones,nombre_fiscal,direccion_fiscal,localidad_fiscal,codigo_postal_fiscal,provincia_fiscal,pais_fiscal,swift,cc_iban,nombre_banco,direccion_banco,mail_contabilidad FROM hit_minoristas \".$CADENA_BUSCAR.\" ORDER BY NOMBRE\");\r\n\r\n\t\t/*if ($resultado == FALSE){\r\n\t\t\techo('Error en la consulta');\r\n\t\t\t$resultado->close();\r\n\t\t\t$conexion->close();\r\n\t\t\texit;\r\n\t\t}*/\r\n\t\t//----------------------------------------------------------------\r\n\r\n\t\t//Guardamos el resultado en una matriz con un numero fijo de registros\r\n\t\t//que controlaremos por una tabla de configuracion de pantallas de usuarios. ESPECIFICO: Solo el nombre del formulario en la query\r\n\t\t$numero_filas =$conexion->query(\"SELECT LINEAS_MODIFICACION FROM hit_usuarios_formularios WHERE FORMULARIO = 'MINORISTAS' AND USUARIO = '\".$Usuario.\"'\");\r\n\t\t$Nfilas\t = $numero_filas->fetch_assoc();\t\t\t\t\t\t\t\t\t\t\t //------\r\n\r\n\t\t$minoristas = array();\r\n\t\tif($recuperanombre != null){\r\n\t\t\t$minoristas[0] = array (\"id\" => null, \"nombre\" => $recuperanombre, \"cif\" => $recuperacif, \"visible\" => $recuperavisible, \"cic\" => $recuperacic, \"tipo\" => $recuperatipo, \"grupo_gestion\" => $recuperagrupo_gestion, \"direccion\" => $recuperadireccion, \"localidad\" => $recuperalocalidad, \"codigo_postal\" => $recuperacodigo_postal, \"provincia\" => $recuperaprovincia, \"pais\" => $recuperapais, \"telefono\" => $recuperatelefono, \"fax\" => $recuperafax, \"mail\" => $recuperamail, \"responsable\" => $recuperaresponsable, \"cargo_responsable\" => $recuperacargo_responsable, \"grupo_comision\" => $recuperagrupo_comision, \"situacion\" => $recuperasituacion, \"observaciones\" => $recuperaobservaciones, \"v\" => $recuperanombre_fiscal, \"direccion_fiscal\" => $recuperadireccion_fiscal, \"localidad_fiscal\" => $recuperalocalidad_fiscal, \"codigo_postal_fiscal\" => $recuperacodigo_postal_fiscal, \"provincia_fiscal\" => $recuperaprovincia_fiscal, \"pais_fiscal\" => $recuperapais_fiscal, \"swift\" => $recuperaswift, \"cc_iban\" => $recuperacc_iban, \"nombre_banco\" => $recuperanombre_banco, \"direccion_banco\" => $recuperadireccion_banco, \"mail_contabilidad\" => $recuperamail_contabilidad);\r\n\t\t}else{\r\n\t\t\tfor ($num_fila = $Filadesde-1; $num_fila <= $Filadesde + $Nfilas['LINEAS_MODIFICACION']-2; $num_fila++) {\r\n\t\t\t\t$resultado->data_seek($num_fila);\r\n\t\t\t\t$fila = $resultado->fetch_assoc();\r\n\t\t\t\tarray_push($minoristas,$fila);\r\n\t\t\t}\r\n\t\t}\r\n\t\t//Liberar Memoria usada por la consulta\r\n\t\t$resultado->close();\r\n\t\t$numero_filas->close();\r\n\r\n\t\treturn $minoristas;\t\t\t\t\t\t\t\t\t\t\t\r\n\t}", "public function addContainerReq($corob){\n $result_arr = array('res' =>\"\" , 'value'=>\"\" );\n if ($this->acses==true){\n $id_arr=$this->addContainer($corob);\n if ($id_arr['res']==false){\n return $id_arr;\n }\n $count_container=DB::table('container_request')->where(['container'=>$id_arr['value'],'request'=>$this->id,])->get();\n //TODO: надо проверить нету ли контайров в другой активной заявки\n if (count($count_container)!=0){\n // echo \"Этот короб уже добавлен в заявку\";\n return array('res' =>false , 'value'=>\"Этот короб уже добавлен в заявку\");\n }\n $rez=DB::table('container_request')->insertGetId([\n 'container'=> $id_arr['value'],\n 'request'=>$this->id,\n ]);\n $this->containers_num+=1;\n $resadd_containers=DB::table('request')->where('id',$this->id)->update(['containers_num' => $this->containers_num]);\n return array('res' =>true , 'value'=>\"Короб успешно добавлен в заявку\");\n }\n else {\n $result_arr['res']=false;\n $result_arr['value']=\"Нету доступа\";\n return $result_arr;\n }\n }", "public function dequeue();", "function xthreads_admin_forumcommit() {\r\n\tglobal $fid, $db, $cache, $mybb;\r\n\tif(!$fid) {\r\n\t\t// bad MyPlaza Turbo! (or any other plugin which does the same thing)\r\n\t\t$fid = (int)$mybb->input['fid'];\r\n\t}\r\n\t\r\n\t/*\r\n\t// handle additional filters\r\n\t$afefields = array(\r\n\t\t'uid',\r\n\t\t'lastposteruid',\r\n\t\t'prefix',\r\n\t\t'icon',\r\n\t);\r\n\t$addfiltenable = '';\r\n\tforeach($afefields as &$afe)\r\n\t\tif($db->field_exists($afe, 'threads') && isset($mybb->input['xthreads_afe_'.$afe])) {\r\n\t\t\t$addfiltenable .= ($addfiltenable?',':'').$afe;\r\n\t\t\tif($afe != 'uid') {\r\n\t\t\t\t// try to add key - if it already exists, MySQL will fail for us :P\r\n\t\t\t\t$db->write_query('ALTER TABLE `'.$db->table_prefix.'threads` ADD KEY `xthreads_'.$afe.'` (`'.$afe.'`)', true);\r\n\t\t\t}\r\n\t\t} elseif($afe != 'uid') {\r\n\t\t\t// check if any other forum is using this field\r\n\t\t\tif(!isset($afe_usage_cache)) {\r\n\t\t\t\t$afe_usage_cache = array();\r\n\t\t\t\t$query = $db->simple_select('forums', 'DISTINCT xthreads_addfiltenable', 'xthreads_addfiltenable != \"\" AND fid != '.$fid);\r\n\t\t\t\twhile($fafelist = $db->fetch_field($query, 'xthreads_addfiltenable')) {\r\n\t\t\t\t\tforeach(explode(',', $fafelist) as $fafe)\r\n\t\t\t\t\t\t$afe_usage_cache[$fafe] = 1;\r\n\t\t\t\t}\r\n\t\t\t\t$db->free_result($query);\r\n\t\t\t\tunset($fafelist, $fafe);\r\n\t\t\t}\r\n\t\t\tif(!$afe_usage_cache[$afe]) {\r\n\t\t\t\t// this filter isn't being used anywhere - try to drop the key\r\n\t\t\t\t$db->write_query('ALTER TABLE `'.$db->table_prefix.'threads` DROP KEY `xthreads_'.$afe.'`', true);\r\n\t\t\t}\r\n\t\t}\r\n\t*/\r\n\t\r\n\t$update_array = array();\r\n\tforeach(array(\r\n\t\t'xthreads_tplprefix' => 1,\r\n\t\t'xthreads_langprefix' => 1,\r\n\t\t'xthreads_grouping' => 0,\r\n\t\t'xthreads_firstpostattop' => 0,\r\n\t\t'xthreads_allow_blankmsg' => 0,\r\n\t\t'xthreads_nostatcount' => 0,\r\n\t\t'xthreads_inlinesearch' => 0,\r\n\t\t'xthreads_fdcolspan_offset' => 0,\r\n\t\t'xthreads_settingoverrides' => 1,\r\n\t\t'xthreads_postsperpage' => 0,\r\n\t\t'xthreads_hideforum' => 0,\r\n\t\t'xthreads_hidebreadcrumb' => 0,\r\n\t\t'xthreads_defaultfilter' => 1,\r\n\t\t//'xthreads_addfiltenable' => $db->escape_string($addfiltenable),\r\n//\t\t'xthreads_deffilter' => $db->escape_string($deffilter),\r\n\t\t'xthreads_wol_announcements' => 2,\r\n\t\t'xthreads_wol_forumdisplay' => 2,\r\n\t\t'xthreads_wol_newthread' => 2,\r\n\t\t'xthreads_wol_attachment' => 2,\r\n\t\t'xthreads_wol_newreply' => 2,\r\n\t\t'xthreads_wol_showthread' => 2,\r\n\t) as $k => $is_str) {\r\n\t\tif(isset($mybb->input[$k])) {\r\n\t\t\tif($is_str) {\r\n\t\t\t\t$update_array[$k] = $db->escape_string($is_str == 2 ? trim($mybb->input[$k]) : $mybb->input[$k]);\r\n\t\t\t} else\r\n\t\t\t\t$update_array[$k] = (int)trim($mybb->input[$k]);\r\n\t\t} else {\r\n\t\t\t$update_array[$k] = $is_str ? '' : 0;\r\n\t\t}\r\n\t}\r\n\t$db->update_query('forums', $update_array, 'fid='.$fid);\r\n\t\r\n\t$cache->update_forums();\r\n\txthreads_buildtfcache();\r\n}", "function comprobar($nombretabla, $BDImportRecambios, $BDRecambios,$id,$l,$f) {\n // Inicializamos variables\n $consfinal = 0;\n $existente = 0;\n $nuevo = 0;\n $consul = \"SELECT * FROM referenciascruzadas where RefFabricanteCru ='\" . $id . \"'\";\n $consultaReca = mysqli_query($BDRecambios, $consul);\n if ($consultaReca == true) {\n // Controlamos que la consulta sea correcta, ya que sino lo es genera un error la funcion fetch\n $consfinal = $consultaReca->fetch_assoc();\n }\n if ($consfinal['RefFabricanteCru'] == $id && $consfinal['IdFabricanteCru'] == $f) {\n $actu = \"UPDATE `listaprecios` SET `Estado`='existe',`RecambioID`=\" . $consfinal['RecambioID'] . \" WHERE `linea` ='\" . $l . \"'\";\n mysqli_query($BDImportRecambios, $actu);\n $existente = 1;\n } else {\n $actu = \"UPDATE `listaprecios` SET `Estado`='nuevo' WHERE `linea` ='\" . $l . \"'\";\n mysqli_query($BDImportRecambios, $actu);\n $nuevo = 1;\n }\n\n\n $datos[0]['n'] = $nuevo;\n $datos[0]['e'] = $existente;\n $datos[0]['t'] = $l;\n return $datos;\n}", "public function criarBloco_1_Vazio()\n {\n $this->Sped->criarLinha('1', '1001', \"|1001|0|\");\n $this->Sped->criarLinha('1', '1010', \"|1010|N|N|N|N|N|N|N|N|N|N|N|N|N|\");\n $this->Sped->criarEncerramentoBloco('1', '1990', \"1990\");\n }", "public function addMembro($id_usuario, $id_grupo) {\n $sql = \"INSERT INTO grupos_membros SET id_usuario = '$id_usuario', id_grupo = '$id_grupo'\";\n $this->db->query($sql);\n }", "function gestionAction() {\n\t\t\tif (BLOQUEAR == 1){\n\t\t\t\t$this->render('appBloqueada');\n\t\t\t} else if ($this->security(true) && $_SESSION['user']->rol>=50) {\n\t\t\t\t$id;\n\t\t\t\t$datos;\n\t\t\t\t$nombre;\n\t\t\t\t$cambio = \"\";\n\t\t\t\t$error = \"\";\n\n\t\t\t\tif (isset($_POST['cobrar'])) {\n\t\t\t\t\tif (!empty($_POST['user_id'])) {\n\t\t\t\t\t\t$_SESSION['cobrar'] = 'cobrar';\n\t\t\t\t\t\t$_SESSION['user_id'] = $_POST['user_id'];\n\t\t\t\t\t\theader('Location: /taquillas/admin/cobrar/'.$_GET['id']);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$error = 'NIA necesario';\t\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif (isset($_GET['id'])) {\n\t\t\t\t\t$id = $_GET['id'];\n\t\t\t\t\t$search = array('id'=>$_GET['id']);\n\t\t\t\t\t$taquilla = Taquilla::findByAttributes($search);\n\t\t\t\t\t$datos = $taquilla[0];\n\t\t\t\t\t$nombre = User::findByNIA($datos->user_id);\n\t\t\t\t\t$nombre = $nombre->cn;\n\t\t\t\t}\n\n\t\t\t\tif (isset($_POST['gestion'])) {\n\t\t\t\t\t//Comprobación del dueño\n\t\t\t\t\tif (!empty($_POST['user_id']) && $_POST['estado'] != 1) {\n\t\t\t\t\t\tif(is_null(User::findByNIA($_POST['user_id']))) {\n\t\t\t\t\t\t\t$error = 'Usuario no encontrado';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(empty($_POST['fecha'])) {\n\t\t\t\t\t\t\t$error .= 'Necesaria una fecha si tiene dueño la taquilla';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t//Comprobación del estado\n\t\t\t\t\tif (!empty($_POST['estado'])) {\n\t\t\t\t\t\tif (($_POST['estado'] != 1) && ($_POST['estado'] != 2) && ($_POST['estado'] != 3) && ($_POST['estado'] != 4)) {\n\t\t\t\t\t\t\t$error .= 'Estado no válido';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (empty($_POST['user_id']) && ($_POST['estado'] == 2 || $_POST['estado'] == 3)) {\n\t\t\t\t\t\t\t$error .= 'Es necesario que la taquilla tenga un dueño';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//Comprobación de la fecha\n\t\t\t\t\tif (!empty($_POST['fecha']) && $_POST['estado'] != 1) {\n\t\t\t\t\t\tif (empty($_POST['user_id'])) {\n\t\t\t\t\t\t\t$error .= 'Si la taquilla está ocupada/reservada debe tener la fecha de ésta';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//ejecución correcta. Se comprueba que el mensaje de cambio no se ha modificado.\n\t\t\t\t\tif (strcmp($error,\"\") == 0) {\n\t\t\t\t\t\t$taquilla = Taquilla::findByAttributes(array('id' => $id));\n\t\t\t\t\t\t$datos = $taquilla[0];\n\t\t\t\t\t\t$usr = $_POST['user_id'];\n\t\t\t\t\t\t$fecha = $_POST['fecha'];\n\t\t\t\t\t\tif ($_POST['estado'] == 1) {\n\t\t\t\t\t\t\t$usr = NULL;\n\t\t\t\t\t\t\t$fecha = NULL;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (empty($usr)){\n\t\t\t\t\t\t\t$usr = NULL;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (empty($fecha)){\n\t\t\t\t\t\t\t$fecha = NULL;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$datos->user_id = $usr;\n\t\t\t\t\t\t$datos->estado = $_POST['estado'];\n\t\t\t\t\t\t$datos->fecha = $fecha;\n\t\t\t\t\t\t$datos->save();\n\t\t\t\t\t\t$cambio .= 'Cambios realizados correctamente';\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$this->render('modificarTaq',array('datos'=>$datos, 'nombre'=>$nombre, 'cambio' => $cambio, 'error' => $error));\n\t\t\t}\n\t\t}", "function cargar_data_registro_compra($nombre_anio='', $nombre_mes='', $nrocomprobante='', $limit='') {\n $ord = \" ORDER BY prosic_comprobante.id_anio , prosic_comprobante.id_mes DESC,prosic_comprobante.codigo_comprobante*1000 desc\";\n $sql = \"SELECT\n prosic_comprobante.id_comprobante\n , prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.status_comprobante\n , prosic_anexo.codigo_anexo\n , prosic_anexo.descripcion_anexo\n , prosic_subdiario.id_subdiario\n , prosic_subdiario.codigo_subdiario\n , prosic_subdiario.nombre_subdiario\n , prosic_anio.nombre_anio\n , prosic_mes.nombre_mes\n , prosic_tipo_comprobante.codigo_tipo_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n ,prosic_comprobante.nro_comprobante\n ,prosic_comprobante.serie_comprobante\n ,prosic_moneda.codigo_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo\n ON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_mes\n ON (prosic_comprobante.id_mes = prosic_mes.id_mes)\n INNER JOIN prosic_anio\n ON (prosic_comprobante.id_anio = prosic_anio.id_anio)\n INNER JOIN prosic_subdiario\n ON (prosic_comprobante.id_subdiario = prosic_subdiario.id_subdiario)\n INNER JOIN prosic_tipo_comprobante\n ON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_plan_contable\n ON (prosic_comprobante.id_plan_contable = prosic_plan_contable.id_plan_contable)\n INNER JOIN prosic_moneda\n ON (prosic_comprobante.id_moneda= prosic_moneda.id_moneda)\n WHERE prosic_comprobante.id_subdiario=3 \";\n if ($nombre_anio != '')$sql.=\" AND prosic_anio.nombre_anio='\" . $nombre_anio . \"'\";\n if ($nombre_mes != '')$sql.=\" AND prosic_mes.nombre_mes='\" . $nombre_mes . \"'\";\n if ($nrocomprobante != '')$sql.=\" AND prosic_comprobante.nro_comprobante like'%\" . $nrocomprobante . \"%' \";\n if ($ord != '')$sql.=$ord;\n if ($limit != '')$sql.=$limit;\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "public function RegistrarArqueoCaja()\n{\n\tself::SetNames();\n\tif(empty($_POST[\"codcaja\"]) or empty($_POST[\"montoinicial\"]) or empty($_POST[\"fecharegistro\"]))\n\t{\n\t\techo \"1\";\n\t\texit;\n\t}\n\n\t$sql = \"select codigo from cajas where codcaja = '\".$_POST[\"codcaja\"].\"'\";\n\tforeach ($this->dbh->query($sql) as $row)\n\t{\n\t\t$this->p[] = $row;\n\t}\n\t$codigo = $row['codigo'];\n\n\t$sql = \" select codcaja from arqueocaja where codcaja = ? and statusarqueo = '1'\";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array($_POST[\"codcaja\"]) );\n\t$num = $stmt->rowCount();\n\tif($num == 0)\n\t{\n\t\t$query = \" insert into arqueocaja values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?); \";\n\t\t$stmt = $this->dbh->prepare($query);\n\t\t$stmt->bindParam(1, $codcaja);\n\t\t$stmt->bindParam(2, $montoinicial);\n\t\t$stmt->bindParam(3, $ingresos);\n\t\t$stmt->bindParam(4, $egresos);\n\t\t$stmt->bindParam(5, $dineroefectivo);\n\t\t$stmt->bindParam(6, $diferencia);\n\t\t$stmt->bindParam(7, $comentarios);\n\t\t$stmt->bindParam(8, $fechaapertura);\n\t\t$stmt->bindParam(9, $fechacierre);\n\t\t$stmt->bindParam(10, $statusarqueo);\n\t\t$stmt->bindParam(11, $codigo);\n\n\t\t$codcaja = strip_tags($_POST[\"codcaja\"]);\n\t\t$montoinicial = strip_tags($_POST[\"montoinicial\"]);\n\t\tif (strip_tags(isset($_POST['ingresos']))) { $ingresos = strip_tags($_POST['ingresos']); } else { $ingresos =''; }\n\t\tif (strip_tags(isset($_POST['egresos']))) { $egresos = strip_tags($_POST['egresos']); } else { $egresos =''; }\n\t\tif (strip_tags(isset($_POST['dineroefectivo']))) { $dineroefectivo = strip_tags($_POST['dineroefectivo']); } else { $dineroefectivo =''; }\n\t\tif (strip_tags(isset($_POST['diferencia']))) { $diferencia = strip_tags($_POST['diferencia']); } else { $diferencia =''; }\n\t\tif (strip_tags(isset($_POST['comentarios']))) { $comentarios = strip_tags($_POST['comentarios']); } else { $comentarios =''; }\n\t\t$fechaapertura = strip_tags(date(\"Y-m-d h:i:s\",strtotime($_POST['fecharegistro'])));\n\t\t$fechacierre = strip_tags(date(\"0000-00-00 00:00:00\"));\n\t\t$statusarqueo = strip_tags(\"1\");\n\t\t$stmt->execute();\n\n\t\techo \"<div class='alert alert-success'>\";\n\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\techo \"<span class='fa fa-check-square-o'></span> EL ARQUEO DE CAJA FUE REALIZADO EXITOSAMENTE\";\n\t\techo \"</div>\";\t\t\n\t\texit;\n\t}\n\telse\n\t{\n\t\techo \"2\";\n\t\texit;\n\t}\n}", "public function ejecutarBloqueo() {\n if(!$this->consultaBloquear) return $this;\n\n $tablas=[[$this->nombre,$this->alias]];\n $this->buscarTablas($this,$tablas);\n\n $this->bd->bloquear($this->consultaBloquear,$tablas);\n\n return $this;\n }", "function bank_simple_call_resilier_abonnement($uid, $config){\n\n\tinclude_spip('inc/bank');\n\tif (!is_array($config)){\n\t\t$mode = sql_getfetsel(\"mode\", \"spip_transactions\", \"abo_uid=\" . sql_quote($uid) . \" AND statut=\" . sql_quote('ok') . \" AND mode LIKE \" . sql_quote($config . '%'));\n\t\t$config = bank_config($mode);\n\t}\n\n\t// tenter avec la gestion des recurrences internes au plugin\n\tinclude_spip('inc/bank_recurrences');\n\t$ok = bank_recurrence_terminer($uid, 'fini', false);\n\n\tif (!$ok) {\n\t\t// on envoie un mail au webmestre avec reference pour que le webmestre aille faire la resiliation manuellement\n\t\t$sujet = \"[\" . $GLOBALS['meta']['nom_site'] . \"] Demande Resiliation Abonnement \" . $config['presta'];\n\t\t$message = \"Abonne UID : $uid\\nTransactions :\\n\";\n\n\n\t\t$trans = sql_allfetsel(\"id_transaction,date_paiement,montant,devise\", \"spip_transactions\", \"abo_uid=\" . sql_quote($uid) . \" AND statut=\" . sql_quote('ok') . \" AND mode LIKE \" . sql_quote($config['presta'] . '%'));\n\t\tforeach ($trans as $tran){\n\t\t\t$message .= \"#\" . $tran['id_transaction'] . \" \" . $tran['date_paiement'] . \" \" . bank_affiche_montant($tran['montant'],$tran['devise'], true, true) . \"\\n\";\n\t\t}\n\n\t\t$envoyer_mail = charger_fonction(\"envoyer_mail\", \"inc\");\n\t\t$envoyer_mail($GLOBALS['meta']['email_webmaster'], $sujet, $message);\n\t}\n\n\treturn $ok;\n}", "function xthreads_admin_forumcommit_myplazaturbo_fix() {\r\n\tcontrol_object($GLOBALS['db'], '\r\n\t\tfunction insert_query($table, $array) {\r\n\t\t\tstatic $done=false;\r\n\t\t\tif(!$done && $table == \"forums\") {\r\n\t\t\t\t$done = true;\r\n\t\t\t\t$r = $GLOBALS[\"fid\"] = parent::insert_query($table, $array);\r\n\t\t\t\treturn $r;\r\n\t\t\t}\r\n\t\t\treturn parent::insert_query($table, $array);\r\n\t\t}\r\n\t');\r\n}", "function cargar_data_libro_banco($c_a_cuenta_banco, $limit, $nombre_mes='' , $cc='') {\n\t//$nombre_mes='DICIEMBRE';\n $sql = \"SELECT\n prosic_comprobante.id_comprobante\n , prosic_comprobante.codigo_comprobante\n , prosic_comprobante.emision_comprobante\n , prosic_comprobante.total_comprobante\n , prosic_comprobante.status_comprobante\n , prosic_anexo.codigo_anexo\n , prosic_subdiario.id_subdiario\n , prosic_subdiario.codigo_subdiario\n , prosic_subdiario.nombre_subdiario\n , prosic_anio.nombre_anio\n , prosic_mes.nombre_mes\n , prosic_tipo_comprobante.codigo_tipo_comprobante\n , prosic_tipo_comprobante.nombre_tipo_comprobante\n ,prosic_comprobante.nro_comprobante\n ,prosic_moneda.codigo_moneda\n FROM\n prosic_comprobante\n INNER JOIN prosic_anexo \tON (prosic_comprobante.id_anexo = prosic_anexo.id_anexo)\n INNER JOIN prosic_mes \tON (prosic_comprobante.id_mes = prosic_mes.id_mes)\n INNER JOIN prosic_anio \tON (prosic_comprobante.id_anio = prosic_anio.id_anio)\n INNER JOIN prosic_subdiario \tON (prosic_comprobante.id_subdiario = prosic_subdiario.id_subdiario)\n INNER JOIN prosic_tipo_comprobante\tON (prosic_comprobante.id_tipo_comprobante = prosic_tipo_comprobante.id_tipo_comprobante)\n INNER JOIN prosic_plan_contable ON (prosic_comprobante.cuenta_banco = prosic_plan_contable.id_plan_contable)\n INNER JOIN prosic_moneda\t ON (prosic_comprobante.id_moneda= prosic_moneda.id_moneda)\n WHERE prosic_comprobante.id_subdiario=8 AND prosic_comprobante.c_a_cuenta_banco='\" . $c_a_cuenta_banco . \"' \";\t\n\tif ($nombre_mes != '') $sql.= \" AND prosic_mes.nombre_mes = '\" . $nombre_mes . \"' \";\n\tif ($cc != '') $sql.=\" AND prosic_comprobante.codigo_comprobante = '\" . $cc . \"' \";\n\t$sql.=\" ORDER BY MONTH(prosic_comprobante.emision_comprobante) DESC , prosic_comprobante.codigo_comprobante*10000 DESC\";\n\t//$sql.=\" ORDER BY prosic_comprobante.status_comprobante DESC, MONTH(prosic_comprobante.emision_comprobante), prosic_comprobante.emision_comprobante\";\n\tif ($limit != '')$sql.=\" \" . $limit . \" \";\n $result = $this->Consulta_Mysql($sql);\n return $result;\n }", "function saveQueue($request) {\n\n if(isset($request['Statistic_type']) && $request['Statistic_type'] !='') {\n if($request['Statistic_type'] == 'all') {\n $this->insertQueue($request,'Avalue');\n $this->insertQueue($request,'Pvalue');\n $this->insertQueue($request,'Ritvalue');\n } else {\n $this->insertQueue($request);\n }\n }\n return true;\n }", "function synchronizeCuentaBancaria(){\n $this->procedimiento='sigep.ft_cuenta_bancaria_ime';\n $this->transaccion='SIGEP_CUEN_BAN_SYNC';\n $this->tipo_procedimiento='IME';\n\n /************************************************ token ************************************************/\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://sigep.sigma.gob.bo/rsseguridad/apiseg/token?grant_type=refresh_token&client_id=0&redirect_uri=%2Fmodulo%2Fapiseg%2Fredirect&client_secret=0&refresh_token=FEA520426600:Wk5yBGCh5TeT8jUG5lPkwIT25Jmlwav5XqtxhCrmgr5Yc0iaAMPZgLILZZPC7mjxk5tUgVusBs0RXlSDkIuWq2qNat2KsUM3E4q7\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_HTTPHEADER => array(\n \"cache-control: no-cache\",\n \"content-type: application/x-www-form-urlencoded\"\n ),\n ));\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n $token_response = json_decode($response);\n $access_token = $token_response->{'access_token'};\n /************************************************ token ************************************************/\n\n /************************************************ perfil ************************************************/\n //$jsonConverter = new StandardConverter();\n $param_p = array(\"gestion\" => \"2022\", \"perfil\" => \"915\");\n //$param_p = $jsonConverter->encode($param_p);\n $param_p = json_encode($param_p);\n $curl_p = curl_init();\n\n $curl_array_p = array(\n CURLOPT_URL => 'https://sigep.sigma.gob.bo/rsbeneficiarios/api/cambiaperfil',\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => 'PUT',\n CURLOPT_HTTPHEADER => array(\n \"Authorization: bearer \" . $access_token,\n \"Cache-Control: no-cache\",\n \"Content-Type: application/json\"\n ),\n CURLOPT_POSTFIELDS => $param_p\n );\n\n curl_setopt_array($curl_p,$curl_array_p);\n $response_p = curl_exec($curl_p);\n $err_p = curl_error($curl_p);\n $http_code_p = curl_getinfo( $curl_p, CURLINFO_HTTP_CODE );\n curl_close($curl_p);\n /************************************************ perfil ************************************************/\n\n /************************************************ cuentas ************************************************/\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://sigep.sigma.gob.bo/rsclasificadores/api/v1/cuentasbancarias/cuentabancaria?idEntidad=494&fechaConsulta=04-07-2022\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 30,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"GET\",\n CURLOPT_HTTPHEADER => array(\n \"Authorization: bearer \" . $access_token,\n \"Cache-Control: no-cache\",\n \"Postman-Token: 011d15eb-f4ff-48db-85a6-1b380958342b\"\n ),\n ));\n\n $response = curl_exec($curl);\n $err = curl_error($curl);\n\n curl_close($curl);\n\n //var_dump('$response',/*curl_getinfo($curl),*/ json_decode($response)->data);exit;\n /************************************************ cuentas ************************************************/\n //$this->objParam->addParametro('jsonData', json_decode($response)->data);\n $this->arreglo['jsonData'] = json_encode(json_decode($response)->data);\n //Define los parametros para la funcion\n $this->setParametro('jsonData','jsonData','jsonb');\n\n //Ejecuta la instruccion\n $this->armarConsulta();\n //echo ($this->consulta);exit;\n $this->ejecutarConsulta();\n\n //Devuelve la respuesta\n return $this->respuesta;\n }", "function buscar_links($id){\n $this->asignar_valores();\n $sql=\"SELECT * FROM linkxsub, sublink WHERE link_rel='$id' AND sublink_rel=id_sub ORDER BY prioridad_sub\";\n $buscar=mysql_query($sql);\n unset($this->listado2);\n while ($resultado = mysql_fetch_array($buscar)){\n $this->mensaje=\"si\";\n $this->listado2[] = $resultado;\n }\n\n }", "function add_branche($data)\r\r\n\t{\r\r\n\t\t$this->db->insert($this->_table_branches,$data);\r\r\n\t\t\r\r\n\t\treturn TRUE;\r\r\n\t}", "public function clonarBloque($bloque,$auditorioDia=null) {\n\t\t$nuevo_bloque = new Bloque();\n\t\t$nuevo_bloque->setNombre($bloque->getNombre());\n\t\t$nuevo_bloque->setTienePresentaciones($bloque->getTienePresentaciones());\n\t\t$nuevo_bloque->setDuracion($bloque->getDuracion());\n\t\t$nuevo_bloque->setHoraInicio($bloque->getHoraInicio());\n\t\t$nuevo_bloque->setAuditorioDia($bloque->getAuditorioDia());\t\n\t\t$nuevo_bloque->setEjesTematicos($bloque->getEjesTematicos()->toArray());\n\t\t$nuevo_bloque->setAreasReferencia($bloque->getAreasReferencia()->toArray());\n\t\t\n\t\t//$nuevo_bloque = clone $bloque;\n\t\t//$nuevo_bloque->setId(null);\n\t\treturn $nuevo_bloque;\n\t}", "public function run()\n {\n\n ini_set('memory_limit', '4G');\n set_time_limit(0);\n\n\n $bbddArr = [];\n //Lo primero será coger las bbdds\n $bbddTmp = DB::connection('segmentation')->table('bbdd_lists')->get();\n foreach ($bbddTmp as $key => $bbddItem) {\n $bbddArr[$bbddItem->val] = $bbddItem->id;\n }\n $db = DB::connection('segmentation')->getPdo();\n $q = \"SELECT id,bbdd_subscribed as val FROM bbdd_subscribers\";\n $query = $db->prepare($q);\n $query->execute();\n $arrIns = [];\n $cont = 0;\n while ($item = $query->fetch()) {\n\t\t\t// process data\n //dd($item);\n $val = explode(',', $item['val']);\n foreach ($val as $userBbdd) {\n $arrIns [] = ['id'=>$item['id'],'id_val'=>$bbddArr[strtoupper($userBbdd)]];\n }\n $cont ++;\n if ($cont>2000) {\n $cont = 0;\n DB::connection('segmentation')->table('bbdd_users')->insertIgnore($arrIns);\n unset($arrIns);\n $arrIns = [];\n\n }\n }\n if (!empty($arrIns))\n DB::connection('segmentation')->table('bbdd_users')->insertIgnore($arrIns);\n \n\n }", "public function BuscarComprasFechas() \n\t{\n\t\tself::SetNames();\n\t\t$sql = \" SELECT compras.codcompra, compras.subtotalivasic, compras.subtotalivanoc, compras.ivac, compras.totalivac, compras.descuentoc, compras.totaldescuentoc, compras.totalc, compras.statuscompra, compras.fechavencecredito, compras.fechacompra, proveedores.ritproveedor, proveedores.nomproveedor, SUM(detallecompras.cantcompra) AS articulos FROM (compras INNER JOIN proveedores ON compras.codproveedor = proveedores.codproveedor) INNER JOIN usuarios ON compras.codigo = usuarios.codigo LEFT JOIN detallecompras ON detallecompras.codcompra = compras.codcompra WHERE DATE_FORMAT(compras.fechacompra,'%Y-%m-%d') >= ? AND DATE_FORMAT(compras.fechacompra,'%Y-%m-%d') <= ? GROUP BY compras.codcompra\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindValue(1, trim(date(\"Y-m-d\",strtotime($_GET['desde']))));\n\t\t$stmt->bindValue(2, trim(date(\"Y-m-d\",strtotime($_GET['hasta']))));\n\t\t$stmt->execute();\n\t\t$num = $stmt->rowCount();\n\t\tif($num==0)\n\t\t{\n\t\t\techo \"<div class='alert alert-danger'>\";\n\t\t\techo \"<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>&times;</button>\";\n\t\t\techo \"<center><span class='fa fa-info-circle'></span> NO EXISTEN COMPRAS DE PRODUCTOS PARA EL RANGO DE FECHA INGRESADO</center>\";\n\t\t\techo \"</div>\";\n\t\t\texit;\n\t\t}\n\t\telse\n\t\t{\n\t\t\twhile($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$this->p[]=$row;\n\t\t\t\t}\n\t\t\t\treturn $this->p;\n\t\t\t\t$this->dbh=null;\n\t\t\t}\n\t\t}", "public function crear_rapido(&$array_ids_b, $duplicar=false)\n\t{\n\t\t//del tipo b... Ignora por completo los posibles atributos de\n\t\t//la relación y no construye los items del tipo B... En resumen,\n\t\t//lo hace lo más rápido y ligero posible.\n\t\t//Al finalizar nos devuelve un array con los ids de entrada\n\t\t//que se han creado en la tabla de relación. De este modo \n\t\t//podemos intentar, por ejemplo, componerlos luego con datos\n\t\t//de relación. El orden en que los devuelve es el mismo que el\n\t\t//orden en que los da.\n\n\t\tif(!count($array_ids_b))\n\t\t{\n\t\t\t$resultado=array();\n\t\t}\n\t\telse\t\n\t\t{\n\t\t\tif(!$duplicar)\n\t\t\t{\n\t\t\t\tif(!$this->bandera_carga) die('ERROR: Abstraccion_relacion_m_n no es posible inserción segura sin cargar');\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//Sacamos un array de \"ids_b\" que tenemos en la relación...\n\t\t\t\t\t//Estos arrays van a depender de los criterios que \n\t\t\t\t\t//hemos especificado al cargar la relación, por lo que deberíamos\n\t\t\t\t\t//tener algo de cuidado. También es interesante\n\t\t\t\t\t//que podemos meter perfectamente ids de items\n\t\t\t\t\t//que NO existen.\n\n\t\t\t\t\tif(!count($this->array_items)) $array_final=$array_ids_b;\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$ids_existentes=array();\n\n\t\t\t\t\t\tforeach($this->array_items as $clave=>&$valor)\t\n\t\t\t\t\t\t\t$ids_existentes[]=$valor->acc_propiedad($this->id_b_relacion);\n\n\t\t\t\t\t\tforeach($array_ids_b as $clave => $valor)\t//Por cada item comparamos...\n\t\t\t\t\t\t\tif(!in_array($valor, $ids_existentes))\t//Sólo si no lo encontramos puede pasar.\n\t\t\t\t\t\t\t\t$array_final[]=$valor;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse $array_final=&$array_ids_b;\n\n\t\t\t//Ahora recorremos el array final y realizamos las inserciones.\n\t\t\t//Se realizan todas de una tacada, simplemente.\n\n\t\t\t$resultado=array();\n\n\t\t\tif(count($array_final))\n\t\t\t{\n\t\t\t\t$id_a=$this->item_a->ID_INSTANCIA();\n\t\t\t\tforeach($array_final as $clave => $valor)\t\n\t\t\t\t\t$resultado[]=Item_abstraccion_relacion_m_n::crear_entrada($this->tabla_relacion, $this->id_a_relacion, $this->id_b_relacion, $id_a, $valor);\n\t\t\t}\n\t\t}\n\n\t\treturn $resultado;\n\t}", "function xthreads_admin_forumcommit_myplazaturbo_fix() {\r\n\tcontrol_db('\r\n\t\tfunction insert_query($table, $array) {\r\n\t\t\tstatic $done=false;\r\n\t\t\tif(!$done && $table == \"forums\") {\r\n\t\t\t\t$done = true;\r\n\t\t\t\t$r = $GLOBALS[\"fid\"] = parent::insert_query($table, $array);\r\n\t\t\t\treturn $r;\r\n\t\t\t}\r\n\t\t\treturn parent::insert_query($table, $array);\r\n\t\t}\r\n\t');\r\n}", "public function queue() {\n\t\t$this->prepareMessage();\n\t\t$this->queueRepository->add($this->toArray());\n\t}", "private function suprimirByRecibo()\r\n\t\t{\r\n\t\t\t$result = false;\r\n\t\t\tif ( $this->_recibo > 0 ) {\r\n\t\t\t\t$arregloCondicion = [\r\n\t\t\t\t\t'recibo' => $this->_recibo,\r\n\t\t\t\t];\r\n\t\t\t\t$result = self::suprimir($arregloCondicion);\r\n\t\t\t}\r\n\t\t\treturn $result;\r\n\t\t}", "public function crearprimerbloque($m1, $m2, $m3, $m4,$m5,$m6,$m7){\n $obj_bloque1=new motivacioneducativaprimerbloque();\n \n $obj_bloque1->setM1($m1); \n $obj_bloque1->setM2($m2); \n $obj_bloque1->setM3($m3); \n $obj_bloque1->setM4($m4); \n $obj_bloque1->setM5($m5); \n $obj_bloque1->setM6($m6); \n $obj_bloque1->setM7($m7);\n \n\n \n\n return MotivacionDao::crearprimerbloque($obj_bloque1);\n\n\n }", "function formidablepaiement_bank_traiter_reglement($flux){\n\n\t// si c'est une transaction associee a un form\n\tif ($id_transaction = $flux['args']['id_transaction']\n\t AND preg_match(\",form\\d+:,\",$flux['args']['avant']['parrain'])\n\t AND $id_formulaires_reponse = $flux['args']['avant']['tracking_id']){\n\n\t\t$reponse = sql_fetsel('*','spip_formulaires_reponses','id_formulaires_reponse='.intval($id_formulaires_reponse));\n\t\t$formulaire = sql_fetsel('*','spip_formulaires','id_formulaire='.intval($reponse['id_formulaire']));\n\n\t\t$traitements = unserialize($formulaire['traitements']);\n\t\tif ($message = trim($traitements['paiement']['message'])){\n\t\t\tinclude_spip(\"inc/texte\");\n\t\t\t$flux['data'] .= propre($message);\n\t\t}\n\t}\n\n\treturn $flux;\n}", "public function Bloco9()\n {\n $this->Sped->criarLinha('9', '9001', \"|9001|0|\"); //inicio bloco 9\n\n //incrementa antes pois essas linhas foram adicionadoas depois do for\n $this->Sped->incrementContadorBlocoRegistro('9990');\n $this->Sped->incrementContadorBlocoRegistro('9999');\n\n foreach ($this->Sped->getBlocosTotalizadores() as $bloco => $qtd) {\n $this->Sped->criarLinha('9', '9900', \"|9900|$bloco|$qtd|\");\n }\n\n $this->Sped->criarEncerramentoBloco('9', '9900', \"9900|9900\", -1);\n $this->Sped->criarEncerramentoBloco('9', '9990', \"9990\", 1);\n $this->Sped->criarLinha('9', '9999', \"|9999|\" . ($this->Sped->getTotalLinhas() + 1) . '|');\n }", "public function recus($id=0,$liste=0) {\n $id = $this->session->id;\n\n // commandes globales\n $cmd_globales = array(\n );\n\n // toolbar\n $toolbar = '';\n\n // descripteur\n $descripteur = array(\n 'datasource' => 'messages/recus',\n 'detail' => array('messages/detail_recu','msg_id','msg_envoi'),\n 'champs' => array(\n array('msg_id','id',\"Identifiant\"),\n array('msg_envoi','datetime',\"Date d'envoi\"),\n array('msg_lecture','datetime',\"Date de lecture\"),\n array('utl_login','ref',\"Émetteur\",'utilisateurs','msg_emetteur','utl_login'),\n array('msg_amorce','text',\"Début du message\"),\n array('RowID','text',\"__DT_Row_ID\")\n ),\n 'en_avant' => array(\n array(\"msg_lecture == '0000-00-00 00:00:00'\",'font-weight:bold')\n ),\n 'filterable_columns' => $this->m_messages->liste_recus_filterable_columns()\n );\n\n $this->session->set_userdata('_url_retour',current_url());\n $scripts = array();\n $scripts[] = $this->load->view(\"templates/datatables-js\",\n array(\n 'id'=>$id,\n 'descripteur'=>$descripteur,\n 'toolbar'=>$toolbar,\n 'controleur' => 'messages',\n 'methode' => __FUNCTION__,\n ),true);\n\n // listes personnelles\n $vues = $this->m_vues->vues_ctrl('messages',$this->session->id);\n $data = array(\n 'title' => \"Liste des messages recus\",\n 'page' => \"templates/datatables\",\n 'menu' => \"Personnel|Messages reçus\",\n 'scripts' => $scripts,\n 'barre_action' => $this->barre_action[\"Liste_r\"],\n 'controleur' => 'messages',\n 'methode' => __FUNCTION__,\n 'values' => array(\n 'id' => $id,\n 'vues' => $vues,\n 'cmd_globales' => $cmd_globales,\n 'toolbar'=>$toolbar,\n 'descripteur' => $descripteur\n )\n );\n $layout=\"layouts/datatables\";\n $this->load->view($layout,$data);\n }", "public function buscar_rango($sender, $param)\n {\n $cadena=$this->drop_rango->text; \n $desde=substr($cadena, 0, 10); \n $hasta=substr($cadena, 13); \n //obtengo la cuenta del total de registros que esten entre las fechas desde/hasta\n $sql=\"select count(*) from evaluaciones.datos_evaluados join evaluaciones.calificaciones on evaluaciones.datos_evaluados.codigo=evaluaciones.calificaciones.evaluacion_asociada where(desde='$desde' and hasta='$hasta')\";\n $resultado=cargar_data($sql, $sender); \n //obtengo la cuenta del total de registros que esten entre las fechas desde/hasta yque ademas tenga actuacion muy por debajo de lo esperado\n $sql=\"select count(*) from evaluaciones.datos_evaluados join evaluaciones.calificaciones on evaluaciones.datos_evaluados.codigo=evaluaciones.calificaciones.evaluacion_asociada where(actuacion='Muy por debajo de lo esperado' and desde='$desde' and hasta='$hasta')\";\n $resultado=cargar_data($sql, $sender);\n $muy_por_debajo=$resultado[0]['count(*)']; \n //obtengo la cuenta del total de registros que esten entre las fechas desde/hasta yque ademas tenga actuacion por debajo de lo esperado\n $sql=\"select count(*) from evaluaciones.datos_evaluados join evaluaciones.calificaciones on evaluaciones.datos_evaluados.codigo=evaluaciones.calificaciones.evaluacion_asociada where(actuacion='Por debajo de lo esperado' and desde='$desde' and hasta='$hasta')\";\n $resultado=cargar_data($sql, $sender);\n $por_debajo=$resultado[0]['count(*)']; \n //obtengo la cuenta del total de registros que esten entre las fechas desde/hasta yque ademas tenga actuacion dentro de lo esperado\n $sql=\"select count(*) from evaluaciones.datos_evaluados join evaluaciones.calificaciones on evaluaciones.datos_evaluados.codigo=evaluaciones.calificaciones.evaluacion_asociada where(actuacion='Dentro de lo esperado' and desde='$desde' and hasta='$hasta')\";\n $resultado=cargar_data($sql, $sender);\n $dentro_lo_esperado=$resultado[0]['count(*)']; \n //obtengo la cuenta del total de registros que esten entre las fechas desde/hasta yque ademas tenga actuacion sobre lo esperado\n $sql=\"select count(*) from evaluaciones.datos_evaluados join evaluaciones.calificaciones on evaluaciones.datos_evaluados.codigo=evaluaciones.calificaciones.evaluacion_asociada where(actuacion='Sobre lo esperado' and desde='$desde' and hasta='$hasta')\";\n $resultado=cargar_data($sql, $sender);\n $sobre_lo_esperado=$resultado[0]['count(*)']; \n //obtengo la cuenta del total de registros que esten entre las fechas desde/hasta yque ademas tenga actuacion excepcional\n $sql=\"select count(*) from evaluaciones.datos_evaluados join evaluaciones.calificaciones on evaluaciones.datos_evaluados.codigo=evaluaciones.calificaciones.evaluacion_asociada where(actuacion='Excepcional' and desde='$desde' and hasta='$hasta')\";\n $resultado=cargar_data($sql, $sender);\n $excepcional=$resultado[0]['count(*)']; \n //genera un aleatorio para asignarselo al nombre del .png del grafico\n $demo=rand(100,99999);\n //crea el grafico\n $grafico=new verticalbarchart();\n //crea un arreglo con los valores del grafico\n $datos = new XYDataSet();\n //añade elementos al arreglo que contiene los valores del grafico\n $datos->addPoint(new Point(\"Muy por debajo de lo esperado\", $muy_por_debajo));\n $datos->addPoint(new Point(\"Por debajo\", $por_debajo));\n $datos->addPoint(new Point(\"Dentro lo esperado\", $dentro_lo_esperado));\n $datos->addPoint(new Point(\"sobre lo esperado\", $sobre_lo_esperado));\n $datos->addPoint(new Point(\"Excepcional\", $excepcional));\n $grafico->setDataSet($datos);\n //pone el titulo del grafico\n $grafico->setTitle(\"Grafica de las categorías de actuación\");\n //genera el grafico\n $grafico->render(\"imagenes/temporales/\".$demo.\"_E1.png\");\n $this->grafico->ImageUrl = \"imagenes/temporales/\".$demo.\"_E1.png\";\n }", "private function addReglamentToRemains():void {\n\t\t$this->remains->push([\n\t\t\t'technick_id' => $this->technickId,\n\t\t\t'object_id' => $this->object->id,\n\t\t\t'tbl_name' => $this->device->tbl_name,\n\t\t\t'reglament_id' => $this->reglament->id,\n\t\t\t'reglament' => $this->reglament,\n\t\t\t'object_device_id' => $this->device->id,\n\t\t]);\n\t}", "public function run()\n {\n #primer año\n $this->agregar(7713,[5793,5912],[],[],[5793,5912]); # ipoo\n $this->agregar(7791,[5793,5912],[],[],[5793,5912]); # lenguajes formales\n\n #segundo \n $this->agregar(7655,[5551,7713],[5793],[],[5551,7713,5793]); # ED\n $this->agregar(7949,[7713,7791],[5912],[],[7713,7791,5912]); # tdp\n $this->agregar(5552,[],[5551],[],[5551]); # am2\n $this->agregar(5744,[7791,7655],[7713],[],[7791,7655,7713]); # orga\n $this->agregar(7951,[7655],[7713],[],[7655,7713]); # tdp\n\n #tercero\n $this->agregar(5534,[7951],[7655],[],[7951,7655]); # ayds\n $this->agregar(5561,[5744],[7791],[],[5744,7791]); # arqui\n $this->agregar(5704,[7951],[7949],[],[7951,7951]); # logica\n $this->agregar(7552,[5704,5534],[],[],[5704,5534]); # bases de datos\n $this->agregar(7810,[5552],[7791,7655],[],[5552,7791,7655]); # mcc\n $this->agregar(7820,[7791],[5551,5793],[],[7791,5551,5793]); # estadsitica\n $this->agregar(7925,[5561],[5744],[],[5561,5744]); # soyd\n\n #cuarto\n $this->agregar(5587,[7552],[5534],[],[7552,5534]); # dyds\n $this->agregar(5696,[7925,7552],[5704],[],[7925,7552,5704]); # lenguajes de prog\n $this->agregar(7903,[7925],[],[],[7925]); #redes\n $this->agregar(7502,[5587],[],[],[5587]); # aps\n $this->agregar(5576,[5696],[],[],[5696]); # compiladores\n $this->agregar(5684,[7552],[5704],[],[7552,5704]); # IA\n\n #quinto\n $this->agregar(5523,[5704,7810],[7951],[],[5704,7810,7951]); # algoritmos\n $this->agregar(7680,[5587,7903],[7552],[],[5587,7903,7552]); # iaw\n\n }", "function Debloquer($utilisateur1,$utilisateur2){\r\n $conn = mysqli_connect(\"localhost\", \"root\", \"\", \"bddfinale\");\r\n $requete = \"SELECT Id_blocage FROM blocage WHERE (Bloqueur='$utilisateur1' AND Bloque='$utilisateur2')\";\r\n $ligne= mysqli_query($conn, $requete);\r\n $n = mysqli_num_rows($ligne);\r\n if ($n > 0) {\r\n //supprime la ligne correspondant à ce blocage dans le BDD \r\n $requete = \"DELETE FROM blocage WHERE (Bloqueur='$utilisateur1' AND Bloque='$utilisateur2')\";\r\n $ligne= mysqli_query($conn, $requete);\r\n } \r\n mysqli_close($conn);\r\n }", "function ver_buscar_mapa($fid_string=\" \",$presenta=0,$idmapa=0,$intensidad){\n \n $plantilla = new DmpTemplate(\"../../../plantillas/stakeholder/mapa/ver_mapa.html\");\n \n //echo \"intensidad : $intensidad\";\n \n if($intensidad>0){\n $plantilla->iniciaBloque(\"intensidad\");\n }\n \n $imapa = new imapa();\n \n $result1 = $imapa->get_mapa();\n \n $nombres = array();\n \n $count=0;\n \n $modo=0;\n \n $color=array(\"#B19CD9\",\"#FF6961\",\"#77DD77\",\"#CFCFC4\",\"#FDFD96\");\n \n $stroke=array(\"#966FD6\",\"#C23B22\",\"#03C03C\",\"#836953\",\"#FFB347\");\n \n while($mapa= mysql_fetch_array($result1)){\n $count++;\n \n $plantilla->iniciaBloque(\"mapa\");\n $plantilla->reemplazaEnBloque(\"idmapa\", $mapa[idgis_mapa],\"mapa\");\n $plantilla->reemplazaEnBloque(\"nombre\", $mapa[nombre],\"mapa\");\n \n if( $mapa[idgis_mapa]==$idmapa || ( $mapa[predeterminado]>0 && $idmapa==0 ) ){\n \n $plantilla->reemplazaEnBloque(\"selected\", \"selected\",\"mapa\");\n \n $plantilla->reemplaza(\"frontera\", $mapa[frontera]);\n $plantilla->reemplaza(\"enfoque\", $mapa[enfoque]);\n $plantilla->reemplaza(\"resolucion\", $mapa[resolucion]);\n $plantilla->reemplaza(\"proyeccion\", $mapa[proyeccion]);\n $plantilla->reemplaza(\"unidad\", $mapa[unidad]);\n\n $i=0;\n $nombre=\"\";\n $result2 = $imapa->get_capa_mapa($mapa[idgis_mapa]);\n while($capa= mysql_fetch_array($result2)){\n $nombre=$capa[nombre];\n $nombres[$nombre]=$nombre;\n if($modo>0){\n $plantilla->iniciaBloque(\"capa\");\n $plantilla->reemplazaEnBloque(\"i\", $i, \"capa\");\n\n $plantilla->reemplazaEnBloque(\"nombre\", $nombre, \"capa\");\n\n\n $plantilla->reemplazaEnBloque(\"proyeccion\", $capa[proyeccion], \"capa\");\n if($capa[base]>0){\n $plantilla->reemplazaEnBloque(\"base\", \"true\", \"capa\");\n }else{\n \n $plantilla->reemplazaEnBloque(\"base\", \"false\", \"capa\");\n }\n }else{\n $plantilla->iniciaBloque(\"gml\"); \n $plantilla->reemplazaEnBloque(\"i\", $i, \"gml\");\n $plantilla->reemplazaEnBloque(\"nombre\", $nombre, \"gml\");\n $plantilla->reemplazaEnBloque(\"color\", $color[($i%5)], \"gml\");\n $plantilla->reemplazaEnBloque(\"stroke\", $stroke[($i%5)], \"gml\");\n if($capa[base]>0){\n $plantilla->reemplazaEnBloque(\"base\", \"true\", \"gml\");\n }else{ \n $plantilla->reemplazaEnBloque(\"base\", \"false\", \"gml\");\n }\n } \n $i++;\n }\n $capas=\" \";\n\n foreach ($nombres as $nombre){\n $capas .= $nombre.\",\";\n }\n\n\n $capas = substr($capas, 0, -1);\n\n\n $plantilla->reemplaza(\"i\", $i);\n $plantilla->reemplaza(\"nombre\", $nombre);\n $plantilla->reemplaza(\"capas\", $capas);\n $plantilla->reemplaza(\"fid_string\", $fid_string);\n \n }\n \n \n }\n \n if($count==0){\n $plantilla = new DmpTemplate(\"../../../plantillas/stakeholder/mapa/no_mapa.html\");\n }\n \n if($presenta>0){\n $plantilla->presentaPlantilla();\n }else{\n return $plantilla->getPlantillaCadena();\n }\n \n}", "public function pesquisarMembroDao($obj){\r\n \r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoMembro.php\");\r\n \r\n $objConexao = Connection::getInstance();\r\n $objMembro = new objetoMembro();\r\n \r\n $busca = mysql_query(\"Select * from membros where Nome like '%$obj%'\") or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n $reg = mysql_fetch_assoc($busca);\r\n \r\n\tif($reg != \"\"){\r\n\r\n $objMembro->setMatricula($reg['Matricula']); $objMembro->setNome($reg['Nome']);\r\n $objMembro->setSexo($reg['Sexo']); $objMembro->setData($reg['DataNascimento1']); $objMembro->setRg($reg['Rg']);\r\n $objMembro->setCpf($reg['Cpf']); $objMembro->setEstadocivil($reg['EstadoCivil']);\r\n $objMembro->setNatural($reg['Naturalidade']); $objMembro->setProfissao($reg['Profissao']); $objMembro->setEscola($reg['Escolaridade']); \r\n $objMembro->setPai($reg['Pai']); $objMembro->setMae($reg['Mae']); $objMembro->setNecessidade($reg['NecessidadeEspeciais']);\r\n\t $objMembro->setFone($reg['Fone']); $objMembro->setFilho($reg['Filho']); $objMembro->setFormacao($reg['FormacaoEclesiatica']);\r\n $objMembro->setMembrasia($reg['IntegracaoMembrasia']); $objMembro->setFuncao($reg['Funcao']); $objMembro->setParticipou($reg['JaParticipou']);\r\n\t $objMembro->setTrabalhando($reg['Trabalhando']); $objMembro->setViajando($reg['EstadoAtual']); $objMembro->setCongrega($reg['Congrega']); \r\n $objMembro->setRua($reg['Rua']); $objMembro->setBairro($reg['Bairro']); $objMembro->setCasa($reg['Casa']); $objMembro->setStatus($reg['Status']);\r\n $objMembro->setEmail($reg['tx_email']);\r\n $objMembro->setLider($reg['LiderCelula']);\r\n\r\n return $objMembro;\r\n }\r\n else{\r\n \r\n }\r\n \r\n mysql_free_result($busca); //limpa o resultado da pesquisa libera a memoria ocupado\r\n $objConexao->freebanco(); // fecha a conec��o com o banco\r\n\r\n }", "public function loadChargeProcesses() {\n $this->logger->debug(\"== En loadchargeProcesses == \");\n\n $sql = \"SELECT cs.id, carrier, suscriptionId, cantidad_intentos, tipo, dias_reintentos\n FROM suscriptions.cobros_suscripciones cs INNER JOIN suscriptions.horarios_cobros hc ON cs.id = hc.id_cobro_suscripcion\n inner join suscriptions.suscriptions s on s.id = cs.suscriptionId\n WHERE hour(hora) = hour(curtime())\";\n //WHERE concat(hour(hora), ':', minute(hora)) = concat(hour(curtime()),':',minute(curtime()))\";\n\n $this->logger->debug(\"SQL generado: \" . $sql);\n $rs = mysql_query($sql, $this->db);\n if($rs) {\n while($row = mysql_fetch_assoc($rs)) {\n $proceso = new ProcesoCobro($row['id'], $row['carrier'], $row['suscriptionId'],\n $row['cantidad_intentos'], $row['tipo'],\n $row['dias_reintentos'],\n $this->db);\n $this->procesos[] = $proceso;\n }\n } else {\n $this->logger->error(\"SQL ERROR: \" . mysql_error() .\" :: $sql \");\n }\n\n $this->logger->debug(\"== Cantidad de procesos cargados: \" . count($this->procesos));\n $this->logger->info(\"== Cantidad de procesos de cobro cargados: \" . count($this->procesos));\n }", "function guardarReclamo()\n\t\t{\n\t\t}", "function contador($nombretabla, $BDImportRecambios,$ConsultaImp) {\n\t// Inicializamos array\n $Tresumen['n'] = 0; //nuevo\n $Tresumen['t'] = 0; //total\n $Tresumen['e'] = 0; //existe\n\t$Tresumen['v'] = 0; //existe\n\t\n\t// Contamos los registros que tiene la tabla\n \t$total = 0;\n $whereC = '';\n $total = $ConsultaImp->contarRegistro($BDImportRecambios,$nombretabla,$whereC);\n $Tresumen['t'] = $total; // total registros\n\t\t\n // Obtenemos lineas de registro en blanco y contamos cuantas\n\t$whereC = \" WHERE trim(Estado) = ''\";\n\t$campo[1]= 'RefFabPrin';\n\t$campo[2]= 'linea';\n\t$RegistrosBlanco = $ConsultaImp->registroLineas($BDImportRecambios,$nombretabla,$campo,$whereC);\n\t// Como queremos devolver javascript los creamos\n\t$Tresumen['v'] = $RegistrosBlanco['NItems'];\n\t$Tresumen['LineasRegistro'] = $RegistrosBlanco; //Registros en blanco\n \n \n\t// Contamos los registros que tiene la tabla nuevo\n\t$total = 0;\n\t$whereC = \" WHERE Estado = 'nuevo'\";\n $total = $ConsultaImp->contarRegistro($BDImportRecambios,$nombretabla,$whereC);\n $Tresumen['n'] = $total; //nuevo\n\t\n\t\n\t\n\t\n\t\n\t\n\t// Contamos los registros que tiene la tabla existente\n\t$total = 0;\n\t$whereC = \" WHERE Estado = 'existe'\";\n $total = $ConsultaImp->contarRegistro($BDImportRecambios,$nombretabla,$whereC);\n\t$Tresumen['e'] = $total; //existe\n return $Tresumen;\n}", "public function commit() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n if (!$this->_ids || count($this->_ids) == 0) {\n if ($this->size() == 0) {\n return; \n }\n }\n \n foreach ($this->_ids as $id => $action) {\n try {\n $db->beginTransaction();\n $sql = \"DELETE FROM \".$this->_dbtp.\"queue WHERE \".$this->_dbqp.\"id=? \".\n \"AND \".$this->_dbqp.\"op=?\";\n $db->query($sql, array($id, $action)); \n $sql = \"INSERT INTO \".$this->_dbtp.\"queue (\".$this->_dbqp.\"id,\".$this->_dbqp.\"op) VALUES (?,?)\";\n $db->query($sql, array($id, $action));\n $db->commit();\n }\n catch(Exception $ex) {\n $db->rollBack();\n $log->err($ex);\n return false;\n }\n unset($this->_ids[$id]);\n }\n\n // reset cached object ids\n $this->_ids = array();\n $this->triggerUpdate(); \n return true;\n }", "public static function enqueue();", "public function generarComprobante(){\r\n\t\t$inicio = $_POST['fechainicio'];\r\n\t\t$fin = $_POST['fechafin'];\r\n\t\t//$estadoCobro = $_POST['nameCheck'];\r\n\t\t$canales=$_POST['canales'];\r\n\r\n\t\t$serie = $_POST['numSerie'];\r\n\t\t$idPlan = $_POST['idplan'];\r\n\t\t$idPlanUnique = array_unique($idPlan);\r\n\t\t//$correlativo = $_POST['correlativo'];\r\n\t\t$importeTotal = $_POST['importeTotal'];\r\n\t\t$correlativo = $_POST['correlativoActual'];\r\n\t\t$limit = 1;\r\n\r\n \t$numSerieUno = reset($serie);\r\n\r\n\t\tif (substr($numSerieUno, 0, 1) == 'B') {\r\n\r\n\t\t\t$idTipoDoc = 3;\r\n\r\n\t\t\t$boleta = $this->comprobante_pago_mdl->getDatosBoleta($inicio, $fin, $canales, $numSerieUno);\r\n\t\t\t$boletaResArray = json_decode(json_encode($boleta), true);\r\n\t\t\t$boletaResstring = array_values($boletaResArray)[0];\r\n\t\t\t$fechaRes = $boletaResstring['cob_fechCob'];\r\n\t\t\t$serieRes = $boletaResstring['numero_serie'];\r\n\r\n\t\t\t$correlativoRC = $this->comprobante_pago_mdl->getUltimoCorrelativoMasUnoRes($fechaRes);\r\n\t\t\t$correlativoRCArray = json_decode(json_encode($correlativoRC), true);\r\n\t\t\t$correlativoRCstring = array_values($correlativoRCArray)[0];\r\n\t\t\t$correRC = $correlativoRCstring['nume_corre_res'];\r\n\r\n\t\t\t$contadorRC = $this->comprobante_pago_mdl->getUltimoContador($fechaRes, $correRC);\r\n\t\t\t$contadorRCArray = json_decode(json_encode($contadorRC), true);\r\n\t\t\t$contadorRCstring = array_values($contadorRCArray)[0];\r\n\t\t\t$contaRc = $contadorRCstring['contadorCorre'];\r\n\r\n\t\t\t$contador=1;\r\n\r\n\t\t\tif ($contaRc>=$contador) {\r\n\t\t\t\t$contador=401;\r\n\t\t\t} else {\r\n\t\t\t\t$contador=1;\r\n\t\t\t}\r\n\r\n\t\t\tforeach ((array) $boleta as $b){\r\n\r\n\t\t\t\t$importe = $b->cob_importe;\r\n\t\t\t\t$importe = $importe/100;\r\n\t\t\t\t$importe2=number_format((float)$importe, 2, '.', ',');\r\n\t\t\t\t$newDate = date(\"d/m/Y\", strtotime($b->cob_fechCob));\r\n\r\n\t\t\t\tif ($fechaRes==$b->cob_fechCob) {\r\n\t\t\t\t\tif ($contador<=400) {\r\n\t\t\t\t\t\t$this->comprobante_pago_mdl->insertDatosBoletas($inicio, $fin, $b->cob_fechCob, $b->numero_serie, $correlativo, $b->cont_id, $importe2, $b->cob_id, $b->idplan, 'RC0'.$canales, $correRC);\r\n\t\t\t\t\t\t$contador=$contador+1;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$correRC = $correRC+1;\r\n\t\t\t\t\t\t$this->comprobante_pago_mdl->insertDatosBoletas($inicio, $fin, $b->cob_fechCob, $b->numero_serie, $correlativo, $b->cont_id, $importe2, $b->cob_id, $b->idplan, 'RC0'.$canales, $correRC);\r\n\t\t\t\t\t\t$contador=2;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$fechaRes = $b->cob_fechCob;\r\n\t\t\t\t\t$correlativoRC = $this->comprobante_pago_mdl->getUltimoCorrelativoMasUnoRes($fechaRes);\r\n\t\t\t\t\t$correlativoRCArray = json_decode(json_encode($correlativoRC), true);\r\n\t\t\t\t\t$correlativoRCstring = array_values($correlativoRCArray)[0];\r\n\t\t\t\t\t$correRC = $correlativoRCstring['nume_corre_res'];\r\n\r\n\t\t\t\t\t$contadorRC = $this->comprobante_pago_mdl->getUltimoContador($fechaRes, $correRC);\r\n\t\t\t\t\t$contadorRCArray = json_decode(json_encode($contadorRC), true);\r\n\t\t\t\t\t$contadorRCstring = array_values($contadorRCArray)[0];\r\n\t\t\t\t\t$contaRc = $contadorRCstring['contadorCorre'];\r\n\t\t\t\t\t$contador=1;\r\n\r\n\t\t\t\t\tif ($contaRc>=$contador) {\r\n\t\t\t\t\t\t$contador=401;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$contador=1;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ($contador<=400) {\r\n\t\t\t\t\t\t$this->comprobante_pago_mdl->insertDatosBoletas($inicio, $fin, $b->cob_fechCob, $b->numero_serie, $correlativo, $b->cont_id, $importe2, $b->cob_id, $b->idplan, 'RC0'.$canales, $correRC);\r\n\t\t\t\t\t\t$contador=$contador+1;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$correRC = $correRC+1;\r\n\t\t\t\t\t\t$this->comprobante_pago_mdl->insertDatosBoletas($inicio, $fin, $b->cob_fechCob, $b->numero_serie, $correlativo, $b->cont_id, $importe2, $b->cob_id, $b->idplan, 'RC0'.$canales, $correRC);\r\n\t\t\t\t\t\t$contador=2;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$correlativo = $correlativo+1;\r\n\r\n\t\t\t\t$this->comprobante_pago_mdl->updateEstadoCobro($b->cob_fechCob, $b->cob_id);\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\t//for para recorrer los planes obtenidos de la vista y hacer update del idestadocobro\r\n\t\t\t/*for ($i=0; $i < count(array_unique($idPlan)); $i++) { \r\n\r\n\t\t\t\t$this->comprobante_pago_mdl->updateEstadoCobro($inicio, $fin, $idPlan[$i]);\r\n\r\n\t\t\t}*/\r\n\t\t} elseif (substr($numSerieUno, 0, 1) == 'F') {\r\n\r\n\t\t\t$idPlanCheck = $_POST['checkPlan'];\r\n\t\t\t$fechaEmi = $_POST['fechaEmi'];\r\n\t\t\t$idEmpresa = $_POST['empresa'];\r\n\r\n\t\t\t$idTipoDoc = 3;\r\n\r\n\t\t\t//for para recorrer los datos de la tabla y hacer el insert en la bd\r\n\t\t\tfor ($i=0; $i < count($idPlanCheck); $i++) {\r\n\t\t\t\t\r\n\t\t\t\t$this->comprobante_pago_mdl->insertDatosFacturas($inicio, $fin, $fechaEmi[$i], $serie[$i], $correlativo, $idEmpresa[$i], $importeTotal[$i], $idPlanCheck[$i]);\r\n\r\n\t\t\t\t$correlativo = $correlativo+1;\r\n\t\t\t}\r\n\t\t\t//for para recorrer los planes obtenidos de la vista y hacer update del idestadocobro\r\n\t\t\tfor ($i=0; $i < count(array_unique($idPlanCheck)); $i++) { \r\n\t\t\t\t\r\n\t\t\t\t$this->comprobante_pago_mdl->updateEstadoCobroFact($inicio, $fin, $idPlanCheck[$i]);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function addberita()\n\t{\n\t\t# code...\n\t\t$data_sender = $this->input->post('data_sender');\n//\t\tprint_r($data_sender);die();\t\t\n\t\t$this->Allcrud->addData('berita',$data_sender);\n\t}", "public function createQueue();", "function cobrarAction() {\n\t\t\tif (BLOQUEAR == 1){\n\t\t\t\t$this->render('appBloqueada');\n\t\t\t} else if ($this->security(true) && $_SESSION['user']->rol>=50) {\n\t\t\t\t$error = '';\n\t\t\t\t$confirm = '';\n\t\t\t\t$taq;\n\t\t\t\tif (isset($_POST['cobrar']) || isset($_SESSION['cobrar'])) {\n\t\t\t\t\tif (isset($_GET['id'])) {\n\t\t\t\t\t\t$busq = array(\n\t\t\t\t\t\t\t'id' => $_GET['id']\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$taq = Taquilla::findByAttributes($busq)[0];\n\t\t\t\t\t\t$taq->estado = 3;\n\t\t\t\t\t\t$taq->user_id = (isset($_POST['user_id']) ? $_POST['user_id'] : $_SESSION['user_id']);\n\t\t\t\t\t\t$taq->fecha = date(\"d-m-Y\");\n\t\t\t\t\t\tif (isset($_SESSION['cobrar'])) {\n\t\t\t\t\t\t\tunset($_SESSION['cobrar']);\n\t\t\t\t\t\t\tunset($_SESSION['user_id']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//se ha guardado la taquilla, ahora se pasa a generar el PDF\n\t\t\t\t\t\t$taq->save();\n\n\t\t\t\t\t\t$numero = $taq->num_taquilla;\n\t\t\t\t\t $campus = $taq->campus;\n\t\t\t\t\t $edificio = $taq->edificio;\n\t\t\t $niu = $taq->user_id;\n\t\t\t $alumno = User::findByNIA($niu)->cn;\n\t\t\t $edificio = Taquilla::$nombreEdificios[$campus][$edificio];\n\t\t\t $zona = $taq->zona;\n\t\t\t $planta = $taq->planta;\n\t\t\t $tipo = $taq->tipo;\n\t\t\t $fecha = $taq->fecha;\n\n\n\t\t\t // Renderiza el PDF\n\t\t\t\t\t\t$pdf = new PDF();\n\t\t\t $pdf->SetTitle('Comprobante de Pago',true);\n\t\t\t $pdf->SetAuthor('App Taquillas',true);\n\t\t\t $pdf->SetMargins(20, 12, 20);\n\t\t\t $pdf->AliasNbPages();\n\t\t\t $pdf->AddPage();\n\t\t\t $html1 = utf8_decode(\n\t\t\t \"<p>El alumno/a <b>$alumno</b> con <b>NIU $niu</b>, ha realizado el pago de la taquilla <b>$numero</b> del edificio <b>$edificio</b> zona <b>$zona</b> planta <b>$planta</b> tipo <b>$tipo</b> el dia <u>$fecha</u>.\");\n\t\t\t if ($tipo == 'simple') {\n\t\t\t $html1 .= \" El coste es de 4 (cuatro) euros.\";\n\t\t\t } else if ($tipo == 'doble') {\n\t\t\t $html1 .= \" El coste es de 6 (seis) euros.\";\n\t\t\t } else {\n\t\t\t $html1 .= \" El coste es de 6 (seis) euros.\";\n\t\t\t }\n\t\t\t $html1 .= \"</p>\";\n\t\t\t $pdf->SetTextColor(16, 13, 98);\n\t\t\t $pdf->SetFont('Times', '', 10);\n\t\t\t $pdf->WriteHTML($html1);\n\t\t\t $pdf->Ln(10);\n\t\t\t $html2 = \"</br>CONDICIONES GENERALES DE CONTRATACION APLICABLE A LOS USUARIOS DE LAS TAQUILLAS.\";\n\t\t\t $pdf->SetFont('Times', '', 12);\n\t\t\t $pdf->WriteHTML($html2);\n\t\t\t $pdf->Ln(10);\n\t\t\t $pdf->SetFont('Times', '', 8);\n\t\t\t $normas=\"\";\n\t\t\t if ($campus == '1'){\n\t\t\t \t$normas = utf8_decode(\n\t\t\t\t\t\t\t\"\n\n\t\t\t\t\t\t\tArt. 1: La cesión del uso y disfrute de una taquilla implica el conocimiento y la aceptación incondicional de las condiciones generales que a continuación se detallan.\n\n\t\t\t\t\t\t\tArt. 2: La titularidad de todas las taquillas corresponde a la Universidad Carlos III de Madrid, que encomienda en exclusiva a la Delegación de Estudiantes de la Facultad de Ciencias Sociales y Jurídicas la gestión de todas las existentes en el Campus de dicha Facultad.\n\n\t\t\t\t\t\t\tArt. 3: Por Aplicación del artículo anterior, nunca se podrá otorgar a ningún solicitante más que el mero uso y disfrute de la taquilla, siendo obligación de éste el debido mantenimiento de la misma mientras conste como usuario. Tanto la Delegación de Estudiantes, como la UC3M no es responsable en ningún caso de los objetos depositados dentro de una taquilla.\n\n\t\t\t\t\t\t\tArt. 4: Será necesario identificarse mediante el Número de Identificación Académica que aparece en el carné de estudiantes para solicitar una taquilla.\n\n\t\t\t\t\t\t\tArt. 5: 1o.- Se abrirá un proceso de asignación de taquillas durante el mes de octubre de cada curso académico mediante el procedimiento de la Delegación de Estudiantes estime en cada momento según las necesidades del momento. Así mismo, es potestad de la Delegación la fijación de un precio por el uso de las taquillas.\n\t\t\t\t\t\t\t 2o.- En este proceso se designará al usuario o usuarios de la taquilla, que sólo podrán variar previa notificación a la Delegación de Estudiantes.\n\n\t\t\t\t\t\t\tArt. 6: 1o.- Una taquilla puede asignarse a una sola persona o a un grupo de ellas, según las condiciones que cada año se establezcan.\n\t\t\t\t\t\t\t 2o.- Una persona sólo puede aparecer como usuario de una taquilla, sin importar el número de personas que figuren como usuarios de la misma, aunque dependiendo del caso en particular podrá haber alguna excepción, valorando cada caso la Delegación de Estudiantes.\n\n\t\t\t\t\t\t\tArt. 7: Con independencia del momento de asignación de la taquilla, el periodo de uso de la misma finalizará en el mes de octubre del curso académico siguiente al de la asignación, sin posibilidad de prórroga.\n\n\t\t\t\t\t\t\tArt. 8: Finalizado el periodo de uso, las taquillas podrán ser abiertas por la Delegación de Estudiantes sin previo aviso al titular, quedando los efectos que estuvieran en las mismas a cargo de la Delegación durante un periodo de dos meses. Transcurrido ese plazo, la Delegación de Estudiantes se deshará de dichos objetos requisados.\n\n\t\t\t\t\t\t\tArt. 9: 1o.- Para efectuar la retirada de los efectos retirados de las taquillas, mientras estén en posesión de la Delegación, será necesario presentar el carné de estudiante u otro documento de identificación y rellenar un formulario declarando que es propietario de los objetos que se retiran.\n\t\t\t\t\t\t\t 2o.- Tanto la Delegación de Estudiantes no se hace responsable del deterioro que pudieran haber sufrido los objetos durante su depósito en sus instalaciones.\n\n\t\t\t\t\t\t\tArt. 10: 1o.- Las taquillas ocupadas sin haber sido solicitadas a la Delegación podrán ser desalojadas por ésta sin previo aviso, quedando lo contenido en ellas sujeto a lo expuesto en los artículos 8 y 9 de la presente norma.\n\t\t\t\t\t\t\t 2o.- El usuario que encuentre la taquilla que le ha sido asignada ocupada en el momento de hacer uso de ella deberá ponerse en contacto con la Delegación de Estudiantes para su desalojo.\n\n\t\t\t\t\t\t\tLOS ABAJO FIRMANTES DECLARAN HABER LEÍDO LAS NORMAS DE USO DE LAS TAQUILLAS Y ACEPTARLAS.\");\n\t\t\t } else {\n\t\t\t \t$normas = utf8_decode(\n\t\t\t \t\t\"\n\t\t\t \t1) El pago de alquiler comprende todo el curso académico y permite su uso desde el día de su pago hasta el 15 de Septiembre del año siguiente.\n\t\t\t \t2) Las taquillas deberán quedar libres de candado después de esa fecha, a partir de la Delegación de Estudiantes procederá a la apertura de las que aún continuaran cerradas, para permitir la entrada de los nuevos adjudicatarios. Aquellas personas que no desalojen en los plazos establecidos serán penalizados. Todos los enseres retirados de las taquillas serán almacenados durante 30 dias naturales, siendo destruidos a partir de esa fecha si no son reclamados por el anterior usuario de la taquilla.\n\t\t\t \t3) Los adjudicatarios se comprometen al cuidado permanente de la taquilla que les ha correspondido, y a no depositar en la misma elementos o sustancias peligrosas o molestas, ni que puedan dañar los muebles ni a los usuarios de las demás taquillas.\n\t\t\t \t4) Cualquier desperfecto no causado por el usuario deberá ser reportado a la Delegación de Estudiantes, a fin de que sea subsanándolo antes posible.\n\t\t\t \t5) Delegación de Estudiantes y la Universidad Carlos III de Madrid no se responsabilizan de los robos o sustracciones que pudieran darse en las taquillas.\n\n\t\t\t\t\t\t\tFirma:\"\n\t\t\t \t);\n\t\t\t }\n\t\t\t \n\n\t\t\t $pdf->MultiCell(0, 4, $normas, 0, 'J');\n\t\t\t //Por seguriad calculo una especie de firma\n\t\t\t $pdf->SetFont('Times', '', 10);\n\t\t\t $pdf->Ln(10);\n\t\t\t $firma = \"Firma digital: \".sha1($campus.$edificio.$planta.$zona.$tipo.$numero.$niu);\n\t\t\t $pdf->MultiCell(0, 4, $firma, 0, 'R');\n\t\t\t $nombre = 'ResguardoNIU';\n\t\t\t $pdf->AddPage();\n\t\t\t //MultiCell(float w, float h, string txt [, mixed border [, string align [, boolean fill]]])\n\t\t\t $html1 = utf8_decode(\n\t\t\t \"El alumno/a <b>$alumno</b> con <b>NIU $niu</b>, ha realizado el pago de la taquilla <b>$numero</b> del edificio <b>$edificio</b> zona <b>$zona</b> planta <b>$planta</b> tipo <b>$tipo</b> el dia <u>$fecha</u>.\n\t\t\t CONDICIONES GENERALES DE CONTRATACIÓN APLICABLE A LOS USUARIOS DE LAS TAQUILLAS.\");\n\t\t\t if ($tipo == 'simple') {\n\t\t\t $html1 .= \" El coste es de 4 (cuatro) euros.\";\n\t\t\t } else if ($tipo == 'doble') {\n\t\t\t $html1 .= \" El coste es de 6 (seis) euros.\";\n\t\t\t } else {\n\t\t\t $html1 .= \" El coste es de 6 (seis) euros.\";\n\t\t\t }\n\t\t\t $pdf->SetTextColor(16, 13, 98);\n\t\t\t $pdf->SetFont('Times', '', 10);\n\t\t\t $pdf->WriteHTML($html1);\n\t\t\t $pdf->Ln(10);\n\t\t\t $html2 = \"</br>CONDICIONES GENERALES DE CONTRATACION APLICABLE A LOS USUARIOS DE LAS TAQUILLAS.\";\n\t\t\t $pdf->SetFont('Times', '', 12);\n\t\t\t $pdf->WriteHTML($html2);\n\t\t\t $pdf->Ln(10);\n\t\t\t $pdf->SetFont('Times', '', 8);\n\t\t\t if ($campus == '1'){\n\t\t\t \t$normas = utf8_decode(\n\t\t\t\t\t\t\t\"\n\n\t\t\t\t\t\t\tArt. 1: La cesión del uso y disfrute de una taquilla implica el conocimiento y la aceptación incondicional de las condiciones generales que a continuación se detallan.\n\n\t\t\t\t\t\t\tArt. 2: La titularidad de todas las taquillas corresponde a la Universidad Carlos III de Madrid, que encomienda en exclusiva a la Delegación de Estudiantes de la Facultad de Ciencias Sociales y Jurídicas la gestión de todas las existentes en el Campus de dicha Facultad.\n\n\t\t\t\t\t\t\tArt. 3: Por Aplicación del artículo anterior, nunca se podrá otorgar a ningún solicitante más que el mero uso y disfrute de la taquilla, siendo obligación de éste el debido mantenimiento de la misma mientras conste como usuario. Tanto la Delegación de Estudiantes, como la UC3M no es responsable en ningún caso de los objetos depositados dentro de una taquilla.\n\n\t\t\t\t\t\t\tArt. 4: Será necesario identificarse mediante el Número de Identificación Académica que aparece en el carné de estudiantes para solicitar una taquilla.\n\n\t\t\t\t\t\t\tArt. 5: 1o.- Se abrirá un proceso de asignación de taquillas durante el mes de octubre de cada curso académico mediante el procedimiento de la Delegación de Estudiantes estime en cada momento según las necesidades del momento. Así mismo, es potestad de la Delegación la fijación de un precio por el uso de las taquillas.\n\t\t\t\t\t\t\t 2o.- En este proceso se designará al usuario o usuarios de la taquilla, que sólo podrán variar previa notificación a la Delegación de Estudiantes.\n\n\t\t\t\t\t\t\tArt. 6: 1o.- Una taquilla puede asignarse a una sola persona o a un grupo de ellas, según las condiciones que cada año se establezcan.\n\t\t\t\t\t\t\t 2o.- Una persona sólo puede aparecer como usuario de una taquilla, sin importar el número de personas que figuren como usuarios de la misma, aunque dependiendo del caso en particular podrá haber alguna excepción, valorando cada caso la Delegación de Estudiantes.\n\n\t\t\t\t\t\t\tArt. 7: Con independencia del momento de asignación de la taquilla, el periodo de uso de la misma finalizará en el mes de octubre del curso académico siguiente al de la asignación, sin posibilidad de prórroga.\n\n\t\t\t\t\t\t\tArt. 8: Finalizado el periodo de uso, las taquillas podrán ser abiertas por la Delegación de Estudiantes sin previo aviso al titular, quedando los efectos que estuvieran en las mismas a cargo de la Delegación durante un periodo de dos meses. Transcurrido ese plazo, la Delegación de Estudiantes se deshará de dichos objetos requisados.\n\n\t\t\t\t\t\t\tArt. 9: 1o.- Para efectuar la retirada de los efectos retirados de las taquillas, mientras estén en posesión de la Delegación, será necesario presentar el carné de estudiante u otro documento de identificación y rellenar un formulario declarando que es propietario de los objetos que se retiran.\n\t\t\t\t\t\t\t 2o.- Tanto la Delegación de Estudiantes no se hace responsable del deterioro que pudieran haber sufrido los objetos durante su depósito en sus instalaciones.\n\n\t\t\t\t\t\t\tArt. 10: 1o.- Las taquillas ocupadas sin haber sido solicitadas a la Delegación podrán ser desalojadas por ésta sin previo aviso, quedando lo contenido en ellas sujeto a lo expuesto en los artículos 8 y 9 de la presente norma.\n\t\t\t\t\t\t\t 2o.- El usuario que encuentre la taquilla que le ha sido asignada ocupada en el momento de hacer uso de ella deberá ponerse en contacto con la Delegación de Estudiantes para su desalojo.\n\n\t\t\t\t\t\t\tLOS ABAJO FIRMANTES DECLARAN HABER LEÍDO LAS NORMAS DE USO DE LAS TAQUILLAS Y ACEPTARLAS.\");\n\t\t\t } else {\n\t\t\t \t$normas = utf8_decode(\n\t\t\t \t\t\"\n\t\t\t \t1) El pago de alquiler comprende todo el curso académico y permite su uso desde el día de su pago hasta el 15 de Septiembre del año siguiente.\n\t\t\t \t2) Las taquillas deberán quedar libres de candado después de esa fecha, a partir de la Delegación de Estudiantes procederá a la apertura de las que aún continuaran cerradas, para permitir la entrada de los nuevos adjudicatarios. Aquellas personas que no desalojen en los plazos establecidos serán penalizados. Todos los enseres retirados de las taquillas serán almacenados durante 30 dias naturales, siendo destruidos a partir de esa fecha si no son reclamados por el anterior usuario de la taquilla.\n\t\t\t \t3) Los adjudicatarios se comprometen al cuidado permanente de la taquilla que les ha correspondido, y a no depositar en la misma elementos o sustancias peligrosas o molestas, ni que puedan dañar los muebles ni a los usuarios de las demás taquillas.\n\t\t\t \t4) Cualquier desperfecto no causado por el usuario deberá ser reportado a la Delegación de Estudiantes, a fin de que sea subsanándolo antes posible.\n\t\t\t \t5) Delegación de Estudiantes y la Universidad Carlos III de Madrid no se responsabilizan de los robos o sustracciones que pudieran darse en las taquillas.\n\n\t\t\t\t\t\t\tFirma:\"\n\t\t\t \t);\n\t\t\t }\n\n\t\t\t $pdf->MultiCell(0, 4, $normas, 0, 'J');\n\t\t\t //Por seguriad calculo una especie de firma\n\t\t\t $pdf->SetFont('Times', '', 10);\n\t\t\t $pdf->Ln(10);\n\t\t\t $firma = \"Firma digital: \".sha1($campus.$edificio.$planta.$zona.$tipo.$numero.$niu);\n\t\t\t $pdf->MultiCell(0, 4, $firma, 0, 'R');\n\t\t\t $nombre = 'ResguardoNIU';\n\t\t\t \t$pdf->Output($nombre, 'I');\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$error = 'Ups, algo salió mal';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->render('confirmarAsig', array('error' => $error, 'confirm' => $confirm, 'reserva'=>$taq));\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function relatorioDeCelulaPart2Dao($idCelula,$idMembro){\r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetocelula.php\");\r\n \r\n $objDao = Connection::getInstance();\r\n $resultado = mysql_query(\"Select c.NomeCelula, m.Nome from celulas c join celulamembro e on e.CodCelula = c.Codigo join membros m on e.CodMembro = m.Matricula order by c.NomeCelula\") or die (\"Nao foi possivel realizar a busca 2\".mysql_error());\r\n \r\n $listaMembro = array();\r\n \r\n $i=0;\r\n\r\n if($resultado){\r\n \r\n while ($registro = mysql_fetch_assoc($resultado)){ \r\n\t $celula = new objetocelula();\r\n $celula->setNome($registro['NomeCelula']);\r\n $celula->setNomeMembro($registro['Nome']);\r\n\t $listaMembro[$i] = $celula;\r\n\t $i++;\r\n\t}\r\n }\r\n \r\n\tmysql_free_result($resultado);\r\n $objDao->freebanco(); \r\n return $listaMembro;\r\n }", "function obtenirJournalBanque($compte=1,\n $periode_debut= '',\n $periode_fin=''\n )\n {\n\n $periode_debut=$this->periodeDebutFin ($debutFin='debut',$periode_debut);\n $periode_fin=$this->periodeDebutFin ($debutFin='fin',$periode_fin);\n\t\t$requete = 'SELECT ';\n\t\t$requete .= 'compta.date_regl, compta.description, compta.montant, compta.idoperation, ';\n\t\t$requete .= 'MONTH(compta.date_regl) as mois, compta.id as idtmp, ';\n $requete .= 'compta_reglement.reglement, ';\n $requete .= 'compta_evenement.evenement, compta.idevenement, ';\n $requete .= 'compta_categorie.categorie, compta.idcategorie ';\n\t\t$requete .= 'FROM ';\n\t\t$requete .= 'compta ';\n $requete .= 'LEFT JOIN ';\n $requete .= 'compta_categorie on compta_categorie.id=compta.idcategorie ';\n $requete .= 'LEFT JOIN ';\n $requete .= 'compta_reglement on compta_reglement.id=compta.idmode_regl ';\n $requete .= 'LEFT JOIN ';\n $requete .= 'compta_evenement on compta_evenement.id=compta.idevenement ';\n\t\t$requete .= 'WHERE ';\n\t\t$requete .= 'compta.date_regl >= \\''.$periode_debut.'\\' ';\n\t\t$requete .= 'AND compta.date_regl <= \\''.$periode_fin.'\\' ';\n\t\t$requete .= 'AND compta.montant != \\'0.00\\' ';\n\t\t$requete .= 'AND compta.idmode_regl = compta_reglement.id ';\n\t\t$requete .= 'AND idcompte = '.(int) $compte. ' ';\n\t\t$requete .= 'ORDER BY ';\n\t\t$requete .= 'compta.date_regl ';\n\t\treturn $this->_bdd->obtenirTous($requete);\n }", "function get_reused_cheques($office_bank_id){\n $this->read_db->select(array('voucher_cheque_number'));\n $this->read_db->where(array('fk_office_bank_id'=>$office_bank_id,\n 'voucher_cheque_number < '=>0));\n $reusable_cheque_leaves_obj = $this->read_db->get('voucher');\n\n $reusable_cheque_leaves = [];\n\n if($reusable_cheque_leaves_obj->num_rows() > 0){\n $reusable_cheque_leaves = array_unique(array_column($reusable_cheque_leaves_obj->result_array(),'voucher_cheque_number'));\n \n $reusable_cheque_leaves = array_map([$this,'make_unsigned_values'],$reusable_cheque_leaves);\n }\n\n return $reusable_cheque_leaves;\n }", "function requeteur_data_dist(&$boucles, &$boucle, &$id) {\n\tinclude_spip('iterateur/data');\n\tif ($h = charger_fonction($boucle->type_requete . '_to_array' , 'inc', true)) {\n\t\t$g = charger_fonction('data', 'iterateur');\n\t\t$boucles[$id] = $g($boucle);\n\t\t// from[0] stocke le type de data (rss, yql, ...)\n\t\t$boucles[$id]->from[] = $boucle->type_requete;\n\t\t\n\t} else {\n\t\t$x = $boucle->type_requete;\n\t\t$boucle->type_requete = false;\n\t\t$msg = array('zbug_requeteur_inconnu',\n\t\t\t\tarray(\n\t\t\t\t'requeteur' => 'data',\n\t\t\t\t'type' => $x\n\t\t));\n\t\terreur_squelette($msg, $boucle);\n\t}\n}", "public function membresAction()\n {\n // Les modèles\n $model_types = new Model_DbTable_Type();\n $model_membres = new Model_DbTable_CommissionMembre();\n\n // On récupère les règles de la commission\n $this->view->array_membres = $model_membres->get($this->_request->id_commission);\n\n // On met le libellé du type dans le tableau des activités\n $types = $model_types->fetchAll()->toArray();\n $types_sort = [];\n\n foreach ($types as $_type) {\n $types_sort[$_type['ID_TYPE']] = $_type;\n }\n\n foreach ($this->view->array_membres as &$membre) {\n $type_sort = [];\n\n foreach ($membre['types'] as $type) {\n if (!array_key_exists($types_sort[$type['ID_TYPE']]['LIBELLE_TYPE'], $type_sort)) {\n $type_sort[$types_sort[$type['ID_TYPE']]['LIBELLE_TYPE']] = [];\n }\n\n $type_sort[$types_sort[$type['ID_TYPE']]['LIBELLE_TYPE']][] = $type;\n }\n\n $membre['types'] = $type_sort;\n }\n }", "public function resumenNuevas($changuitas, $usuario, $frecuencia) {\n if (count($changuitas) == 0)\n return;\n $ch = array();\n $cats = array();\n $subcats = array();\n foreach ($changuitas as $v) {\n $sql = \"select ch.titulo, cat.categoria, sc.subcategoria, ch.categoria as cId, ch.subcategoria as sId from changuitas as ch left join categorias as cat on ch.categoria = cat.id left join subcategorias as sc on ch.subcategoria = sc.id where ch.id = $v\";\n $res = $this->bd->query($sql);\n $fila = $res->fetch_assoc();\n $ch[$fila[\"cId\"]][$fila[\"sId\"]][] = \"<p style='padding:5px;margin:0;font-family:Helvetica, Arial, sans-serif;font-weight:normal;font-size:18px;'><a href='\" . Sitio . \"/#/changuita|$v'>\" . $fila[\"titulo\"] . \"</a></p>\";\n $cats[$fila[\"cId\"]] = $fila[\"categoria\"];\n $subcats[$fila[\"sId\"]] = $fila[\"subcategoria\"];\n }\n $sql = \"select nombre, mail from usuarios where id = $usuario and activo = '2'\";\n $res = $this->bd->query($sql);\n $fila = $res->fetch_assoc();\n $this->mailer->Subject = $fila[\"nombre\"] . \", hay nuevas changuitas\";\n $this->mailer->Body = $this->bodyIni;\n $this->mailer->Body .= \"Estimado/a \" . $fila[\"nombre\"] . \":<br/><br/>\";\n if ($frecuencia == \"diario\")\n $this->mailer->Body .= \"En las últimas 24 horas\";\n else\n $this->mailer->Body .= \"En la última semana\";\n $this->mailer->Body .= \" se publicaron las siguientes changuitas en las categorías que elegiste:\";\n foreach ($ch as $k => $v) {\n $this->mailer->Body .= \"<h4 style='padding:5px 5px 0;margin:5px 0 0;text-transform:uppercase;border-top:1px solid #999;'>\" . $cats[$k] . \"</h4>\";\n foreach ($v as $kk => $vv) {\n $this->mailer->Body .= \"<h4 style='padding:0 5px;margin:0;text-transform:uppercase;font-weight:normal;'> > \" . $subcats[$kk] . \"</h4>\";\n foreach ($vv as $vvv)\n $this->mailer->Body .= $vvv;\n }\n }\n $this->mailer->Body .= \"<br/>\" . $this->bodyFin;\n $this->mailer->ClearAddresses();\n $this->mailer->AddAddress($fila[\"mail\"]);\n $this->mailer->Send();\n }", "public function set ($data=array()){\n if (array_key_exists('banc_nombre',$data) ){\n\t\t\tforeach($data as $campo=>$valor){\n\t\t\t\t$$campo=$valor;\n\t\t\t}\n\t\t\t$this->parametros = array($banc_nombre,$_SESSION['usua_codigo']);\n\t\t\t$this->sp = \"str_consultaBanco_add\";\n\t\t\t$this->executeSPAccion();\n\t\t\tif($this->filasAfectadas>0){\n\t\t\t\t$this->mensaje=\"Banco agregado exitosamente\";\n\t\t\t}else{\n\t\t\t\t$this->mensaje=\"No se ha agregado el Banco\";\n }\n }else{\n $this->mensaje=\"No se ha agregado el Banco\";\n }\n }", "public function rewardsSmsQueue()\n {\n $sms_queue = RewardSms::where(\"sent\", 0)->get()->take(5);\n \n foreach ($sms_queue as $key => $queue) {\n \n $this->sendSms($queue->phone, $queue->text);\n \n $sms_obj = RewardSms::where(\"rewards_sms_id\", $queue->rewards_sms_id)->get()->first();\n $sms_obj->sent = 1;\n $sms_obj->save();\n }\n }", "private function tbl_guiones_registro_ubicacion() {\r\n\t\t\t$this->guiones_registro_ubicacion = $this->esquema->createTable('GUIONES_REGISTRO_UBICACION');\r\n\t\t\t$this->guiones_registro_ubicacion->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la ubicacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_ubicacion->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre de la ubicacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_ubicacion->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado de la ubicacion [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_ubicacion->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro_ubicacion->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}", "function etape_1(&$repete) {\n global $message,$Dossier,$Cabinet, $deval, $self, $tcabinet, $tville, $t_diab;\n\n $req=\"SELECT cabinet, total_diab2, nom_cab, region \".\n \"FROM account \".\n \"WHERE region!='' and infirmiere!='' \".\n \"GROUP BY nom_cab \".\n \"ORDER BY nom_cab \";\n\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n $reg=array();\n while(list($cab, $total_diab2, $ville, $region) = mysql_fetch_row($res)) {\n\n $t_diab[$cab]=0;\n\n $tville[$cab]=$ville;\n\n $regions[$cab]=$region;\n $nb_dossiers[$cab]=0;\n $rcva[$cab]=0;\n $nb_dossiers[$region]=0;\n $rcva[$region]=0;\n\n if(!in_array($region, $reg)){\n $reg[]=$region;\n }\n }\n\n $nb_dossiers[\"tot\"]=0;\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, \".\n \"dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb_dossiers[$cabinet]=$nb_dossiers[$cabinet]+1;\n $nb_dossiers[\"tot\"]=$nb_dossiers[\"tot\"]+1;\n $nb_dossiers[$regions[$cabinet]]=$nb_dossiers[$regions[$cabinet]]+1;\n }\n\n $date1an=date(\"Y\");\n $date1an--;\n $date1an=$date1an.\"-\".date(\"m\").\"-\".date(\"d\");\n\n $date3ans=date(\"Y\");\n $date3ans=$date3ans-3;\n $date3ans=$date3ans.\"-\".date(\"m\").\"-\".date(\"d\");\n\n echo \"<table border='1'><tr><td></td><th>Taux moyen Asalée</th>\";\n\n foreach($reg as $region){\n echo \"<th>$region</th>\";\n }\n\n foreach($tville as $ville){\n echo \"<th>$ville</th>\";\n }\n\n echo \"<tr><td width='150'>Antécédents familiaux<sup>1</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, \".\n \"dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and (antecedants='oui' or antecedants='non') and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>Tabagisme<sup>2</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and (tabac='oui' or tabac='non') and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>Poids<sup>3</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and dpoids>='$date1an' and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n\n echo \"<tr><td>Alcool<sup>4</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and (alcool='oui' or alcool='non') and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>Cholestérol total<sup>5</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and dChol>='$date1an' and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>HDL<sup>6</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and dHDL>='$date1an' and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n\n echo \"<tr><td>LDL<sup>7</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and dLDL>='$date1an' and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>Triglycérides<sup>8</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and dtriglycerides>='$date1an' and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>Glycémie<sup>9</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and dgly>='$date1an' and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>Créatinine<sup>10</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and cardio_vasculaire_depart.dCreat>='$date1an' and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>Kaliémie<sup>11</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and dkaliemie>='$date1an' and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>Protéinurie<sup>12</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and dproteinurie>='$date1an' and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>Fond d'oeil<sup>13</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and dfond>='$date3ans' and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>Fréquence cardiaque<sup>14</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and dpouls>='$date1an' and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>Tension<sup>15</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and dTA>='$date1an' and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>Echocardiogramme Hypertrophie Ventriculaire Gauche<sup>16</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and (HVG='oui' or HVG='non') and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>ECG<sup>17</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and dECG>='$date3ans' and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>A défaut Surcharge ventriculaire gauche<sup>18</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and (surcharge_ventricule='oui' or surcharge_ventricule='non') and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>Sokolov<sup>19</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and dsokolov>='$date1an' and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>Examen cardio-vasculaire<sup>20</sup></td>\";\n\n $req=\"SELECT dossier.cabinet from cardio_vasculaire_depart, dossier, account \".\n \"where dossier.id=cardio_vasculaire_depart.id and \".\n \"dossier.cabinet=account.cabinet and region!='' and infirmiere!='' \".\n \"and exam_cardio>='$date1an' and actif='oui' group by dossier.id\";\n $res=mysql_query($req) or die(\"erreur SQL:\".mysql_error().\"<br>$req\");\n\n $nb[\"tot\"]=0;\n foreach($reg as $region){\n $nb[$region]=0;\n }\n\n foreach($tville as $cab=>$ville){\n $nb[$cab]=0;\n }\n\n while(list($cabinet)=mysql_fetch_row($res)){\n $nb[\"tot\"]=$nb[\"tot\"]+1;\n $nb[$cabinet]=$nb[$cabinet]+1;\n $nb[$regions[$cabinet]]=$nb[$regions[$cabinet]]+1;\n }\n\n echo \"<td align='right'>\".round($nb[\"tot\"]/$nb_dossiers[\"tot\"]*100).\" %</td>\";\n foreach($reg as $region){\n if($nb_dossiers[$region]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$region]/$nb_dossiers[$region]*100).\" %</td>\";\n }\n }\n\n foreach($tville as $cab=>$ville){\n if($nb_dossiers[$cab]==0){\n echo \"<td align='right'>ND</td>\";\n }\n else{\n echo \"<td align='right'>\".round($nb[$cab]/$nb_dossiers[$cab]*100).\" %</td>\";\n }\n }\n\n echo \"<tr><td>Nombre de patients actifs avec au moins un suivi<sup>21</sup></td>\";\n\n echo \"<td align='right'>\".$nb_dossiers[\"tot\"].\"</td>\";\n foreach($reg as $region){\n echo \"<td align='right'>\".$nb_dossiers[$region].\"</td>\";\n }\n\n foreach($tville as $cab=>$ville){\n echo \"<td align='right'>\".$nb_dossiers[$cab].\"</td>\";\n }\n\n echo \"</table><br><br>\";\n\n $annee0=2007;\n $mois0=3;\n\n $annee=date('Y');\n $mois=date('m');\n\n $mois--;\n\n\n if($mois<3)\n {\n $annee--;\n $mois=12;\n }\n elseif(($mois>=3)&&($mois<6))\n {\n $mois=3;\n }\n elseif(($mois>=6)&&($mois<9))\n {\n $mois=6;\n }\n elseif(($mois>=9)&&($mois<12))\n {\n $mois=9;\n }\n\n $jour[3]=$jour[12]=31;\n $jour[6]=$jour[9]=30;\n\n while(($annee>$annee0)||(($annee==$annee0)&&($mois>=$mois0)))\n {\n if($mois<10)\n {\n $date=$annee.'-0'.$mois.'-'.$jour[$mois];\n }\n else\n {\n $date=$annee.'-'.$mois.'-'.$jour[$mois];\n }\n tableau($date, $regions);\n\n $mois=$mois-3;\n\n if($mois<=0)\n {\n $mois=$mois+12;\n $annee--;\n }\n }\n\n echo \"<sup>1</sup> Taux de patients pour lesquels les antécédents familiaux ont été renseignés à la date du jour<br>\".\n \"<sup>2</sup> Taux de patients pour lesquels le tabagisme a été renseigné à la date du jour<br>\".\n \"<sup>3</sup> Taux de patients pour lesquels le poids date de moins d'un an<br>\".\n \"<sup>4</sup> Taux de patients pour lesquels la consommation d'alcool a été renseignée<br>\".\n \"<sup>5</sup> Taux de patients pour lesquels le cholestérol total date de moins d'un an<br>\".\n \"<sup>6</sup> Taux de patients pour lesquels le HDL date de moins d'un an<br>\".\n \"<sup>7</sup> Taux de patients pour lesquels le LDL date de moins d'un an<br>\".\n \"<sup>8</sup> Taux de patients pour lesquels les triglycérides datent de moins d'un an<br>\".\n \"<sup>9</sup> Taux de patients pour lesquels la glycémie date de moins d'un an<br>\".\n \"<sup>10</sup> Taux de patients pour lesquels la créatinine date de moins d'un an<br>\".\n \"<sup>11</sup> Taux de patients pour lesquels la kaliémie date de moins d'un an<br>\".\n \"<sup>12</sup> Taux de patients pour lesquels la protéinurie date de moins d'un an<br>\".\n \"<sup>13</sup> Taux de patients pour lesquels le fond d'oeil date de moins de 3 ans<br>\".\n \"<sup>14</sup> Taux de patients pour lesquels la fréquence cardiaque date de moins d'un an<br>\".\n \"<sup>15</sup> Taux de patients pour lesquels la tension artérielle date de moins d'un an<br>\".\n \"<sup>16</sup> Taux de patients pour lesquels l'échocardiogramme hypertrophie ventriculaire gauche a été renseigné<br>\".\n \"<sup>17</sup> Taux de patients pour lesquels l'ECG date de moins de 3 ans<br>\".\n \"<sup>18</sup> Taux de patients pour lesquels la surcharge ventriculaire gauche a été renseignée<br>\".\n \"<sup>19</sup> Taux de patients pour lesquels le sokolov date de moins d'un an<br>\".\n \"<sup>20</sup> Taux de patients pour lesquels l'examen cardio-vasculaire date de moins d'un an<br>\".\n \"<sup>21</sup> Nombre de patients actifs à la date du jour et ayant eu au moins un questionnaire collecte de données RCVA rempli\";\n\n}", "static public function ctrRegistroBitacora(){\r\n\r\n\t\tif (isset($_POST[\"editarIdBanco\"])) {\r\n\r\n\t\t$tabla = \"bitacora\";\r\n\r\n\t\t$datos = array(\"usuario\" => $_SESSION['nombre'],\r\n\t\t\t\t\t\t\t \"perfil\" => $_SESSION['perfil'],\r\n\t\t\t\t\t\t\t \"accion\" => 'Edición Banco 6278',\r\n\t\t\t\t\t\t\t \"folio\" => $_POST[\"editarIdBanco\"]);\r\n\r\n\t\t$respuesta = ModeloBanco6278Diario::mdlRegistroBitacora($tabla, $datos);\r\n\r\n\t\treturn $respuesta;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "public function quack();", "function listadeMembrodaDao($nome){\r\n require_once (\"conexao.php\");\r\n require_once (\"modelo/objetoMembro.php\");\r\n \r\n $objDao = Connection::getInstance();\r\n \r\n $resultado = mysql_query(\"Select * from membros where Nome LIKE '%$nome%'\") or die (\"Nao foi possivel realizar a busca\".mysql_error());\r\n $listaMembro = array();\r\n \r\n $i=0;\r\n $achou=FALSE;\r\n \r\n if($resultado != \"\"){\r\n \r\n while ($registro = mysql_fetch_assoc($resultado)){\r\n \r\n\t $membro = new objetoMembro();\r\n \r\n $membro->setMatricula($registro['Matricula']);\r\n $membro->setNome($registro['Nome']);\r\n $membro->setSexo($registro['Sexo']); \r\n $membro->setData($registro['DataNascimento1']); \r\n $membro->setRg($registro['Rg']);\r\n $membro->setCpf($registro['Cpf']); \r\n $membro->setEstadocivil($registro['EstadoCivil']);\r\n $membro->setNatural($registro['Naturalidade']); \r\n $membro->setProfissao($registro['Profissao']); \r\n $membro->setEscola($registro['Escolaridade']); \r\n $membro->setPai($registro['Pai']); \r\n $membro->setMae($registro['Mae']); \r\n $membro->setNecessidade($registro['NecessidadeEspeciais']);\r\n\t $membro->setFone($registro['Fone']); \r\n $membro->setFilho($registro['Filho']); \r\n $membro->setFormacao($registro['FormacaoEclesiatica']);\r\n $membro->setMembrasia($registro['IntegracaoMembrasia']); \r\n $membro->setFuncao($registro['Funcao']); \r\n $membro->setParticipou($registro['JaParticipou']);\r\n\t $membro->setTrabalhando($registro['Trabalhando']); \r\n $membro->setViajando($registro['EstadoAtual']); \r\n $membro->setCongrega($registro['Congrega']); \r\n $membro->setRua($registro['Rua']); \r\n $membro->setBairro($registro['Bairro']); \r\n $membro->setCasa($registro['Casa']); \r\n $membro->setStatus($registro['Status']);\r\n \r\n\t $listaMembro[$i] = $membro;\r\n \r\n\t $i++;\r\n $achou = true;\r\n\t}\r\n \r\n }\r\n\t\treturn $listaMembro;\r\n if($achou){\r\n mysql_free_result($registro);\r\n }\r\n\t\tmysql_free_result($resultado);\r\n $objDao->freebanco(); \r\n }", "function crearComentario($bd,$usuario){\n //Hago un filtrado previo por si hay valores indeseables en el array\n $arrayFiltrado=array();\n foreach ($_POST as $k => $v)\n $arrayFiltrado[$k] = filtrado($v);\n $entrada = new Entrada($arrayFiltrado[\"entrada\"]);\n $comentario = new Comentario(NULL,$arrayFiltrado[\"comentario\"],$arrayFiltrado[\"fechacreacion\"]);\n $daoComentario = new Comentarios($bd);\n $daoComentario->addComentario($comentario,$entrada,$usuario);\n return true;\n}", "function listarCuentaBancaria(){\n\t\t$this->procedimiento='sigep.ft_cuenta_bancaria_sel';\n\t\t$this->transaccion='SIGEP_CUEN_BAN_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_cuenta_bancaria','int4');\n\t\t$this->captura('id_cuenta_bancaria_boa','int4');\n\t\t$this->captura('banco','int4');\n\t\t$this->captura('cuenta','varchar');\n\t\t$this->captura('desc_cuenta','varchar');\n\t\t$this->captura('moneda','int4');\n\t\t$this->captura('tipo_cuenta','bpchar');\n\t\t$this->captura('estado_cuenta','bpchar');\n\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('id_usuario_ai','int4');\n\t\t$this->captura('usuario_ai','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('desc_cuenta_banco','varchar');\n\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function MembreMesProduction($rang,$id_coauteur,$id_prod,$action,Request $request){\n\n /*Avoir le rang */\n\n $ranggs = DB::select('select * from auteurs where id_production = ?', [$id_prod]);\n \n foreach($ranggs as $rings){\n\n $ring = $rings->rang_auteur ;\n\n }\n\n $ring = $ring + 1 ;\n\n if($action == 'accepter'){\n\n \n $productions = DB::select('select * from production_scientifiques where id = ?', [$id_prod]);\n\n\n foreach($productions as $prod) {\n \n $demande = $prod->demande ;\n \n }\n \n\n $id_coauters = explode(\",\",$demande);\n \n $new_demande = array();\n \n $j = 0 ;\n \n for($i = 0 ; $i < count($id_coauters) ; $i++){\n \n \n if($id_coauters[$i] == $id_coauteur ){\n \n\n $count = DB::insert('insert into auteurs (id_membre , id_production , rang_auteur) values (?, ? , ?)', [$id_coauteur,$id_prod,$ring/*$rang*/]);\n\n\n }else{\n \n $new_demande[$j] = $id_coauters[$i] ;\n \n \n $j = $j + 1 ;\n \n \n }\n \n \n }\n\n\n\n $new_dem = implode(',',$new_demande);\n\n \n if($count > 0){\n\n $cc = DB::update('update production_scientifiques set demande = ? where id = ?', [$new_dem,$id_prod]);\n\n if($cc > 0 ){\n \n return redirect('Membre/MesProduction')->with('success','co-auteur designé');\n\n // return 'co-auteur designé' ;\n } \n \n }else{\n\n return redirect('Membre/MesProduction')->with('failed','echoué');\n\n // return 'echoué' ;\n\n }\n \n\n }else if($action == 'refuser'){\n\n\n $productions1 = DB::select('select * from production_scientifiques where id = ?', [$id_prod]);\n\n\n foreach($productions1 as $prod1) {\n \n $demande1 = $prod1->demande ;\n \n }\n \n\n $id_coauters1 = explode(\",\",$demande1);\n \n $new_demande1 = array();\n \n $j1 = 0 ;\n \n for($i = 0 ; $i < count($id_coauters1) ; $i++){\n \n \n if($id_coauters1[$i] == $id_coauteur ){\n \n\n }else{\n \n $new_demande1[$j1] = $id_coauters1[$i] ;\n \n \n $j1 = $j1 + 1 ;\n \n \n }\n \n \n }\n\n $new_dem1 = implode(',',$new_demande1);\n\n\n $c = DB::update('update production_scientifiques set demande = ? where id = ?', [$new_dem1,$id_prod]);\n\n if($c > 0){\n\n return redirect('Membre/MesProduction')->with('success','demande refusé');\n\n // return ' demande refusé';//redirect('Membre/MesProduction');\n\n\n }\n\n\n\n }\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n }", "final public function blacklistAdd(array $data):array{\n try {\n\n #verificamos la existenci de la variable\n if (!isset($data['token'])) {\n throw new Exception('Could not process');\n \n }\n #verificamos que la id que viene codificada sea correcrta\n if (!Func::decodeNumber($data['token'])) {\n throw new Exception('Could not process');\n }\n $tokenUser = Func::decodeNumber($data['token']);\n\n\n $bl = $this->db->select('COUNT(*)','jc_blacklist','bl_user_main='.$this->user.' and bl_user_black='.$tokenUser.'');\n \n #verificamos si el usuario ya se eucentra registrado en nuestra black list\n if ($bl[0][0] >0) {\n throw new Exception('This user has already registered with your blacklist');\n \n }\n\n } catch (Exception $e) {\n return ['success'=>0,'message'=>$e->getMessage()];\n }\n\n $bls = [\n 'bl_user_main'=>$this->user,\n 'bl_user_black'=>intval($tokenUser),\n 'bl_time_black'=>time()\n ];\n\n #insertamos el usaurario a la black list\n $this->db->insert('jc_blacklist',$bls);\n #insertamos notificacion al usuario a quien le insertando en la blacklist\n /*$noti=[\n 'sl_id_remite'=>$this->user,\n 'sl_id_destino'=>$tokenUser,\n 'sl_fecha'=>time(),\n 'sl_tipo'=>3,//agregar a la lista negra\n 'sl_status'=>0,\n 'sl_visto'=>0\n ];\n $this->db->insert('jc_solicitudes',$noti);*/\n\n #devolvemos el mensaje\n return ['success'=>1,'message'=>'This user has been registered to your blacklist'];\n }", "function asignarAction() {\n\t\t\tif (BLOQUEAR == 1){\n\t\t\t\t$this->render('appBloqueada');\n\t\t\t} else if ($this->security(true) && $_SESSION['user']->rol>=50) {\n\t\t\t\t$error = '';\n\t\t\t\tif (isset($_POST['asignar'])){\n\t\t\t\t\tif(isset($_POST['campus']) && isset($_POST['edificio']) && isset($_POST['planta']) && isset($_POST['zona']) && isset($_POST['tipo']) && isset($_POST['user_id'])) {\n\t\t\t\t\t\t$busqueda = array('user_id' => $_POST['user_id'], 'estado' => 2);\n\t\t\t\t\t\t$taqDisponibles = Taquilla::findByAttributes($busqueda);\n\t\t\t\t\t\t//No hay reserva\n\t\t\t\t\t\tif(count($taqDisponibles) == 0) {\n\t\t\t\t\t\t\t$edificio = explode(' ', $_POST['edificio']);\n\t\t\t\t\t\t\t$busqueda = array(\n\t\t\t\t\t\t\t\t'campus' => $_POST['campus'],\n\t\t\t\t\t\t\t\t'edificio' => $edificio[0],\n\t\t\t\t\t\t\t\t'planta' => $_POST['planta'],\n\t\t\t\t\t\t\t\t'zona' => \"'\".$_POST['zona'].\"'\",\n\t\t\t\t\t\t\t\t'tipo' => \"'\".$_POST['tipo'].\"'\",\n\t\t\t\t\t\t\t\t'estado' => 1,\n\t\t\t\t\t\t\t\t'user_id' => NULL,\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (!empty($_POST['num_taquilla'])){\n\t\t\t\t\t\t\t\t$busqueda['num_taquilla'] = $_POST['num_taquilla'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$taqDisponibles = Taquilla::findByAttributes($busqueda);\n\t\t\t\t\t\t\t//Encuentra taquillas libres\n\t\t\t\t\t\t\tif (!empty($taqDisponibles)) {\n\t\t\t\t\t\t\t\t//Si se ha buscado por id se le asigna\n\t\t\t\t\t\t\t\tif (!empty($_POST['num_taquilla'])) {\n\t\t\t\t\t\t\t\t\t$reserva = new Taquilla;\n\t\t\t\t\t\t\t\t\t$reserva = $taqDisponibles[0];\n\t\t\t\t\t\t\t\t\t$reserva->user_id = $_POST['user_id'];\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t//Si no se busca por id es aleatorio\n\t\t\t\t\t\t\t\t\t$aleatorio = rand (0,count($taqDisponibles)-1);\n\t\t\t\t\t\t\t\t\t$reserva = new Taquilla;\n\t\t\t\t\t\t\t\t\t$reserva = $taqDisponibles[$aleatorio];\n\t\t\t\t\t\t\t\t\t$reserva->user_id = $_POST['user_id'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$email = User::findByNIA($_POST['user_id'])->mail;\n\t\t\t\t\t\t\t\t$nombre = User::findByNIA($_POST['user_id'])->cn;\n\t\t\t\t\t\t\t\t$this->render('confirmarAsig',array('reserva'=>$reserva, 'email'=>$email, 'nombre'=>$nombre));\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t//No hay taquillas libres\n\t\t\t\t\t\t\t\t$error = 'No hay taquillas libres';\n\t\t\t\t\t\t\t\t$this->render('asigCobra',array('error' => $error));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//Caso de que ya exista 1 o + reservas, se elige la 1º.\n\t\t\t\t\t\telse if ($taqDisponibles[0]->estado == 2) {\n\t\t\t\t\t\t\t$reserva = $taqDisponibles[0];\n\t\t\t\t\t\t\t$email = User::findByNIA($_POST['user_id'])->mail;\n\t\t\t\t\t\t\t$nombre = User::findByNIA($_POST['user_id'])->cn;\n\t\t\t\t\t\t\t$this->render('confirmarAsig',array('reserva'=>$reserva, 'email'=>$email, 'nombre'=>$nombre));\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t$error = 'Ha ocurrido un error';\n\t\t\t\t\t\t\t$this->render('asigCobra',array('error' => $error));\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Algún campo vacío\n\t\t\t\t\t\t$error = 'Todos los campos son obligatorios';\n\t\t\t\t\t\t$this->render('asigCobra',array('error' => $error));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->render('asigCobra',array('error' => $error));\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function spiplistes_listes_boite_abonnements ($id_liste, $statut_liste, $tri, $debut, $script_retour) {\n\n\t$boite_abonnements = \"\"\n\t\t. \"<div id='\" . _SPIPLISTES_ID_GROSSE_BOITE . \"' class='verdana1'>\\n\"\n\t\t. spiplistes_listes_boite_abonnes($id_liste, $statut_liste, $tri, $debut, $script_retour)\n\t\t. spiplistes_listes_boite_elligibles ($id_liste, $statut_liste, $tri, $debut)\n\t\t. \"</div>\\n\"\n\t\t;\n\treturn($boite_abonnements);\n}", "public function 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 }", "function BackupTabla($Tabla){\n \n if($Tabla==\"preventa\" or $Tabla==\"precotizacion\"){\n print(\"OK;0\");\n exit();\n }\n $obCon = new Backups($_SESSION['idUser']);\n\n $DatosServer=$obCon->DevuelveValores(\"servidores\", \"ID\", 2);\n $FechaSinc=date(\"Y-m-d H:i:s\");\n $CondicionUpdate=\"WHERE Sync = '0000-00-00 00:00:00' OR Sync<>Updated LIMIT 5000\";\n $sql=$obCon->ArmeSqlReplace($Tabla, DB, $CondicionUpdate,$DatosServer[\"DataBase\"],$FechaSinc, \"\");\n //print($sql);\n if($sql==''){\n print(\"OK;0\");\n exit();\n }\n $Mensaje=\"\";\n $Mensaje=$obCon->QueryExterno($sql, $DatosServer[\"IP\"], $DatosServer[\"Usuario\"], $DatosServer[\"Password\"], $DatosServer[\"DataBase\"], \"\");\n if($Mensaje<>\"\" and $Mensaje<>1){\n $Mensaje=\"Error: al insertar datos en la tabla $Tabla: \".$Mensaje;\n $obCon->RegistraAlerta(\"\", \"\", \"Backups\", $Mensaje, \"\");\n }\n $sqlUp=\"UPDATE $Tabla SET Sync='$FechaSinc', Updated='$FechaSinc' $CondicionUpdate\";\n $Mensaje=$obCon->Query($sqlUp);\n if($Mensaje<>\"\" and $Mensaje<>1){\n $Mensaje=\"Error: al insertar datos en la tabla $Tabla: \".$Mensaje;\n $obCon->RegistraAlerta(\"\", \"\", \"Backups\", $Mensaje, \"\");\n }\n $sql=\"SELECT COUNT(*) as TotalRegistros FROM $Tabla WHERE Sync = '0000-00-00 00:00:00' OR Sync<>Updated\";\n $ConsultaConteo=$obCon->Query($sql);\n $Registros=$obCon->FetchAssoc($ConsultaConteo);\n $TotalRegistros=$Registros[\"TotalRegistros\"];\n print(\"OK;$TotalRegistros\");\n }", "public function get_recibo($num, $ser, $carga = '', $referencia = '', $cli = '', $alumno = '', $suc = '', $fecha = '', $sit = '', $fini = '', $ffin = ''){\n $pensum = $this->pensum;\n\n $sql= \"SELECT *, \";\n $sql.= \" (SELECT CONCAT(alu_nombre,' ',alu_apellido) FROM app_alumnos WHERE alu_cui = rec_alumno) as alu_nombre_completo,\";\n //-- subquery grado\n $sql.= \" (SELECT TRIM(gra_descripcion) FROM academ_grado, academ_grado_alumno\";\n $sql.= \" WHERE gra_pensum = $pensum\";\n $sql.= \" AND graa_pensum = gra_pensum\";\n $sql.= \" AND graa_nivel = gra_nivel\";\n $sql.= \" AND graa_grado = gra_codigo\";\n $sql.= \" AND graa_alumno = rec_alumno ORDER BY graa_grado DESC LIMIT 0 , 1) AS alu_grado_descripcion,\";\n //-- subquery seccion\n $sql.= \" (SELECT TRIM(sec_descripcion) FROM academ_secciones,academ_seccion_alumno\";\n $sql.= \" WHERE seca_pensum = $pensum\";\n $sql.= \" AND seca_pensum = sec_pensum\";\n $sql.= \" AND seca_nivel = sec_nivel\";\n $sql.= \" AND seca_grado = sec_grado\";\n $sql.= \" AND seca_seccion = sec_codigo\";\n $sql.= \" AND seca_alumno = rec_alumno ORDER BY seca_seccion LIMIT 0 , 1) AS alu_seccion_descripcion\";\n //--\n $sql.= \" FROM boletas_recibo_boleta,vnt_serie_recibo,fin_cliente,mast_sucursal,fin_moneda\";\n $sql.= \" WHERE rec_serie = ser_codigo\";\n $sql.= \" AND cli_nit = rec_cliente\";\n $sql.= \" AND rec_sucursal = suc_id\";\n $sql.= \" AND mon_id = rec_moneda\"; \n if (strlen($num)>0) {\n $sql.= \" AND rec_numero = $num\";\n }\n if (strlen($ser)>0) {\n $sql.= \" AND rec_serie = $ser\";\n }\n if (strlen($carga)>0) {\n $sql.= \" AND rec_carga = '$carga'\";\n }\n if (strlen($referencia)>0) {\n $sql.= \" AND rec_referencia = '$referencia'\";\n }\n if (strlen($cli)>0) {\n $sql.= \" AND ven_cliente = $cli\";\n }\n if (strlen($alumno)>0) {\n $sql.= \" AND rec_alumno = '$alumno'\";\n }\n if (strlen($suc)>0) {\n $sql.= \" AND rec_sucursal = $suc\";\n }\n if (strlen($fecha)>0) {\n $fecha = $this->regresa_fecha($fecha);\n $sql.= \" AND rec_fecha BETWEEN '$fecha' AND '$fecha'\";\n }\n if ($fini != \"\" && $ffin != \"\") {\n $fini = $this->regresa_fecha($fini);\n $ffin = $this->regresa_fecha($ffin);\n $sql.= \" AND rec_fecha BETWEEN '$fini' AND '$ffin'\";\n }\n if (strlen($sit)>0) {\n $sql.= \" AND rec_situacion = $sit\";\n }\n $sql.= \" ORDER BY rec_sucursal ASC, rec_carga ASC, rec_serie ASC, rec_numero ASC, rec_fecha ASC\";\n\n $result = $this->exec_query($sql);\n //echo $sql;\n return $result;\n }", "public function crearcuartobloque($m22, $m23, $m24, $m25,$m26,$m27,$m28){\n $obj_bloque4=new motivacioneducativacuartobloque();\n \n $obj_bloque4->setM22($m22); \n $obj_bloque4->setM23($m23); \n $obj_bloque4->setM24($m24); \n $obj_bloque4->setM25($m25); \n $obj_bloque4->setM26($m26); \n $obj_bloque4->setM27($m27); \n $obj_bloque4->setM28($m28);\n \n\n \n\n return MotivacionDao::crearcuartobloque($obj_bloque4);\n\n\n }", "public function reservarStock(){\n $registrosCarro = $this->obtenerItemsCarro();\n\n //Tengo que crear movimientos por reserva segun el stock disponible y prioridad de las bodegas\n foreach ($registrosCarro as $item) {\n // Obtengo stocks segun orden\n $stocks = ProductosStock::getStockProductos($item->producto_id,$item->categoria_id);\n //Itero y muevo a almacen online\n $cantidad = $item->cantidad;\n foreach ($stocks as $stock) {\n $cantidad = $stock->moverAOnline($cantidad,$this->id_pedido);\n if ($cantidad <= 0)\n break;\n }\n }\n }", "function cl_rhemitecontracheque() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"rhemitecontracheque\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function actionCreate()\n {\n $model = new Bloqueos();\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $estaBloqueado = Bloqueos::find()\n ->where(['usuariosid' => Yii::$app->user->identity->id])\n ->andWhere(['bloqueadosid' => $model->bloqueadosid])\n ->one();\n\n $eliminado = Seguidores::find()\n ->where(['usuario_id' => $model->bloqueadosid])\n ->andWhere(['seguidor_id' => Yii::$app->user->identity->id])->one();\n\n if ($estaBloqueado != null) {\n return $this->goBack();\n }\n $eliminado->delete();\n $model->save(false);\n return $this->redirect('site/index');\n } else {\n Yii::$app->session->setFlash('Error', 'El usuario ya ha sido bloqueado');\n return $this->goHome();\n }\n }" ]
[ "0.57439375", "0.56898636", "0.56306416", "0.56062907", "0.5580944", "0.5417555", "0.5405682", "0.53992355", "0.5387866", "0.5363791", "0.53548795", "0.532506", "0.5305468", "0.52907664", "0.5272203", "0.5251661", "0.52178615", "0.52135384", "0.51975495", "0.5182625", "0.51680374", "0.51675105", "0.51549435", "0.512811", "0.5125557", "0.51134443", "0.50968164", "0.50908375", "0.5079185", "0.5076758", "0.50554603", "0.50421214", "0.50351304", "0.50219053", "0.50164986", "0.5006324", "0.50048757", "0.5004436", "0.49962425", "0.4972607", "0.49715978", "0.49584317", "0.49471632", "0.4945318", "0.4936677", "0.493385", "0.4930917", "0.49115634", "0.4904969", "0.4903304", "0.49017859", "0.48894912", "0.48851144", "0.48847628", "0.487649", "0.48683497", "0.48666358", "0.48606005", "0.4857202", "0.48558044", "0.48533654", "0.4839916", "0.48343962", "0.48312518", "0.4828034", "0.48271042", "0.48245257", "0.48206332", "0.4820271", "0.4815741", "0.48124427", "0.48093775", "0.4809363", "0.4801214", "0.48004675", "0.47992662", "0.4798433", "0.47912267", "0.4781762", "0.47810313", "0.4780772", "0.47803816", "0.47734323", "0.47727108", "0.47696516", "0.4766899", "0.47635117", "0.4753518", "0.47530776", "0.47527406", "0.47505933", "0.47457066", "0.47435883", "0.47434708", "0.47401652", "0.47390506", "0.4738294", "0.47352776", "0.47257078", "0.47252074", "0.47216454" ]
0.0
-1
/ React Bloque dinamico, para usar hast con preview page
function ajarRenderDinamycBlock($attributes, $content) { return '<h1 class="my-3">'.$attributes['content'].'</h1>'. '<img src="'.$attributes['mediaURL'].'" alt="'.$attributes['mediaAlt'].'" />'. '<hr>'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function preview()\n {\n }", "public function preview()\n {\n }", "public function preview()\n {\n }", "public function preview()\n {\n }", "public function inPreview();", "public static function live_preview() { }", "function post_preview()\n {\n }", "function preview()\n\t{\n\t\theader(\"Content-type: {$this->mimetype}\");\n\t\t$this->showImage();\n\t}", "function _show_post_preview()\n {\n }", "public function preview($args) {\n }", "public function getPreview();", "public function preview($slug){\n\n echo <<<HTML\n<!doctype html>\n<html lang=\"\">\n <head>\n <meta charset=\"utf-8\">\n </head>\n <body>\nHTML;\n\n $this->embed($slug);\n\n echo <<<HTML\n </body>\n</html>\nHTML;\n\n }", "public function get_preview_url()\n {\n }", "public function preview(){\n /** @var Photo $pobj */\n $pobj = Photo::fetch($_GET['id']);\n // @todo Preview should only be visible to the user who uploaded (if user exists) and should only be saved by user who uploaded\n // @todo We can achieve this with form verification id's (which we should have anyway)\n if($pobj !== false && $pobj->temporary) $pobj->show('preview');\n else $this->zajlib->reroute('__error', ['system_api_photo_preview', []]);\n\t\t}", "function printPreview()\n {\n echo '<div class=\"theme_preview\">';\n echo '<h2>' . htmlspecialchars($this->getName())\n .' (' . htmlspecialchars($this->getVersion()) . ')</h2>'\n .'<p>'\n .'<a target=\"_top\" href=\"index.php'\n .PMA_generate_common_url(array('set_theme' => $this->getId())) . '\"'\n .' onclick=\"takeThis(\\'' . addslashes($this->getId()) . '\\');'\n .' return false;\">';\n if (@file_exists($this->getPath() . '/screen.png')) {\n // if screen exists then output\n\n echo '<img src=\"' . $this->getPath() . '/screen.png\" border=\"1\"'\n .' alt=\"' . htmlspecialchars($this->getName()) . '\"'\n .' title=\"' . htmlspecialchars($this->getName()) . '\" /><br />';\n } else {\n echo $GLOBALS['strThemeNoPreviewAvailable'];\n }\n\n echo '[ <strong>' . $GLOBALS['strTakeIt'] . '</strong> ]</a>'\n .'</p>'\n .'</div>';\n }", "function page_sitepreview() {\r\n\t\tglobal $admin_lang;\r\n\t\t\r\n\t\t$out = '<h3>' . $admin_lang['sitepreview'].'</h3><hr /><iframe src=\"index.php\" class=\"sitepreview\"></iframe>';\r\n\t\treturn $out;\r\n\t}", "public function preview()\n {\n\n //do we have anythin to preview at all?\n if (!isset($_POST['page']) || $_POST['page'] == '') {\n die(\"No page found\");\n }\n\n if (!is_writable('./temp/')) {\n chmod('./temp/', 0777);\n }\n\n $filename = \"temp/preview_\" . $this->generateRandomString(20) . \".html\";\n $previewFile = fopen($filename, \"w\");\n\n if (isset($_POST['siteID']) && !empty($_POST['siteID'])) {\n $siteDetails = $this->sitemodel->getSite($_POST['siteID']);\n\n if ($siteDetails == false) {\n die(\"No details found\");\n }\n\n $pageMeta = $this->pagemodel->getSinglePage($_POST['siteID'], 'index');\n\n if (!empty($pageMeta->pages_title)) {\n //insert title, meta keywords and meta description\n $title = '<title>' . $siteDetails['site']->sites_name . '</title>';\n $meta_description = '<meta name=\"description\" content=\"' . $pageMeta->pages_meta_description . '\">';\n $meta_keyword = '<meta name=\"keywords\" content=\"' . $pageMeta->pages_meta_keywords . '\">';\n $header_includes = $pageMeta->pages_header_includes;\n\n $pageContent = str_replace('<!--pageTitle-->', $title, $_POST['page']);\n $pageContent = str_replace('<!--META-DESCRIPTION-->', $meta_description, $pageContent);\n $pageContent = str_replace('<!--META-KEYWORDS-->', $meta_keyword, $pageContent);\n\n //insert header includes;\n $pageContent = str_replace(\"<!--headerIncludes-->\", $header_includes, $pageContent);\n } else {\n //insert title\n $title = '<title>' . $siteDetails['site']->sites_name . '</title>';\n\n $pageContent = str_replace('<!--pageTitle-->', $title, $_POST['page']);\n }\n } else {\n $title = '<title>Template Preview</title>';\n\n $pageContent = str_replace('<!--pageTitle-->', $title, $_POST['page']);\n }\n\n if (stristr($pageContent, 'href=\"css')) {\n $pageContent = str_replace('href=\"css', 'href=\"' . base_url('elements') . '/css', $pageContent);\n }\n if (stristr($pageContent, 'href=\"scripts')) {\n $pageContent = str_replace('href=\"scripts', 'href=\"' . base_url('elements') . '/scripts', $pageContent);\n }\n if (stristr($pageContent, 'href=\"images')) {\n $pageContent = str_replace('href=\"images', 'href=\"' . base_url('elements') . '/images', $pageContent);\n }\n if (stristr($pageContent, 'src=\"scripts')) {\n $pageContent = str_replace('src=\"scripts', 'src=\"' . base_url('elements') . '/scripts', $pageContent);\n }\n if (stristr($pageContent, 'url(images')) {\n $pageContent = str_replace('url(images', 'url(' . base_url('elements') . '/images', $pageContent);\n }\n if (stristr($pageContent, 'src=\"./images')) {\n $pageContent = str_replace('src=\"./images', 'src=\"' . base_url('elements') . '/images', $pageContent);\n }\n if (stristr($pageContent, 'src=\"images')) {\n $pageContent = str_replace('src=\"images', 'src=\"' . base_url('elements') . '/images', $pageContent);\n }\n if (stristr($pageContent, 'href=\"./images')) {\n $pageContent = str_replace('href=\"./images', 'href=\"' . base_url('elements') . '/images', $pageContent);\n }\n\n fwrite($previewFile, stripcslashes($pageContent));\n\n fclose($previewFile);\n header('Location: ' . base_url($filename));\n }", "public function init_preview()\n {\n }", "public function customize_preview_base()\n {\n }", "function wp_ajax_imgedit_preview()\n {\n }", "protected function getPreviewModule() {}", "public function preview() {\r\n\t\tglobal $post, $listing_preview;\r\n\t\t\r\n\t\tif ( $this->listing_id ) {\r\n\t\t\t$listing_preview = true;\r\n\t\t\t$post = get_post( $this->listing_id );\r\n\t\t\t$post->post_status = 'preview';\r\n\r\n\t\t\tsetup_postdata( $post );\r\n\t\t\t\r\n\t\t\t$template_loader = new Listeo_Core_Template_Loader;\r\n\t\t\t$template_loader->set_template_data( \r\n\t\t\tarray( \r\n\t\t\t\t'action' \t\t=> $this->get_action(),\r\n\t\t\t\t'fields' \t\t=> $this->fields,\r\n\t\t\t\t'form' \t=> $this->form_name,\r\n\t\t\t\t'post' \t=> $post,\r\n\t\t\t\t'listing_id' => $this->get_listing_id(),\r\n\t\t\t\t'step' \t=> $this->get_step(),\r\n\t\t\t\t'submit_button_text' => apply_filters( 'submit_listing_form_preview_button_text', __( 'Submit', 'listeo_core' ) )\r\n\t\t\t\t) \r\n\t\t\t)->get_template_part( 'listing-preview' );\r\n\r\n\t\t\twp_reset_postdata();\r\n\t\t}\r\n\t}", "function _set_preview($post)\n {\n }", "function preview_proposal($nama_file){ /*ini menggunakanan paramerter $nama_file*/\n $url_sh=substr($nama_file,0,-4);\n $url_klik= url('upload/berkas/'.$nama_file);\n // ini link dari route\n $url_pdf=url('upload/berkas/'.$url_sh);\n \n $link_image=\"window.open('\".$url_klik.\"','popup','width=600,height=600,scrollbars=no,resizable=no'); return false;\";\n $link_pdf=\"window.open('\".$url_pdf.\"','popup','width=600,height=600,scrollbars=no,resizable=no'); return false;\";\n\n $file_path = pathinfo(storage_path().'/upload/berkas/'.$nama_file);\n switch(strtolower($file_path['extension'])){\n case\"jpg\":case\"png\":case\"jpeg\":\n echo '\n <a href=\"\" onclick=\"'.$link_image.'\">';\n echo \"<img src='$url_klik' style='width:100px; height:100px'><br/>\";\n echo \"Klik Untuk Lebih Detail\";\n echo \"</a>\";\n break;\n case\"pdf\":case\"PDF\":\n echo '\n <a href=\"\" onclick=\"'.$link_pdf.'\">';\n \n echo \"<i class='fas fa-file-pdf' style='font-size:20px;color:#D81F28'></i><br/>\";\n echo \"Preview file \";\n \n echo \"</a>\";\n break;\t\n default:\n echo \"File tidak ditemukan\";\n break;\t\n\n }\n}", "function foxhound_preview() {\n\tif ( isset( $_GET['preview'] ) ) {\n\t\twp_die( __( 'Foxhound requires WordPress 4.9 or higher. Please update your site and try again.', 'foxhound' ) );\n\t}\n}", "public function export_preview_data()\n {\n }", "public function export_preview_data()\n {\n }", "public function export_preview_data()\n {\n }", "public function preview_student()\n {\n //some error prevention first\n $siteDetails = $this->sitemodel->getSite($_POST['siteID']);\n\n if ($siteDetails == false) {\n die(\"No details found\");\n }\n //do we have anythin to preview at all?\n if (!isset($_POST['page']) || $_POST['page'] == '') {\n die(\"No page found\");\n }\n\n if (!is_writable('./temp/')) {\n chmod('./temp/', 0777);\n }\n\n $filename = \"temp/preview_\" . $this->generateRandomString(20) . \".html\";\n $previewFile = fopen($filename, \"w\");\n\n $title = '<title>' . $siteDetails['site']->sites_name . '</title>';\n $pageContent = str_replace('<!--pageTitle-->', $title, $_POST['page']);\n\n $base_url = base_url('studentelements');\n\n if (stristr($pageContent, 'href=\"css')) {\n $pageContent = str_replace('href=\"css', 'href=\"' . $base_url . '/css', $pageContent);\n }\n if (stristr($pageContent, 'href=\"scripts')) {\n $pageContent = str_replace('href=\"scripts', 'href=\"' . $base_url . '/scripts', $pageContent);\n }\n if (stristr($pageContent, 'href=\"images')) {\n $pageContent = str_replace('href=\"images', 'href=\"' . $base_url . '/images', $pageContent);\n }\n if (stristr($pageContent, 'src=\"scripts')) {\n $pageContent = str_replace('src=\"scripts', 'src=\"' . $base_url . '/scripts', $pageContent);\n }\n if (stristr($pageContent, 'url(images')) {\n $pageContent = str_replace('url(images', 'url(' . $base_url . '/images', $pageContent);\n }\n if (stristr($pageContent, 'src=\"./images')) {\n $pageContent = str_replace('src=\"./images', 'src=\"' . $base_url . '/images', $pageContent);\n }\n if (stristr($pageContent, 'src=\"images')) {\n $pageContent = str_replace('src=\"images', 'src=\"' . $base_url . '/images', $pageContent);\n }\n if (stristr($pageContent, 'href=\"./images')) {\n $pageContent = str_replace('href=\"./images', 'href=\"' . $base_url . '/images', $pageContent);\n }\n\n fwrite($previewFile, stripcslashes($pageContent));\n\n fclose($previewFile);\n header('Location: ' . base_url($filename));\n }", "public function forcePreview() {}", "abstract protected function showContent(): self;", "function edd_incentives_render_preview() {\n global $post;\n \n echo '<p>';\n echo '<a class=\"button button-primary edd-incentives-colorbox\">' . __( 'Preview Incentive', 'edd-incentives' ) . '</a>';\n echo '<span class=\"description\">' . __( 'Remember to save your changes before previewing this incentive!', 'edd-incentives' ) . '</span>';\n echo '</p>';\n\n echo '<div style=\"display: none;\">';\n echo '<div id=\"edd-incentives-preview\">';\n\n // Display post content\n echo edd_incentives_parse_template_tags( $post->ID );\n\n echo '</div>';\n echo '</div>';\n}", "function learn_press_single_quiz_preview_mode() {\n\t\tlearn_press_get_template( 'content-quiz/preview-mode.php' );\n\t}", "function preview_theme()\n {\n }", "function showContent()\n {\n if ($this->oprofile) {\n $this->showPreviewForm();\n } else {\n $this->showInputForm();\n }\n }", "public function pagePresentation()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\t\t$oEventmeta = new Oeventmeta($eventId);\r\n\r\n\t\t// Controle de l'autorisation\r\n\t\tif ( $oEvent->getVal('ownerid') != Bn::getValue('user_id') && !Oaccount::isLoginAdmin() ) return false;\r\n\r\n\t\t// Preparer les champs de saisie\r\n\t\t$body = new Body();\r\n\r\n\t\t// Titres\r\n\t\t$t = $body->addP('', '', 'bn-title-2');\r\n\t\t$t->addBalise('span', '', LOC_ITEM_PRESENTATION);\r\n\r\n\t\t// Infos generales\r\n\t\t$form = $body->addForm('frmPresentation', BPREF_UPDATE_PRESENTATION, 'divPreferences_content');\r\n\t\t//$form->getForm()->addMetadata('success', \"updated\");\r\n\t\t//$form->getForm()->addMetadata('dataType', \"'json'\");\r\n\r\n\r\n\t\t$dl = $form->addDiv('', 'bn-div-left');\r\n\t\t$edt = $dl->addEditFile('poster', LOC_LABEL_EVENT_POSTER, '');\r\n\t\t$edt->noMandatory();\r\n\t\t$poster = $oEvent->getVal('poster');\r\n\t\tif (!empty($poster) )\r\n\t\t{\r\n\t\t\t$poster = '../img/poster/'.$poster;\r\n\t\t\t$form->addImage('poster', $poster, 'poster', array('height'=>70, 'width'=>155));\r\n\t\t}\r\n\r\n\t\t$d = $form->addDiv('', 'bn-div-line bn-div-clear');\r\n\t\t$handle=opendir('../skins');\r\n\t\twhile ($file = readdir($handle))\r\n\t\t{\r\n\t\t\tif ($file != \".\" && $file != \"..\" && $file != \"CVS\")\r\n\t\t\t$skins[$file] = $file;\r\n\t\t}\r\n\t\tclosedir($handle);\r\n\t\t$cbo = $form->addSelect('skin', LOC_LABEL_EVENT_SKIN);\r\n\t\t$cbo->addOptions($skins, $oEventmeta->getVal('skin'));\r\n\t\t$d->addBreak();\r\n\r\n\t\t$d = $form->addDiv('', 'bn-div-btn');\r\n\t\tif (!empty($poster) )\r\n\t\t{\r\n\t\t\t$d->addButton('btnDelposter', LOC_BTN_DELETE_POSTER, BPREF_DELETE_POSTER, 'trash', 'divPreferences_content');\r\n\t\t}\r\n\t\t$d->addButtonValid('btnValid', LOC_BTN_UPDATE);\r\n\r\n\t\t// Envoi au navigateur\r\n\t\t$body->display();\r\n\t\treturn false;\r\n\t}", "public function start_previewing_theme()\n {\n }", "private function prehledNavstev(){\n $this->tpl = \"historie-navstev\";\n \n \t$prehled = new HlavniPrehled($this->db);\n \n $this->render = array(\n\t\t\t'navstevy' => $prehled->vypis(@$_POST), \n\t\t);\t\n }", "public function customize_preview_enqueue()\n {\n }", "function getPreviewUrl () {\n return link::preview($this->dir, $this->file);\n }", "public function customize_preview_html5()\n {\n }", "function preview_file($nama_file){\n $url_sh=substr($nama_file,0,-4);\n $url_klik= url('upload/berkas/'.$nama_file);\n // ini link dari route\n $url_pdf=url('upload/berkas/'.$url_sh);\n \n $link_image=\"window.open('\".$url_klik.\"','popup','width=600,height=600,scrollbars=no,resizable=no'); return false;\";\n $link_pdf=\"window.open('\".$url_pdf.\"','popup','width=600,height=600,scrollbars=no,resizable=no'); return false;\";\n\n $file_path = pathinfo(storage_path().'/upload/berkas/'.$nama_file);\n switch(strtolower($file_path['extension'])){\n case\"jpg\":case\"png\":case\"jpeg\":\n echo '\n <a href=\"\" onclick=\"'.$link_image.'\">';\n echo \"<img src='$url_klik' style='width:100px; height:100px'><br/>\";\n echo \"Klik Untuk Lebih Detail\";\n echo \"</a>\";\n break;\n case\"pdf\":case\"PDF\":\n echo '\n <a href=\"\" onclick=\"'.$link_pdf.'\">';\n \n echo \"<i class='fas fa-file-pdf' style='font-size:100px;color:#D81F28'></i><br/>\";\n echo \"Preview file <br>\";\n \n echo \"</a>\";\n break;\t\n default:\n echo \"File tidak ditemukan\";\n break;\t\n\n }\n}", "public function get_preview_name(){\n\t\treturn \"{$this->id}_preview.png\";\n\t}", "function set_headless_preview_link($link) {\n\n global $headless_wp_config_options;\n\n return $headless_wp_config_options['front_end'].'/'.get_post_field('post_name', get_the_ID()).'/';\n}", "function renderToClient();", "function preview_panduan($nama_file){\n \n $url_sh=substr($nama_file,0,-4);\n // ini link dari route\n $url_pdf=url('upload/panduan/'.$url_sh);\n \n $link_pdf=\"window.open('\".$url_pdf.\"','popup','width=600,height=600,scrollbars=no,resizable=no'); return false;\";\n if($nama_file!= \"\"){\n $file_path = pathinfo(storage_path().'/upload/panduan/'.$nama_file);\n switch(strtolower($file_path['extension'])){\n case\"pdf\":case\"PDF\":\n echo '\n <a href=\"\" onclick=\"'.$link_pdf.'\">';\n \n echo \"<i class='fas fa-file-pdf' style='font-size:20px;color:#D81F28'></i>\";\n echo \" Preview<br>\";\n \n echo \"</a>\";\n break;\t\n default:\n echo \"File tidak ditemukan\";\n break;\t\n } \n }\n\n}", "public function print_preview_page() {\n\n\t\t?>\n <div class=\"wrap\">\n <h1><?php echo esc_html( get_admin_page_title() ); ?></h1>\n\t\t\t<?php\n\n\t\t\techo conference_schedule()->get_conference_schedule();\n\n\t\t\t?>\n </div>\n\t\t<?php\n\n\t}", "public function renderContent() {}", "public function customize_preview_init()\n {\n }", "public function customize_preview_init()\n {\n }", "public function is_preview()\n {\n }", "public function is_preview()\n {\n }", "public function is_preview()\n {\n }", "public function settings_previewed()\n {\n }", "public function actionPreview() {\n $output = '';\n $module = Yii::$app->controller->module;\n if (isset($_POST['source'])) {\n $output = (strlen($_POST['source']) > 0) ? HtmlPurifier::process(Markdown::convert($_POST['source'], ['custom' => $module->customConversion])) : $_POST['nullMsg'];\n }\n echo Json::encode($output);\n }", "function renderPage() {\n $parameters = explode(\"/\", $this->getCurrentPage());\n $folder = $parameters[1];\n if (!in_array($folder, $this->folders) && $folder !== \"api\") {\n $name = $this->getCurrentPage();\n require_once $this->getBlueprintPath();\n }\n }", "public function renderQuickEdit() {}", "public function preview() {\n\t\t$image = $this->getImage();\n\n\t\tif(!$image->send()) {\n\t\t\t$this->handleError($image);\n\t\t}\n\n\t\tdie();\n\t}", "public function createContentAndCopyLivePage() {}", "function preview($id){\r\n $content = array();\r\n\r\n // get content from database\r\n $result = $this->reg->db->GetRow('SELECT title, content, last_edited, show_title, show_date, advanced, head\r\n FROM system__content\r\n WHERE id = ?', array($id[0], $_SESSION['SYSTEM']['USER_ID']));\r\n // format for screen\r\n if(count($result)){\r\n $content['title'] = $this->reg->validation->escape_rich_text($result['title']);\r\n $content['content'] = $this->reg->validation->escape_rich_text($result['content']);\r\n $content['date'] = date('M j, Y', $this->reg->validation->escape_html(strtotime($result['last_edited'])));\r\n $content['advanced'] = (bool)$result['advanced'];\r\n $content['show_title'] = (bool)$result['show_title'];\r\n $content['show_date'] = (bool)$result['show_date'];\r\n\r\n // include head if post is set as advanced\r\n if($result['advanced']){\r\n $this->reg->config->set('head.', $result['head']);\r\n }\r\n }\r\n\r\n // return final html\r\n return $content;\r\n }", "function stream_preview_image($post_id)\n {\n }", "public function preview($url)\n {\n $urls = [];\n foreach (array_merge(config('translatable.locales'), [app()->getLocale()]) as $locale) {\n if ($url instanceof Closure) {\n if (! $model = $this->config->getModelInstance()) {\n $urls[$locale] = '';\n\n continue;\n }\n $urls[$locale] = $url($model, $locale);\n } else {\n $urls[$locale] = $url;\n }\n }\n\n $preview = component('lit-crud-preview')->prop('urls', $urls);\n\n return $this->headerRight()\n ->component(new ButtonComponent())\n ->child($preview)\n ->size('sm')\n ->variant('primary');\n }", "function preview_user($nama_file){ /*ini menggunakanan paramerter $nama_file*/\n $url_sh=substr($nama_file,0,-4);\n $url_klik= url('upload/user/'.$nama_file);\n // ini link dari route\n \n $link_image=\"window.open('\".$url_klik.\"','popup','width=600,height=600,scrollbars=no,resizable=no'); return false;\";\n\n if($nama_file!= \"\"){\n\n $file_path = pathinfo(storage_path().'/upload/user/'.$nama_file);\n switch(strtolower($file_path['extension'])){\n case\"jpg\":case\"png\":case\"jpeg\":\n echo '\n <a href=\"\" onclick=\"'.$link_image.'\">';\n echo \"<img src='$url_klik' style='width:100px; height:100px'><br/>\";\n echo \"Klik Untuk Lebih Detail\";\n echo \"</a>\";\n break;\n default:\n echo \"File tidak ditemukan\";\n break;\t\n }\n\n }\n}", "function displayPage()\n {\n $this->getState()->template = 'transition-page';\n }", "public function preview(ColumnBuilder $preview): void\n {\n $preview->col('<img src=\"{image.conversion_urls.thumb}\">');\n }", "public function displayContentOverview() {}", "function hs_admin_content_preview_menu()\n{\n $items['node/%node/preview'] = array(\n 'page callback' => 'hs_admin_content_preview_page',\n 'page arguments' => array(1),\n 'access callback' => 'node_access',\n 'access arguments' => array('view', 1),\n 'file' => 'includes/hs_admin.content_preview.inc',\n 'type' => MENU_CALLBACK,\n );\n\n $items['node/preview'] = array(\n 'page callback' => 'hs_admin_content_preview_page',\n 'page arguments' => array(NULL),\n 'access callback' => 'user_access',\n 'access arguments' => array('access content'),\n 'file' => 'includes/hs_admin.content_preview.inc',\n 'type' => MENU_CALLBACK,\n );\n\n return $items;\n}", "public function preview() {\n $input = isset($this->request->data['input']) ? $this->request->data['input'] : '';\n\n $this->set('input', $input);\n $this->layout = false;\n }", "function hs_admin_content_preview_page($node = NULL)\n{\n global $user;\n \n // Check if there is an updated version of the node in cache\n $cid = _hs_admin_content_preview_generate_cid($node);\n $cache = cache_get($cid, 'cache');\n\n if ($cache) {\n // Prepare cached node to be displayed\n $node = $cache->data;\n _field_invoke_multiple('load', 'node', array($node->nid => $node));\n }\n\n if (!$node) {\n // Node does not exist in database, and no cached draft is available\n return MENU_NOT_FOUND;\n }\n\n // Hide toolbar\n $module_path = drupal_get_path('module', 'hs_admin');\n drupal_add_css($module_path . '/css/hs_admin.content_preview.css');\n\n // Temporarily switch to anonymous user\n drupal_save_session(FALSE);\n $current_user = $user;\n $user = drupal_anonymous_user();\n\n // Render the node\n $render = node_view($node);\n\n // Restore the current user\n $user = $current_user;\n drupal_save_session(TRUE);\n\n return $render;\n}", "public function preview($id,$key='') {\n $this->page = $id;\n \n $this->page -= 1;\n \n return $this->page;\n }", "public function preview($which_cover) {\n\t\t$this->return_val->status = 1;\n\t\t$this->return_val->msg = \"\";\n\t\t$data[\"cover\"] = (empty($which_cover) || is_null($which_cover) ? \"front\" : $which_cover);\n\t\t$this->return_val->preview = $this->load->view(\"coverpreview\", $data, TRUE);\n\t\techo json_encode($this->return_val);\n\t}", "function smof_preview_init( $wp_customize ) {\n global $smof_data, $smof_details;\n wp_dequeue_style( 'shoestrap_css' );\n wp_deregister_style( 'shoestrap_css' );\n\n $less = shoestrap_compile_css('less');\n print '<link rel=\"stylesheet/less\" type=\"text/less\" href=\"'.str_replace( \".css\", \".less\", shoestrap_css( 'url' ) ).'\">';\n print '<script type=\"text/javascript\">\n less = {\n env: \"development\", // or \"production\"\n async: false, // load imports async\n fileAsync: false, // load imports async when in a page under a file protocol\n poll: 1000, // when in watch mode, time in ms between polls\n functions: {}, // user functions, keyed by name\n dumpLineNumbers: \"comments\", // or \"mediaQuery\" or \"all\"\n relativeUrls: false,// whether to adjust urls to be relative if false, urls are already relative to the entry less file\n rootpath: \"<?php get_template_directory_uri(); ?>/assets/less/\"\n };\n </script>';\n wp_enqueue_script( 'less-js', get_template_directory_uri() . SMOF_DIR . 'addons/assets/js/less-1.3.3.min.js' );\n wp_enqueue_script( 'preview-js', get_template_directory_uri() . SMOF_DIR . 'addons/assets/js/preview.js' );\n wp_localize_script( 'preview-js', 'smofPost', array(\n 'data' => $smof_data,\n 'variables' => $smof_details\n ));\n}", "public static function create_preview()\n\t{\n\t\t$current = self::current_layout();\n\t\t\n\t\t//start output buffer\n\t\tob_start();\t\t\n\t\t\n\t\t//output current tmpl\n\t\trequire_once( THEME_LAYOUTS . $current . '/templates/tmpl-layout.php' );\t\n\t\t\n\t\t//get output buffer and store in an array\t\t\n\t\t$output = ob_get_clean();\n\t\t\n\t\treturn $output;\t\n\t}", "function get_preview_post_link($post = \\null, $query_args = array(), $preview_link = '')\n {\n }", "public function preview($slug)\n {\n $page = Page::where('slug', $slug)\n ->where('ip', \\Request::getClientIp())\n ->first();\n\n\n $formView = view('site._cta_form_top');\n\n\n return view('tok3-publisher::page', compact('page'));\n }", "public function show(){\n\t\t // Default size is preview\n if(!empty($_GET['size'])) $size = $_GET['size'];\n else $size = 'preview';\n\n /** @var Photo $pobj */\n $pobj = Photo::fetch($_GET['id']);\n if($pobj !== false && !$pobj->temporary && $pobj->data->status == 'saved') $pobj->show($size);\n else $this->zajlib->reroute('__error', ['system_api_photo_show', []]);\n\t\t}", "public function getPreview()\n {\n\tif ($this->_preview != null) {\n\t return self::PREVIEW_PATH . $this->_preview;\n\t} else {\n\t return null;\n\t}\n }", "function default_preview( \\WP_Post $post, array $importer ) {\n\t$data = json_decode( $post->post_content, true );\n\t$header = array_shift( $data );\n\n\t// Load the default preview table view.\n\tinclude PATH . '/templates/default-preview.php';\n}", "public function htmlpreviewAction()\n {\n $this->_setTitle();\n $this->loadLayout();\n\n $data = $this->getRequest()->getParams();\n if (empty($data) || !isset($data['id'])) {\n $this->_forward('noRoute');\n return $this;\n }\n\n // set default value for selected store\n $data['preview_store_id'] = Mage::app()->getDefaultStoreView()->getId();\n\n $this->getLayout()->getBlock('preview_form')->setFormData($data);\n $this->renderLayout();\n }", "public function preview()\n {\n $message = $this->get('message');\n if ($message) {\n $this->console->output($message);\n }\n }", "public function render()\n {\n include_once __DIR__ . '/templates/back.php';\n }", "function bpfit_walk_subtab_show_screen() {\n\t\t\tadd_action( 'bp_template_title', array($this, 'bpfit_walk_subtab_function_to_show_title') );\n\t\t\tadd_action( 'bp_template_content', array($this, 'bpfit_walk_subtab_function_to_show_content') );\n\t\t\tbp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );\n\t\t}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}", "public function render() {}" ]
[ "0.6927175", "0.6927175", "0.6927175", "0.6927175", "0.645602", "0.6347757", "0.6310612", "0.6287616", "0.6255758", "0.6248266", "0.6242464", "0.6230722", "0.62225723", "0.6192179", "0.6165949", "0.61003613", "0.6042824", "0.60307187", "0.59793705", "0.59685934", "0.59326994", "0.5910567", "0.59078455", "0.58924514", "0.5886039", "0.58710724", "0.58710724", "0.587106", "0.5855316", "0.5851539", "0.5794233", "0.5789564", "0.5785146", "0.57840806", "0.57790744", "0.57763445", "0.575823", "0.5711144", "0.57008535", "0.56992686", "0.5695948", "0.56916124", "0.56751424", "0.56741315", "0.5665564", "0.56464905", "0.56458324", "0.5641665", "0.5636358", "0.5635318", "0.5629774", "0.5629235", "0.5629235", "0.56074816", "0.55669105", "0.5562496", "0.5551778", "0.5550377", "0.55414665", "0.55408335", "0.5525573", "0.55206305", "0.5518078", "0.5514435", "0.55109817", "0.5500979", "0.54960984", "0.5495584", "0.5490158", "0.54879934", "0.5482717", "0.5478821", "0.54660183", "0.54637325", "0.5454816", "0.54493153", "0.5447782", "0.5446843", "0.5444487", "0.5439881", "0.5432732", "0.5426934", "0.5422605", "0.5422605", "0.5422605", "0.5422605", "0.5422605", "0.5422605", "0.5422605", "0.5422605", "0.5422605", "0.5422605", "0.5422605", "0.5422605", "0.5422605", "0.5422605", "0.5422605", "0.5422605", "0.5422605", "0.5422605", "0.5422605" ]
0.0
-1
Display a listing of the resource.
public function index() { // $subtexts=SubText::orderBy('created_at','ASC')->get(); return view('back.subtext.index',compact('subtexts')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n {\n $this->booklist();\n }", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7447426", "0.73628515", "0.73007894", "0.7249563", "0.7164474", "0.7148467", "0.71320325", "0.7104678", "0.7103152", "0.7100512", "0.7048493", "0.6994995", "0.69899315", "0.6935843", "0.6899995", "0.68999326", "0.6892163", "0.6887924", "0.6867505", "0.6851258", "0.6831236", "0.68033123", "0.6797587", "0.6795274", "0.67868614", "0.67610204", "0.67426085", "0.67303514", "0.6727031", "0.67257243", "0.67257243", "0.67257243", "0.67195046", "0.67067856", "0.67063624", "0.67045796", "0.66655326", "0.666383", "0.66611767", "0.66604036", "0.66582054", "0.6654805", "0.6649084", "0.6620993", "0.66197145", "0.6616024", "0.66077465", "0.6602853", "0.6601494", "0.6593894", "0.65878326", "0.6586189", "0.6584675", "0.65813804", "0.65766823", "0.65754175", "0.657203", "0.657202", "0.65713936", "0.65642136", "0.6563951", "0.6553249", "0.6552584", "0.6546312", "0.6536654", "0.6534106", "0.6532539", "0.6527516", "0.6526785", "0.6526042", "0.65191233", "0.6518727", "0.6517732", "0.6517689", "0.65155584", "0.6507816", "0.65048593", "0.6503226", "0.6495243", "0.6492096", "0.6486592", "0.64862204", "0.6485348", "0.6483991", "0.64789015", "0.6478804", "0.64708763", "0.6470304", "0.64699143", "0.6467142", "0.646402", "0.6463102", "0.6460929", "0.6458856", "0.6454334", "0.6453653", "0.645357", "0.6450551", "0.64498454", "0.64480853", "0.64453584" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // $titles=Title::get(); return view('back.subtext.create',compact('titles')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n 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 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('libro.create');\n }", "public function create()\n {\n return view('libro.create');\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 {\n return view('saldo.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\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.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 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 newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create()\n {\n return view('student::students.student.create');\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}" ]
[ "0.7593278", "0.7593278", "0.75862813", "0.7577653", "0.7570922", "0.7499259", "0.743598", "0.7431475", "0.738692", "0.7351195", "0.7336038", "0.73110175", "0.7294184", "0.7280905", "0.7272454", "0.72410536", "0.7229507", "0.72239184", "0.7184587", "0.7177518", "0.7172079", "0.7148124", "0.7142547", "0.71422434", "0.713585", "0.712646", "0.7121425", "0.7113886", "0.7113886", "0.7113886", "0.71099454", "0.7091995", "0.70838404", "0.70796615", "0.70783395", "0.70560604", "0.70560604", "0.7053403", "0.7037733", "0.7037483", "0.7034196", "0.7032379", "0.7028811", "0.70255613", "0.7025196", "0.7018564", "0.7015596", "0.7003297", "0.7002209", "0.6999467", "0.6994898", "0.69925386", "0.69918746", "0.69880474", "0.6985266", "0.69648707", "0.69642234", "0.69544894", "0.6950107", "0.6949808", "0.6946825", "0.69433236", "0.6939847", "0.6938437", "0.6936151", "0.69359493", "0.69359493", "0.6932416", "0.69302046", "0.6927174", "0.69250137", "0.6922311", "0.6917047", "0.69137764", "0.6910701", "0.6909241", "0.6908554", "0.69062465", "0.69030714", "0.6900927", "0.689929", "0.6898352", "0.6893204", "0.68918675", "0.6891051", "0.68910086", "0.6889982", "0.6889982", "0.68871695", "0.6886071", "0.68850255", "0.6882077", "0.688044", "0.6879478", "0.6874531", "0.6871747", "0.6871178", "0.686907", "0.6868627", "0.6868156", "0.68674266" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // $request->validate([ 'subtext'=>'min:3|required', 'title'=>'required', 'image'=>'image|mimes:jpeg,png,jpg|max:2048', 'conten'=>'min:10|required' ]); $isSlug = SubText::where('slug',Str::slug($request->subtext))->first(); if ($isSlug) { toastr()->error($request->subtext.' adında bir yazı zaten mevcut.'); return redirect()->back(); } $subtext=new SubText; $subtext->title_id=$request->title; $subtext->textsub=$request->subtext; $subtext->article=$request->conten; $subtext->slug=Str::slug($request->subtext); if($request->hasFile('image')) { $imageName= uniqid().$request->image->getClientOriginalName(); $request->image->move(public_path('uploads/img'),$imageName); $subtext->img='uploads/img/'.$imageName; } else { $subtext->img=""; } $subtext->save(); toastr()->success('Başarılı', 'Makale başırıyla oluşturuldu'); return redirect()->route('admin.altmetin.index'); }
{ "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) { // $subtext=SubText::findOrFail($id); if (File::exists($subtext->img)) { File::delete(public_path($subtext->img)); } $subtext->delete(); toastr()->success('Başarılı', 'Alt Metin başırıyla Silindi'); return redirect()->route('admin.altmetin.index'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show(Resena $resena)\n {\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function get_resource();", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "public function display() {\n echo $this->render();\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n {\n //\n $this->_show($id);\n }", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public abstract function display();", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "abstract public function resource($resource);", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8232636", "0.81890994", "0.68296117", "0.64987075", "0.649589", "0.64692974", "0.64633286", "0.63640857", "0.6307513", "0.6281809", "0.621944", "0.61926234", "0.61803305", "0.6173143", "0.61398774", "0.6119022", "0.61085826", "0.6106046", "0.60947937", "0.6078597", "0.6047151", "0.60409963", "0.6021287", "0.5989136", "0.5964405", "0.5962407", "0.59518087", "0.59309924", "0.5921466", "0.5908002", "0.5908002", "0.5908002", "0.59051657", "0.5894554", "0.5871459", "0.5870088", "0.586883", "0.5851384", "0.58168566", "0.58166975", "0.5815869", "0.58056176", "0.5799148", "0.5795126", "0.5791158", "0.57857597", "0.5783371", "0.5761351", "0.57592535", "0.57587147", "0.5746491", "0.57460666", "0.574066", "0.5739448", "0.5739448", "0.57295275", "0.57293373", "0.5729069", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57214445", "0.57149816", "0.5712036", "0.5710076", "0.57073003", "0.5707059", "0.5705454", "0.5705454", "0.5700382", "0.56997055", "0.5693362", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { //Update view $subtext = SubText::findOrFail($id); $titles=Title::all(); return view('back.subtext.update',compact('subtext','titles')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit(form $form)\n {\n //\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.7854417", "0.7692986", "0.72741747", "0.72416574", "0.7173436", "0.706246", "0.70551765", "0.698488", "0.6948513", "0.694731", "0.69425464", "0.6929177", "0.6902573", "0.6899662", "0.6899662", "0.6878983", "0.6865711", "0.6861037", "0.6858774", "0.6847512", "0.6836162", "0.68129057", "0.68083996", "0.68082106", "0.6803853", "0.67966306", "0.6794222", "0.6794222", "0.6789979", "0.67861426", "0.678112", "0.677748", "0.67702436", "0.67625374", "0.6748088", "0.67475355", "0.67475355", "0.67446774", "0.6742005", "0.67374676", "0.6727497", "0.6714345", "0.6696231", "0.6693851", "0.6689907", "0.6689746", "0.6687102", "0.66870165", "0.6684574", "0.6670877", "0.66705006", "0.6667089", "0.6667089", "0.6663205", "0.66626745", "0.66603845", "0.66593564", "0.66560745", "0.66545844", "0.66447026", "0.6633528", "0.66319114", "0.66298395", "0.66298395", "0.6622365", "0.6621021", "0.66170275", "0.661664", "0.6612467", "0.66107714", "0.6608453", "0.65979743", "0.659645", "0.6596389", "0.6592672", "0.6591205", "0.6588125", "0.6582166", "0.6581656", "0.65811247", "0.65785724", "0.65782833", "0.6576397", "0.6570971", "0.6569483", "0.6568432", "0.656811", "0.6563493", "0.6563493", "0.65622604", "0.65602434", "0.65585065", "0.6557997", "0.65574414", "0.6556701", "0.65565753", "0.6556226", "0.6556107", "0.6549118", "0.65485924", "0.65463555" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // $request->validate([ 'subtext'=>'min:3', 'image'=>'image|mimes:jpeg,png,jpg|max:2048' ]); $subtext=SubText::findOrFail($id); $subtext->title_id=$request->title; $subtext->textsub=$request->subtext; $subtext->article=$request->conten; $subtext->slug=Str::slug($request->subtext); if (File::exists($subtext->img)) { File::delete(public_path($subtext->img)); } if($request->hasFile('image')) { $imageName=Str::slug($request->subtext).'.'.$request->image->getClientOriginalExtension(); $request->image->move(public_path('uploads'),$imageName); $subtext->img='uploads/'.$imageName; } $subtext->save(); toastr()->success( 'Alt Metin başırıyla güncellendi','Başarılı'); return redirect()->route('admin.altmetin.index'); }
{ "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 update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "public function update($request, $id);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "abstract public function put($data);", "public function testUpdateSupplierUsingPUT()\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 update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(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, $input);", "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(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "public function 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 put($path, $data = null);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\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.7424714", "0.70635", "0.7058482", "0.68981785", "0.6581708", "0.6451537", "0.634705", "0.62108016", "0.61452574", "0.61245036", "0.6117", "0.61005783", "0.6088965", "0.6055291", "0.6020192", "0.60089755", "0.5974869", "0.594607", "0.5940399", "0.5940387", "0.5893692", "0.5861878", "0.58555347", "0.58555347", "0.58521295", "0.5816296", "0.580588", "0.5754183", "0.5754183", "0.573585", "0.57248604", "0.57152486", "0.5696124", "0.56926364", "0.5686974", "0.56704843", "0.5657175", "0.5652319", "0.56505626", "0.56371164", "0.5636333", "0.5634292", "0.5633077", "0.56302124", "0.56226414", "0.5608414", "0.56038505", "0.55932486", "0.55845344", "0.55840373", "0.5583145", "0.55769825", "0.5572918", "0.5568501", "0.55649704", "0.5564084", "0.5562276", "0.5562276", "0.5562276", "0.5562276", "0.5562276", "0.5560055", "0.5556887", "0.5555794", "0.5555651", "0.55555624", "0.55542725", "0.5545186", "0.5545042", "0.554096", "0.5540548", "0.5537395", "0.55360836", "0.55359083", "0.55250585", "0.55194676", "0.55176675", "0.5514794", "0.55101085", "0.5510089", "0.5507262", "0.5504258", "0.55022335", "0.5501283", "0.5500848", "0.5499872", "0.5497986", "0.5497986", "0.5495836", "0.54956913", "0.5494868", "0.5494812", "0.5493479", "0.5484617", "0.54805785", "0.54803264", "0.54791373", "0.546626", "0.54649556", "0.5463194", "0.54580057" ]
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
Setup before running any test case
public static function setUpBeforeClass() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp ()\n {}", "protected function doSetup(): void\n {\n }", "protected function setUp() { }", "protected function setUp() { }", "public function setup() {}", "function setUp() {\n\t\t\n\t}", "function setUp() {\n\t\t\n\t}", "protected function setUp()\n {}", "public function setUp() {}", "public function setUp() {}", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "public function setUp() {}" ]
[ "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8435112", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.8434914", "0.84345204", "0.84345204", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.84340215", "0.82915086", "0.8290926", "0.8224121", "0.8224121", "0.82144415", "0.82021075", "0.82021075", "0.8123121", "0.8108245", "0.81079835", "0.8106947", "0.8106289" ]
0.0
-1
Setup before running each test case
public function setUp() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "function setUp() {\n\t\t\n\t}", "function setUp() {\n\t\t\n\t}", "protected function doSetup(): void\n {\n }", "protected function setUp ()\n {}", "public function setUp(): void\n {\n $this->setUpWithNoResult();\n }", "protected function setUp() { }", "protected function setUp() { }", "public function setUp()\n {\n\n $this->db = Db::getActive();\n $this->response = Response::getActive();\n\n }", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}", "public function setUp() {\n\t\t$this->student = StudentData::getStudent();\n\t\t$this->school = SchoolData::getSchool();\n\t}" ]
[ "0.8136157", "0.8136157", "0.8136157", "0.8136157", "0.8136157", "0.8136157", "0.8136157", "0.8136157", "0.8136157", "0.8136157", "0.8136157", "0.8136157", "0.8136157", "0.8136157", "0.8136157", "0.8136117", "0.8136117", "0.8136117", "0.8136117", "0.8136117", "0.8136117", "0.8136117", "0.8136117", "0.8136117", "0.8136117", "0.8136117", "0.8136117", "0.8136117", "0.8136117", "0.8135426", "0.8135426", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8134729", "0.8042364", "0.8042364", "0.8029678", "0.80187607", "0.79391724", "0.7926595", "0.7926595", "0.79100674", "0.7904251", "0.7904251", "0.7904251", "0.7904251" ]
0.0
-1
Clean up after running each test case
public function tearDown() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp();", "public function cleanUp();", "public function cleanUp();", "public function cleanup() {\n\t\t//TODO\n\t}", "public function cleanTestActivities()\n {\n\n $this->collectCurrentTestUsers();\n $this->cleanExerciseUploadPictures();\n $this->cleanDeviceUploadPictures();\n $this->resetDatabase();\n }", "protected function tearDown(): void {\n unset($this->integration);\n unset($this->ccm);\n unset($this->session);\n }", "public function teardown()\n {\n //\n }", "protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }", "public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }", "protected function tearDown() {\n\n $this->client = null;\n $this->deleteTestLocations();\n $this->locIDs = null;\n reuse_generateXML();\n }", "public function cleanup()\n {\n }", "protected function tearDown(): void {\n\t\t$this->http_client = null;\n\t\t$this->process_transactions = array();\n\n\t\tif ( ! empty( $this->transactions ) ) {\n\t\t\t$this->transactions = array();\n\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\t$this->key_pairs['tag'] = $this->tag;\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\tTestHelpers::removeJsonFile( $this->process_tag );\n\t\t\tTestHelpers::removeJsonFile( $this->tag );\n\t\t}\n\t}", "protected function cleanUp()\n\t{\n\t\t// clean\n\t\t$this->killExceededTasks();\n\t\t$this->cleanHistory();\n\t}", "public function teardown()\n {\n }", "function __destruct() {\n if ($this->testDir) {\n $this->eraseTempDir();\n }\n $this->unsetMockSession();\n }", "public function tearDown()\n {\n unset($this->_standardLib);\n unset($this->_daughter);\n }", "public function tearDown(): void\n {\n parent::tearDown();\n unset($this->purifier);\n unset($this->em);\n unset($this->objectiveManager);\n unset($this->learningMaterialManager);\n unset($this->courseLearningMaterialManager);\n unset($this->sessionLearningMaterialManager);\n unset($this->sessionDescriptionManager);\n unset($this->commandTester);\n }", "public function cleanup()\n\t{\n\t}", "public function tearDown() {\n $this->container = null;\n $this->model = null;\n $this->request = null;\n $this->response = null;\n $this->responseHeaders = null;\n $this->responseWriter = null;\n }", "protected function tearDown()\n {\n unset($this->output);\n }", "public function tearDown(): void\n {\n parent::tearDown();\n unset($this->filesystem);\n unset($this->diskSpace);\n unset($this->commandTester);\n }", "protected function tearDown() {\n $this->osapiCollection = null;\n $this->list = null;\n parent::tearDown();\n }", "public function tearDown()\n {\n // delete your instance\n OGR_DS_Destroy($this->hSrcDataSource);\n\n delete_directory($this->strPathToOutputData);\n\n unset($this->strPathToOutputData);\n unset($this->strTmpDumpFile);\n unset($this->strPathToData);\n unset($this->strPathToStandardData);\n unset($this->bUpdate);\n unset($this->hOGRSFDriver);\n unset($this->hLayer);\n unset($this->iSpatialFilter);\n unset($this->hSrcDataSource);\n }", "public function cleanup()\n\t{\n\t\t\n\t}", "protected function tearDown()\r\n {\r\n DirectoryManager::recursiveRemoveDir('data/tests');\r\n }", "public function tearDown(): void\n {\n self::$environ->cleanupTestUploadFiles();\n self::$environ->clean();\n }", "public function tearDown() {\n $this->resource = null;\n $this->response = null;\n $this->database = null;\n $this->storage = null;\n $this->event = null;\n $this->manager = null;\n }", "protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }", "public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}", "public function tearDown() : void {\n\t\tunset($this->ls); /* Kill circular references */\n\t\tunset($this->lsconn); /* Kill circular references */\n\t}", "public function cleanup(): void\n {\n }", "public function cleanup(): void\n {\n }", "protected function tearDown(): void\n\t{\n\t\tglobal $modSettings;\n\n\t\t// remove temporary test data\n\t\tunset($modSettings);\n\t}", "protected function tearDown() {\n gc_collect_cycles();\n }", "public function tearDown(): void {\n // Remove any temporary directories that were created.\n $filesystem = new Filesystem();\n foreach ($this->tmpDirs as $dir) {\n $filesystem->remove($dir);\n }\n // Clear out variables from the previous pass.\n $this->tmpDirs = [];\n $this->io = NULL;\n // Clear the composer cache dir, if it was set\n putenv('COMPOSER_CACHE_DIR=');\n }", "public function tearDown() {\n $this->transformation = null;\n }", "public function tearDown() {\n $this->transformation = null;\n }", "public function tearDown() {\n $this->transformation = null;\n }", "protected function tearDown()\n {\n $this->regular1 = null;\n $this->regular2 = null;\n $this->rental1 = null;\n $this->rental2 = null;\n }", "protected function tearDown()\n {\n $this->calculator = NULL;\n }", "protected function tearDown(): void {\n $this->parser = null;\n }", "public function teardown()\n {\n if ($this->csvFile) {\n unlink($this->csvFile);\n $this->csvFile = null;\n }\n\n if ($this->photoZip) {\n unlink($this->photoZip);\n $this->photoZip = null;\n }\n }", "public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }", "protected function tearDown()\n {\n session_destroy(); //req'd because Kml class sets a cookie\n $this->clearRequest();\n $this->clearTmpFiles();\n }", "public function Cleanup()\r\n\t{\r\n\t}", "protected function tearDown()\n {\n \tunset($this->object);\n }", "protected function tearDown()\n {\n \tunset($this->object);\n }", "protected function tearDown()\n {\n \tunset($this->object);\n }", "protected function tearDown()\n {\n \tunset($this->object);\n }", "public function tearDown() {\n\t\tFixtures::clear('db');\n\t\tGalleries::reset();\n\t\tImages::reset();\n\t}", "public function tearDown() {\r\n\t\tunset($this->ImgTblHelper, $this->Controller, $this->View);\r\n\t\tparent::tearDown();\r\n\t}", "protected function tearDown(): void\n {\n $this->autorizacao = null;\n $this->transacao = null;\n $this->object = null;\n }", "protected function tearDown() {\r\n\t\t$this->dbh = null;\r\n\t\t$this->storage = null;\r\n\t\tparent::tearDown ();\r\n\t}", "public function tearDown()\n {\n $this->objectManager->create(\\Magento\\Tax\\Test\\TestStep\\DeleteAllTaxRulesStep::class, [])->run();\n }", "protected function tearDown() {\n $this->stack = null;\n }" ]
[ "0.7986577", "0.7986577", "0.7986577", "0.7986577", "0.7986577", "0.7986577", "0.7986577", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7985355", "0.7984603", "0.7984603", "0.7984603", "0.7984603", "0.7984603", "0.7984603", "0.7849293", "0.7849293", "0.7849293", "0.7694298", "0.76874626", "0.7666533", "0.76380146", "0.76114917", "0.760226", "0.75978726", "0.7592129", "0.75776577", "0.75721335", "0.75633174", "0.75329137", "0.7531837", "0.7510589", "0.74654126", "0.745458", "0.7447515", "0.7437701", "0.7431275", "0.7421027", "0.74198663", "0.74124926", "0.73955464", "0.73935556", "0.73906827", "0.7390532", "0.73890996", "0.7387174", "0.7387174", "0.7383654", "0.7382436", "0.7380952", "0.73754853", "0.73754853", "0.73754853", "0.7374819", "0.73588187", "0.7354074", "0.73520625", "0.73357856", "0.73333144", "0.7328617", "0.73274535", "0.73274535", "0.73274535", "0.73274535", "0.73209697", "0.7312426", "0.730616", "0.7304303", "0.7294625", "0.7282233" ]
0.0
-1
Clean up after running all test cases
public static function tearDownAfterClass() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp() {}", "public function cleanUp();", "public function cleanUp();", "public function cleanUp();", "public function cleanup() {\n\t\t//TODO\n\t}", "public function cleanTestActivities()\n {\n\n $this->collectCurrentTestUsers();\n $this->cleanExerciseUploadPictures();\n $this->cleanDeviceUploadPictures();\n $this->resetDatabase();\n }", "public function cleanup()\n {\n }", "protected function cleanUp()\n\t{\n\t\t// clean\n\t\t$this->killExceededTasks();\n\t\t$this->cleanHistory();\n\t}", "public function tearDown()\n {\n unset($this->db);\n unset($this->statement);\n unset($this->mockData);\n }", "public function tearDown()\n {\n unset($this->_standardLib);\n unset($this->_daughter);\n }", "public function teardown()\n {\n //\n }", "protected function tearDown(): void {\n unset($this->integration);\n unset($this->ccm);\n unset($this->session);\n }", "protected function tearDown() {\n\n $this->client = null;\n $this->deleteTestLocations();\n $this->locIDs = null;\n reuse_generateXML();\n }", "public function cleanup()\n\t{\n\t}", "protected function tearDown(): void\n {\n $this->config = null;\n $this->container = null;\n $this->instance = null;\n }", "public function tearDown(): void\n {\n parent::tearDown();\n unset($this->purifier);\n unset($this->em);\n unset($this->objectiveManager);\n unset($this->learningMaterialManager);\n unset($this->courseLearningMaterialManager);\n unset($this->sessionLearningMaterialManager);\n unset($this->sessionDescriptionManager);\n unset($this->commandTester);\n }", "public function teardown()\n {\n }", "public function cleanup()\n\t{\n\t\t\n\t}", "function __destruct() {\n if ($this->testDir) {\n $this->eraseTempDir();\n }\n $this->unsetMockSession();\n }", "protected function tearDown(): void {\n\t\t$this->http_client = null;\n\t\t$this->process_transactions = array();\n\n\t\tif ( ! empty( $this->transactions ) ) {\n\t\t\t$this->transactions = array();\n\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\t$this->key_pairs['tag'] = $this->tag;\n\t\t\tCrudTable\\delete_rows( 'transactions', $this->key_pairs, 100 );\n\n\t\t\tTestHelpers::removeJsonFile( $this->process_tag );\n\t\t\tTestHelpers::removeJsonFile( $this->tag );\n\t\t}\n\t}", "protected function tearDown()\r\n {\r\n DirectoryManager::recursiveRemoveDir('data/tests');\r\n }", "public function tearDown()\n {\n // delete your instance\n OGR_DS_Destroy($this->hSrcDataSource);\n\n delete_directory($this->strPathToOutputData);\n\n unset($this->strPathToOutputData);\n unset($this->strTmpDumpFile);\n unset($this->strPathToData);\n unset($this->strPathToStandardData);\n unset($this->bUpdate);\n unset($this->hOGRSFDriver);\n unset($this->hLayer);\n unset($this->iSpatialFilter);\n unset($this->hSrcDataSource);\n }", "protected function tearDown() {\n gc_collect_cycles();\n }", "public function tearDown() {\n $this->container = null;\n $this->model = null;\n $this->request = null;\n $this->response = null;\n $this->responseHeaders = null;\n $this->responseWriter = null;\n }", "public function tearDown(): void\n {\n parent::tearDown();\n unset($this->filesystem);\n unset($this->diskSpace);\n unset($this->commandTester);\n }", "public function tearDown(): void {\n // Remove any temporary directories that were created.\n $filesystem = new Filesystem();\n foreach ($this->tmpDirs as $dir) {\n $filesystem->remove($dir);\n }\n // Clear out variables from the previous pass.\n $this->tmpDirs = [];\n $this->io = NULL;\n // Clear the composer cache dir, if it was set\n putenv('COMPOSER_CACHE_DIR=');\n }", "public function cleanup(): void\n {\n }", "public function cleanup(): void\n {\n }", "public function Cleanup()\r\n\t{\r\n\t}", "public function tearDown() : void {\n\t\tunset($this->ls); /* Kill circular references */\n\t\tunset($this->lsconn); /* Kill circular references */\n\t}", "protected function tearDown()\n {\n unset($this->output);\n }", "public function tearDown(): void\n {\n self::$environ->cleanupTestUploadFiles();\n self::$environ->clean();\n }", "protected function tearDown() {\n $this->osapiCollection = null;\n $this->list = null;\n parent::tearDown();\n }", "protected function tearDown()\n {\n $this->calculator = NULL;\n }", "protected function tearDown(): void {\n $this->parser = null;\n }", "protected function tearDown()\n {\n $this->compilerPass = null;\n $this->container = null;\n parent::tearDown();\n }", "protected function tearDown()\n {\n $this->regular1 = null;\n $this->regular2 = null;\n $this->rental1 = null;\n $this->rental2 = null;\n }", "public function tearDown() {\n\t\tFixtures::clear('db');\n\t\tGalleries::reset();\n\t\tImages::reset();\n\t}", "protected function tearDown()\n {\n \\RPI\\Foundation\\Helpers\\FileUtils::delTree(__DIR__.\"/LESSPHPTest/ROOT\");\n }", "public function tearDown() {\n $this->resource = null;\n $this->response = null;\n $this->database = null;\n $this->storage = null;\n $this->event = null;\n $this->manager = null;\n }", "protected function tearDown(): void\n\t{\n\t\tglobal $modSettings;\n\n\t\t// remove temporary test data\n\t\tunset($modSettings);\n\t}", "public function tearDown() {\n if ($this->wedisabledgc) {\n gc_enable();\n }\n $this->wedisabledgc = false;\n }", "public function tearDown()\n {\n $fs = new SymfonyFileSystem();\n $fs->remove($this->fakeTestFileDir);\n\n unset($this->builder);\n unset($this->builder);\n unset($this->fs);\n m::close();\n }", "protected function tearDown(): void\n {\n $this->provider = null;\n $this->response = null;\n }", "function endTest() {\n unset($this->CalendarRecursion);\n unset($this->CalendarInstance);\n unset($this->Activity);\n ClassRegistry::flush();\n }", "public function tearDown()\n {\n unset(\n $this->plugins,\n $this->events,\n $this->connection,\n $this->config\n );\n }", "protected function tearDown()\n {\n session_destroy(); //req'd because Kml class sets a cookie\n $this->clearRequest();\n $this->clearTmpFiles();\n }", "public function tearDown() {\r\n\t\tunset($this->ImgTblHelper, $this->Controller, $this->View);\r\n\t\tparent::tearDown();\r\n\t}", "public function tearDown() {\n $this->transformation = null;\n }", "public function tearDown() {\n $this->transformation = null;\n }", "public function tearDown() {\n $this->transformation = null;\n }", "protected function tearDown() {\r\n\t\t$this->dbh = null;\r\n\t\t$this->storage = null;\r\n\t\tparent::tearDown ();\r\n\t}", "public function tearDown()\n\t{\n\t\tunset($this->target);\n\t}", "function tearDown() {\n\t\t$this->wfRecursiveRemoveDir( $this->tmpName );\n\t}", "protected function tearDown()\n {\n Phlash::clear();\n }", "public function tearDown()\n {\n unset($this->filterRepositoryMock);\n unset($this->notificationContextManagerMock);\n unset($this->notificationTranslatorMock);\n unset($this->filterManager);\n }" ]
[ "0.79781395", "0.79781395", "0.79781395", "0.79781395", "0.79781395", "0.79781395", "0.79781395", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976836", "0.7976344", "0.7976344", "0.7976344", "0.7976344", "0.7976344", "0.7976344", "0.78772247", "0.78772247", "0.78772247", "0.77385294", "0.7622718", "0.7590846", "0.7581981", "0.75642306", "0.75500023", "0.7537886", "0.75273365", "0.7519937", "0.7509883", "0.7505579", "0.74835205", "0.74744475", "0.7472191", "0.7471073", "0.7448932", "0.74277306", "0.74264514", "0.7404205", "0.739177", "0.7386229", "0.7383461", "0.738092", "0.738092", "0.73677146", "0.73663706", "0.73597026", "0.734277", "0.7338558", "0.73383325", "0.7336859", "0.73303896", "0.7327291", "0.73259425", "0.7311458", "0.7303411", "0.7294846", "0.7285744", "0.7283386", "0.7278399", "0.7277675", "0.7275594", "0.72737646", "0.7273622", "0.7269152", "0.7269152", "0.7269152", "0.72667706", "0.72666764", "0.7249254", "0.7248658", "0.72467804" ]
0.0
-1
Create the event listener.
public function __construct() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addRequestCreateListener($listener);", "public function onEvent();", "private function init_event_listeners() {\n\t\t// add_action('wp_ajax_example_action', [$this, 'example_function']);\n\t}", "public function listener(Listener $listener);", "protected function setupListeners()\n {\n //\n }", "function eventRegister($eventName, EventListener $listener);", "public function listen($event, $listener);", "private function createStreamCallback()\n {\n $read =& $this->readListeners;\n $write =& $this->writeListeners;\n $this->streamCallback = function ($stream, $flags) use(&$read, &$write) {\n $key = (int) $stream;\n if (\\EV_READ === (\\EV_READ & $flags) && isset($read[$key])) {\n \\call_user_func($read[$key], $stream);\n }\n if (\\EV_WRITE === (\\EV_WRITE & $flags) && isset($write[$key])) {\n \\call_user_func($write[$key], $stream);\n }\n };\n }", "public function addEventListener(string $eventClass, callable $listener, int $priority = 0): EnvironmentBuilderInterface;", "public function setupEventListeners()\r\n\t{\r\n\t\t$blueprints = craft()->courier_blueprints->getAllBlueprints();\r\n\t\t$availableEvents = $this->getAvailableEvents();\r\n\r\n\t\t// Setup event listeners for each blueprint\r\n\t\tforeach ($blueprints as $blueprint) {\r\n\t\t\tif (!$blueprint->eventTriggers) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tforeach ($blueprint->eventTriggers as $event) {\r\n\t\t\t\t// Is event currently enabled?\r\n\t\t\t\tif (!isset($availableEvents[$event])) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tcraft()->on($event, function(Event $event) use ($blueprint) {\r\n\t\t\t\t\tcraft()->courier_blueprints->checkEventConditions($event, $blueprint);\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// On the event that an email is sent, create a successful delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailSent', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery'\r\n\t\t]);\r\n\r\n\t\t// On the event that an email fails to send, create a failed delivery record\r\n\t\tcraft()->on('courier_emails.onAfterBlueprintEmailFailed', [\r\n\t\t\tcraft()->courier_deliveries,\r\n\t\t\t'createDelivery',\r\n\t\t]);\r\n\t}", "protected function registerListeners()\n {\n }", "public function listen($listener);", "public function listenForEvents()\n {\n Event::listen(DummyEvent::class, DummyListener::class);\n\n event(new DummyEvent);\n }", "public function createEvent()\n {\n return new Event();\n }", "public function attachEvents();", "public function attachEvents();", "public function add_event_handler($event, $callback);", "function addListener(EventListener $listener): void;", "public static function initListeners() {\n\t\t\n\t\tif(GO::modules()->isInstalled('files') && class_exists('\\GO\\Files\\Controller\\FolderController')){\n\t\t\t$folderController = new \\GO\\Files\\Controller\\FolderController();\n\t\t\t$folderController->addListener('checkmodelfolder', \"GO\\Projects2\\Projects2Module\", \"createParentFolders\");\n\t\t}\n\t\t\n\t\t\\GO\\Base\\Model\\User::model()->addListener('delete', \"GO\\Projects2\\Projects2Module\", \"deleteUser\");\n\n\t}", "public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }", "private static function event()\n {\n $files = ['Event', 'EventListener'];\n $folder = static::$root.'Event'.'/';\n\n self::call($files, $folder);\n\n $files = ['ManyListenersArgumentsException'];\n $folder = static::$root.'Event/Exceptions'.'/';\n\n self::call($files, $folder);\n }", "public function addEventListener($event, $callable){\r\n $this->events[$event] = $callable;\r\n }", "public function testEventCallBackCreate()\n {\n }", "public function listeners($event);", "public function addListener($event, $listener, $priority = 0);", "public function on($name, $listener, $data = null, $priority = null, $acceptedArgs = null);", "public function createWatcher();", "public function __construct()\n\t{\n\t\t$this->delegate = Delegate_1::fromMethod($this, 'onEvent');\n\t}", "public function init_listeners( $callable ) {\n\t}", "public static function events();", "public static function __events () {\n \n }", "public function onEventAdd()\n\t{\n\t\t$this->onTaskAdd();\n\t}", "public function addApplicationBuilderListener( \n MyFusesApplicationBuilderListener $listener );", "public function addListener($eventName, $listener, $priority = 0);", "public function __construct(){\n\n\t\t\t$this->listen();\n\n\t\t}", "protected function registerListeners()\n {\n // Login event listener\n #Event::listen('auth.login', function($user) {\n //\n #});\n\n // Logout event subscriber\n #Event::subscribe('Mrcore\\Parser\\Listeners\\MyEventSubscription');\n }", "public function __construct()\n {\n// global $callback;\n // $this->eventsArr = $eventsArr;\n $this->callback = function () {\n\n // echo \"event: message\\n\"; // for onmessage listener\n echo \"event: ping\\n\";\n $curDate = date(DATE_ISO8601);\n echo 'data: {\"time\": \"' . $curDate . '\"}';\n echo \"\\n\\n\";\n\n while (($event = ServerSentEvents::popEvent()) != null) {\n $m = json_encode($event->contents);\n echo \"event: $event->event\\n\";\n echo \"data: $m\";\n echo \"\\n\\n\";\n }\n // echo \"event: message\\n\";\n // $curDate = date(DATE_ISO8601);\n // echo 'data: {\"message-time\": \"' . $curDate . '\"}';\n // echo \"\\n\\n\";\n // while(true){\n // if ($index != $this->eventsCounter){\n // ServerSentEvents::sendEvent($this->event, $this->eventBody);\n // $index = $this->eventsCounter;\n // }\n\n // sleep(1);\n // }\n };\n\n $this->setupResponse();\n }", "private function createMyEvents()\n {\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Frontend_Checkout',\n 'onPostDispatchCheckoutSecure'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_Checkout_PreRedirect',\n 'onPreRedirectToPayPal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch_Frontend_PaymentPaypal',\n 'onPreDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_Webhook',\n 'onPaymentPaypalWebhook'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_Frontend_PaymentPaypal_PlusRedirect',\n 'onPaymentPaypalPlusRedirect'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Frontend_Account',\n 'onPostDispatchAccount'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Javascript',\n 'onCollectJavascript'\n );\n $this->subscribeEvent(\n 'Shopware_Components_Document::assignValues::after',\n 'onBeforeRenderDocument'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatchSecure_Backend_Config',\n 'onPostDispatchConfig'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_Order',\n 'onPostDispatchOrder'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PostDispatch_Backend_PaymentPaypal',\n 'onPostDispatchPaymentPaypal'\n );\n $this->subscribeEvent(\n 'Theme_Compiler_Collect_Plugin_Less',\n 'addLessFiles'\n );\n $this->subscribeEvent(\n 'Enlight_Bootstrap_InitResource_paypal_plus.rest_client',\n 'onInitRestClient'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Dispatcher_ControllerPath_Api_PaypalPaymentInstruction',\n 'onGetPaymentInstructionsApiController'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Front_StartDispatch',\n 'onEnlightControllerFrontStartDispatch'\n );\n $this->subscribeEvent(\n 'Enlight_Controller_Action_PreDispatch',\n 'onPreDispatchSecure'\n );\n }", "public static function creating(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATING, $listener, $priority);\n }", "public function listen();", "public function listen() {\n $this->source->listen($this->id);\n }", "public function addEventListener($event, $callback, $weight = null);", "public function testAddListener()\n {\n // Arrange\n $listenerCalled = false;\n $communicator = new Communicator();\n\n // Act\n $communicator->addListener(function () use (&$listenerCalled) {\n $listenerCalled = true;\n });\n\n $communicator->broadcast([], 'channel', [], []);\n\n // Assert\n static::assertTrue($listenerCalled);\n }", "public function addListener($name, $listener, $priority = 0);", "public static function created(callable $listener, $priority = 0)\n {\n static::listen(ModelEvent::CREATED, $listener, $priority);\n }", "public function on($event, $callback){ }", "public function appendListenerForEvent(string $eventType, callable $listener): callable;", "public function initEventLogger()\n {\n $dispatcher = static::getEventDispatcher();\n\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "protected function getCron_EventListenerService()\n {\n return $this->services['cron.event_listener'] = new \\phpbb\\cron\\event\\cron_runner_listener(${($_ = isset($this->services['cron.lock_db']) ? $this->services['cron.lock_db'] : $this->getCron_LockDbService()) && false ?: '_'}, ${($_ = isset($this->services['cron.manager']) ? $this->services['cron.manager'] : $this->getCron_ManagerService()) && false ?: '_'}, ${($_ = isset($this->services['request']) ? $this->services['request'] : ($this->services['request'] = new \\phpbb\\request\\request(NULL, true))) && false ?: '_'});\n }", "public function getListener(/* ... */)\n {\n return $this->_listener;\n }", "protected function _listener($name) {\n\t\treturn $this->_crud()->listener($name);\n\t}", "private function listeners()\n {\n foreach ($this['config']['listeners'] as $eventName => $classService) {\n $this['dispatcher']->addListener($classService::NAME, [new $classService($this), 'dispatch']);\n }\n }", "public function initializeListeners()\n {\n $this->eventsEnabled = false;\n $this->setPreloads();\n $this->setEvents();\n $this->eventsEnabled = true;\n }", "protected function listenForEvents()\n {\n $callback = function ($event) {\n foreach ($this->logWriters as $writer) {\n $writer->log($event);\n }\n };\n\n $this->events->listen(JobProcessing::class, $callback);\n $this->events->listen(JobProcessed::class, $callback);\n $this->events->listen(JobFailed::class, $callback);\n $this->events->listen(JobExceptionOccurred::class, $callback);\n }", "protected function registerListeners()\n {\n $this->container['listener.server'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\ServerListener($c['filesystem'], $c['generator.server']);\n });\n\n $this->container['listener.gateway'] = $this->container->share(function ($c) {\n return new \\Symfttpd\\EventDispatcher\\Listener\\GatewayListener($c['filesystem'], $c['generator.gateway']);\n });\n }", "public function listeners($eventName);", "public static function create()\n {\n list(\n $message,\n $callbackService,\n $callbackMethod,\n $callbackParams\n ) = array_pad( func_get_args(), 4, null);\n\n static::addToEventQueue( array(\n 'type' => \"alert\",\n 'properties' => array(\n 'message' => $message\n ),\n 'service' => $callbackService,\n 'method' => $callbackMethod,\n 'params' => $callbackParams ?? []\n ));\n }", "public function requestCreateEvent()\n {\n $ch = self::curlIni('event_new', $this->eventParams);\n\n return $ch;\n }", "function __construct()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}", "public function __construct()\n {\n Hook::listen(__CLASS__);\n }", "function add_listener($hook, $function_name){\n\t\tglobal $listeners;\n\n\t\t$listeners[$hook][] = $function_name;\n\t}", "public function __construct()\n {\n $this->events = new EventDispatcher();\n }", "protected function initEventLogger(): void\n {\n $logger = $this->newEventLogger();\n\n foreach ($this->listen as $event) {\n $this->dispatcher->listen($event, function ($eventName, $events) use ($logger) {\n foreach ($events as $event) {\n $logger->log($event);\n }\n });\n }\n }", "public function listen($events, $listener = null): void;", "public function onCreate($callback)\n {\n $this->listeners[] = $callback;\n return $this;\n }", "public static function listen() {\n $projectId = \"sunday-1601040613995\";\n\n # Instantiates a client\n $pubsub = new PubSubClient([\n 'projectId' => $projectId\n ]);\n\n # The name for the new topic\n $topicName = 'gmail';\n\n # Creates the new topic\n $topic = $pubsub->createTopic($topicName);\n\n echo 'Topic ' . $topic->name() . ' created.';\n }", "protected function registerEventListeners()\n {\n Event::listen(Started::class, function (Started $event) {\n $this->progress = $this->output->createProgressBar($event->objects->count());\n });\n\n Event::listen(Imported::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(ImportFailed::class, function () {\n if ($this->progress) {\n $this->progress->advance();\n }\n });\n\n Event::listen(DeletedMissing::class, function (DeletedMissing $event) {\n $event->deleted->isEmpty()\n ? $this->info(\"\\n No missing users found. None have been soft-deleted.\")\n : $this->info(\"\\n Successfully soft-deleted [{$event->deleted->count()}] users.\");\n });\n\n Event::listen(Completed::class, function (Completed $event) {\n if ($this->progress) {\n $this->progress->finish();\n }\n });\n }", "public function addBeforeCreateListener(IBeforeCreateListener $listener)\n {\n $this->_lifecyclers[BeanLifecycle::BeforeCreate][] = $listener;\n }", "protected function registerInputEvents() {\n\t\t$this->getEventLoop()->addEventListener('HANG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->offHook = (bool)$event['value'];\n\n\t\t\t// Trigger specific events for receiver up and down states\n\t\t\t$eventName = $this->isOffHook() ? 'RECEIVER_UP' : 'RECEIVER_DOWN';\n\t\t\t$this->fireEvents($eventName, $event);\n\t\t});\n\n\t\t$this->getEventLoop()->addEventListener('TRIG', function($event) {\n\t\t\t// Update our state\n\t\t\t$this->dialling = (bool)$event['value'];\n\t\t});\n\n\t\t// Proxy registration for all EventLoop events to pass them back up to our own listeners\n\t\t$this->getEventLoop()->addEventListener(true, function ($event, $type) {\n\t\t\t// Fire event to our own listeners\n\t\t\t$this->fireEvents($type, $event);\n\t\t});\n\t}", "public static function creating($callback)\n {\n self::listenEvent('creating', $callback);\n }", "public function attach(string $event, callable $listener, int $priority = 0): void;", "public function __construct()\n {\n $this->listnerCode = config('settings.listener_code.DeletingVoucherEventListener');\n }", "protected function registerEventListener()\n {\n $subscriber = $this->getConfig()->get('audit-trail.subscriber', AuditTrailEventSubscriber::class);\n $this->getDispatcher()->subscribe($subscriber);\n }", "function listenTo(string $eventName, callable $callback)\n {\n EventManager::register($eventName, $callback);\n }", "public function attach($identifier, $event, callable $listener, $priority = 1)\n {\n }", "public function testRegisiterListenerMethodAddsAListener()\n\t{\n\t\t$instance = new Dispatcher();\n\n\t\t$instance->register_listener('some_event', 'my_function');\n\n\t\t$this->assertSame(array('some_event' => array('my_function')), $instance->listeners);\n\t\t$this->assertAttributeSame(array('some_event' => array('my_function')), 'listeners', $instance);\n\t}", "protected function getPhpbb_Viglink_ListenerService()\n {\n return $this->services['phpbb.viglink.listener'] = new \\phpbb\\viglink\\event\\listener(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, ${($_ = isset($this->services['template']) ? $this->services['template'] : $this->getTemplateService()) && false ?: '_'});\n }", "public static function create($className, array &$extraTabs, $selectedTabId)\r\n {\r\n $createClass = XenForo_Application::resolveDynamicClass($className, 'listener_th');\r\n if (!$createClass) {\r\n throw new XenForo_Exception(\"Invalid listener '$className' specified\");\r\n }\r\n \r\n return new $createClass($extraTabs, $selectedTabId);\r\n }", "function listen($listener)\n{\n return XPSPL::instance()->listen($listener);\n}", "function getEventListeners()\n {\n $listeners = array();\n \n $listener = new Listener($this);\n \n $listeners[] = array(\n 'event' => RoutesCompile::EVENT_NAME,\n 'listener' => array($listener, 'onRoutesCompile')\n );\n\n $listeners[] = array(\n 'event' => GetAuthenticationPlugins::EVENT_NAME,\n 'listener' => array($listener, 'onGetAuthenticationPlugins')\n );\n\n return $listeners;\n }", "protected static function loadListeners() {\n\t\t\n\t\t// default var\n\t\t$configDir = Config::getOption(\"configDir\");\n\t\t\n\t\t// make sure the listener data exists\n\t\tif (file_exists($configDir.\"/listeners.json\")) {\n\t\t\t\n\t\t\t// get listener list data\n\t\t\t$listenerList = json_decode(file_get_contents($configDir.\"/listeners.json\"), true);\n\t\t\t\n\t\t\t// get the listener info\n\t\t\tforeach ($listenerList[\"listeners\"] as $listenerName) {\n\t\t\t\t\n\t\t\t\tif ($listenerName[0] != \"_\") {\n\t\t\t\t\t$listener = new $listenerName();\n\t\t\t\t\t$listeners = $listener->getListeners();\n\t\t\t\t\tforeach ($listeners as $event => $eventProps) {\n\t\t\t\t\t\t$eventPriority = (isset($eventProps[\"priority\"])) ? $eventProps[\"priority\"] : 0;\n\t\t\t\t\t\tself::$instance->addListener($event, array($listener, $eventProps[\"callable\"]), $eventPriority);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t}", "function __construct()\n\t{\n\t\t$this->events[\"BeforeShowList\"]=true;\n\n\t\t$this->events[\"BeforeProcessList\"]=true;\n\n\t\t$this->events[\"BeforeProcessPrint\"]=true;\n\n\t\t$this->events[\"BeforeShowPrint\"]=true;\n\n\t\t$this->events[\"BeforeQueryList\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeProcessEdit\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeProcessView\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n\n\n\t\t$this->events[\"ProcessValuesView\"]=true;\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"CustomAdd\"]=true;\n\n\t\t$this->events[\"CustomEdit\"]=true;\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\t\t$this->events[\"BeforeQueryEdit\"]=true;\n\n\t\t$this->events[\"BeforeQueryView\"]=true;\n\n\n\t\t$this->events[\"BeforeProcessAdd\"]=true;\n\n\n//\tonscreen events\n\t\t$this->events[\"calmonthly_snippet2\"] = true;\n\t\t$this->events[\"calmonthly_snippet1\"] = true;\n\t\t$this->events[\"Monthly_Next_Prev\"] = true;\n\n\t}", "function defineHandlers() {\n EventsManager::listen('on_rawtext_to_richtext', 'on_rawtext_to_richtext');\n EventsManager::listen('on_daily', 'on_daily');\n EventsManager::listen('on_wireframe_updates', 'on_wireframe_updates');\n }", "public function createEvents()\n {\n //\n\n return 'something';\n }", "public static function createInstance()\n {\n return new GridPrintEventManager('ISerializable');\n }", "public function setUp()\n {\n if ($this->getOption('listener') === true) \n $this->addListener(new BlameableListener($this->_options));\n }", "public static function created($callback)\n {\n self::listenEvent('created', $callback);\n }", "public function addListener()\n {\n $dispatcher = $this->wrapper->getDispatcher();\n $listener = new TestListener();\n\n $dispatcher->addListener(PsKillEvents::PSKILL_PREPARE, [$listener, 'onPrepare']);\n $dispatcher->addListener(PsKillEvents::PSKILL_SUCCESS, [$listener, 'onSuccess']);\n $dispatcher->addListener(PsKillEvents::PSKILL_ERROR, [$listener, 'onError']);\n $dispatcher->addListener(PsKillEvents::PSKILL_BYPASS, [$listener, 'onBypass']);\n\n return $listener;\n }", "public static function addEventListener($event, $listenerClassName) {\n\t\tif (!is_a($listenerClassName, EventListenerInterface::class, TRUE)) {\n\t\t\tthrow new \\RuntimeException(\n\t\t\t\tsprintf(\n\t\t\t\t\t'Invalid CMIS Service EventListener: %s must implement %s',\n\t\t\t\t\t$listenerClassName,\n\t\t\t\t\tEventListenerInterface::class\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tstatic::$eventListeners[get_called_class()][$event][] = $listenerClassName;\n\t}", "public function makeListener($listener, $wildcard = false): Closure;", "public function createSubscriber();", "public function listener() {\n\t\treturn $this->_runtime['listener'];\n\t}", "public function addEventListener($events, $eventListener)\n {\n $this->eventListeners[] = array('events' => $events, 'listener' => $eventListener);\n }", "function __construct()\r\n\t{\r\n\t\t$this->events[\"BeforeAdd\"]=true;\r\n\r\n\r\n\t}", "function __construct()\n\t{\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\n\t\t$this->events[\"BeforeShowAdd\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"IsRecordEditable\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n//\tonscreen events\n\n\t}", "public function startListening();", "public function addEntryAddedListener(callable $listener): SubscriptionInterface;", "function __construct()\n\t{\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}", "function GetEventListeners() {\n $my_file = '{%IEM_ADDONS_PATH%}/dynamiccontenttags/dynamiccontenttags.php';\n $listeners = array ();\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_SENDSTUDIOFUNCTIONS_GENERATEMENULINKS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'SetMenuItems'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_USERAPI_GETPERMISSIONTYPES',\n 'trigger_details' => array (\n 'Interspire_Addons',\n 'GetAddonPermissions',\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_DCT_HTMLEDITOR_TINYMCEPLUGIN',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'DctTinyMCEPluginHook'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners [] =\n array (\n 'eventname' => 'IEM_EDITOR_TAG_BUTTON',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'CreateInsertTagButton'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_GETALLTAGS',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'getAllTags'\n ),\n 'trigger_file' => $my_file\n );\n\n $listeners[] =\n array (\n 'eventname' => 'IEM_ADDON_DYNAMICCONTENTTAGS_REPLACETAGCONTENT',\n 'trigger_details' => array (\n 'Addons_dynamiccontenttags',\n 'replaceTagContent'\n ),\n 'trigger_file' => $my_file\n );\n\n return $listeners;\n }", "function on_creation() {\n $this->init();\n }", "public function addEventListener(ListenerInterface $eventListener)\n {\n $this->eventListeners[] = $eventListener;\n }" ]
[ "0.65685207", "0.62875676", "0.6221792", "0.6197413", "0.61627764", "0.6129312", "0.6096226", "0.6056844", "0.6051069", "0.6041841", "0.596228", "0.596194", "0.5957539", "0.59439605", "0.58821785", "0.58821785", "0.5874665", "0.5864387", "0.5856076", "0.584338", "0.5824244", "0.5820997", "0.5791637", "0.57913053", "0.57893854", "0.57716024", "0.5764599", "0.5744472", "0.57417566", "0.57387024", "0.5721539", "0.57068586", "0.5699624", "0.56838834", "0.5675836", "0.56686187", "0.5661412", "0.56601405", "0.56584114", "0.5649107", "0.5638085", "0.56257224", "0.56172097", "0.56064796", "0.55919635", "0.5579062", "0.55775297", "0.5559927", "0.5546297", "0.5546121", "0.5545537", "0.5539715", "0.55295366", "0.55276597", "0.5527287", "0.551302", "0.5497285", "0.5495119", "0.54845315", "0.54834753", "0.54812366", "0.5478984", "0.5474917", "0.5471286", "0.54693574", "0.54684293", "0.5466594", "0.5465012", "0.5450231", "0.5450062", "0.5450001", "0.544321", "0.54308116", "0.54218924", "0.5389615", "0.53857446", "0.5378957", "0.5378836", "0.53771406", "0.5368413", "0.5360908", "0.5356685", "0.5349897", "0.53419805", "0.5340825", "0.53330225", "0.53323317", "0.5330117", "0.53270465", "0.5326564", "0.5307367", "0.52996707", "0.52980274", "0.52973336", "0.52886003", "0.528163", "0.5276869", "0.5269541", "0.5268173", "0.5265876", "0.52629435" ]
0.0
-1
Display a listing of the resource.
public function 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 listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n {\n $this->booklist();\n }", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7447426", "0.73628515", "0.73007894", "0.7249563", "0.7164474", "0.7148467", "0.71320325", "0.7104678", "0.7103152", "0.7100512", "0.7048493", "0.6994995", "0.69899315", "0.6935843", "0.6899995", "0.68999326", "0.6892163", "0.6887924", "0.6867505", "0.6851258", "0.6831236", "0.68033123", "0.6797587", "0.6795274", "0.67868614", "0.67610204", "0.67426085", "0.67303514", "0.6727031", "0.67257243", "0.67257243", "0.67257243", "0.67195046", "0.67067856", "0.67063624", "0.67045796", "0.66655326", "0.666383", "0.66611767", "0.66604036", "0.66582054", "0.6654805", "0.6649084", "0.6620993", "0.66197145", "0.6616024", "0.66077465", "0.6602853", "0.6601494", "0.6593894", "0.65878326", "0.6586189", "0.6584675", "0.65813804", "0.65766823", "0.65754175", "0.657203", "0.657202", "0.65713936", "0.65642136", "0.6563951", "0.6553249", "0.6552584", "0.6546312", "0.6536654", "0.6534106", "0.6532539", "0.6527516", "0.6526785", "0.6526042", "0.65191233", "0.6518727", "0.6517732", "0.6517689", "0.65155584", "0.6507816", "0.65048593", "0.6503226", "0.6495243", "0.6492096", "0.6486592", "0.64862204", "0.6485348", "0.6483991", "0.64789015", "0.6478804", "0.64708763", "0.6470304", "0.64699143", "0.6467142", "0.646402", "0.6463102", "0.6460929", "0.6458856", "0.6454334", "0.6453653", "0.645357", "0.6450551", "0.64498454", "0.64480853", "0.64453584" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n 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 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('libro.create');\n }", "public function create()\n {\n return view('libro.create');\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 {\n return view('saldo.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\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.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 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 newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create()\n {\n return view('student::students.student.create');\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}" ]
[ "0.7593278", "0.7593278", "0.75862813", "0.7577653", "0.7570922", "0.7499259", "0.743598", "0.7431475", "0.738692", "0.7351195", "0.7336038", "0.73110175", "0.7294184", "0.7280905", "0.7272454", "0.72410536", "0.7229507", "0.72239184", "0.7184587", "0.7177518", "0.7172079", "0.7148124", "0.7142547", "0.71422434", "0.713585", "0.712646", "0.7121425", "0.7113886", "0.7113886", "0.7113886", "0.71099454", "0.7091995", "0.70838404", "0.70796615", "0.70783395", "0.70560604", "0.70560604", "0.7053403", "0.7037733", "0.7037483", "0.7034196", "0.7032379", "0.7028811", "0.70255613", "0.7025196", "0.7018564", "0.7015596", "0.7003297", "0.7002209", "0.6999467", "0.6994898", "0.69925386", "0.69918746", "0.69880474", "0.6985266", "0.69648707", "0.69642234", "0.69544894", "0.6950107", "0.6949808", "0.6946825", "0.69433236", "0.6939847", "0.6938437", "0.6936151", "0.69359493", "0.69359493", "0.6932416", "0.69302046", "0.6927174", "0.69250137", "0.6922311", "0.6917047", "0.69137764", "0.6910701", "0.6909241", "0.6908554", "0.69062465", "0.69030714", "0.6900927", "0.689929", "0.6898352", "0.6893204", "0.68918675", "0.6891051", "0.68910086", "0.6889982", "0.6889982", "0.68871695", "0.6886071", "0.68850255", "0.6882077", "0.688044", "0.6879478", "0.6874531", "0.6871747", "0.6871178", "0.686907", "0.6868627", "0.6868156", "0.68674266" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $this->validate( $request, [ "idponencia"=>"required" ]); $userponencia = new UserPonencia([ "iduser" => Auth::id(), "idponencia" => $request->get("idponencia") ]); $userponencia->save(); return response()->download(public_path('assets/justificante/justificante.pdf')); return redirect()->route('Ponencia.index'); }
{ "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(userponencia $userponencia) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show(Resena $resena)\n {\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function get_resource();", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "public function display() {\n echo $this->render();\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n {\n //\n $this->_show($id);\n }", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public abstract function display();", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "abstract public function resource($resource);", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8232636", "0.81890994", "0.68296117", "0.64987075", "0.649589", "0.64692974", "0.64633286", "0.63640857", "0.6307513", "0.6281809", "0.621944", "0.61926234", "0.61803305", "0.6173143", "0.61398774", "0.6119022", "0.61085826", "0.6106046", "0.60947937", "0.6078597", "0.6047151", "0.60409963", "0.6021287", "0.5989136", "0.5964405", "0.5962407", "0.59518087", "0.59309924", "0.5921466", "0.5908002", "0.5908002", "0.5908002", "0.59051657", "0.5894554", "0.5871459", "0.5870088", "0.586883", "0.5851384", "0.58168566", "0.58166975", "0.5815869", "0.58056176", "0.5799148", "0.5795126", "0.5791158", "0.57857597", "0.5783371", "0.5761351", "0.57592535", "0.57587147", "0.5746491", "0.57460666", "0.574066", "0.5739448", "0.5739448", "0.57295275", "0.57293373", "0.5729069", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57214445", "0.57149816", "0.5712036", "0.5710076", "0.57073003", "0.5707059", "0.5705454", "0.5705454", "0.5700382", "0.56997055", "0.5693362", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit(form $form)\n {\n //\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.7854417", "0.7692986", "0.72741747", "0.72416574", "0.7173436", "0.706246", "0.70551765", "0.698488", "0.6948513", "0.694731", "0.69425464", "0.6929177", "0.6902573", "0.6899662", "0.6899662", "0.6878983", "0.6865711", "0.6861037", "0.6858774", "0.6847512", "0.6836162", "0.68129057", "0.68083996", "0.68082106", "0.6803853", "0.67966306", "0.6794222", "0.6794222", "0.6789979", "0.67861426", "0.678112", "0.677748", "0.67702436", "0.67625374", "0.6748088", "0.67475355", "0.67475355", "0.67446774", "0.6742005", "0.67374676", "0.6727497", "0.6714345", "0.6696231", "0.6693851", "0.6689907", "0.6689746", "0.6687102", "0.66870165", "0.6684574", "0.6670877", "0.66705006", "0.6667089", "0.6667089", "0.6663205", "0.66626745", "0.66603845", "0.66593564", "0.66560745", "0.66545844", "0.66447026", "0.6633528", "0.66319114", "0.66298395", "0.66298395", "0.6622365", "0.6621021", "0.66170275", "0.661664", "0.6612467", "0.66107714", "0.6608453", "0.65979743", "0.659645", "0.6596389", "0.6592672", "0.6591205", "0.6588125", "0.6582166", "0.6581656", "0.65811247", "0.65785724", "0.65782833", "0.6576397", "0.6570971", "0.6569483", "0.6568432", "0.656811", "0.6563493", "0.6563493", "0.65622604", "0.65602434", "0.65585065", "0.6557997", "0.65574414", "0.6556701", "0.65565753", "0.6556226", "0.6556107", "0.6549118", "0.65485924", "0.65463555" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function 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 update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "public function update($request, $id);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "abstract public function put($data);", "public function testUpdateSupplierUsingPUT()\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 update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(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, $input);", "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(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "public function 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 put($path, $data = null);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\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.7424714", "0.70635", "0.7058482", "0.68981785", "0.6581708", "0.6451537", "0.634705", "0.62108016", "0.61452574", "0.61245036", "0.6117", "0.61005783", "0.6088965", "0.6055291", "0.6020192", "0.60089755", "0.5974869", "0.594607", "0.5940399", "0.5940387", "0.5893692", "0.5861878", "0.58555347", "0.58555347", "0.58521295", "0.5816296", "0.580588", "0.5754183", "0.5754183", "0.573585", "0.57248604", "0.57152486", "0.5696124", "0.56926364", "0.5686974", "0.56704843", "0.5657175", "0.5652319", "0.56505626", "0.56371164", "0.5636333", "0.5634292", "0.5633077", "0.56302124", "0.56226414", "0.5608414", "0.56038505", "0.55932486", "0.55845344", "0.55840373", "0.5583145", "0.55769825", "0.5572918", "0.5568501", "0.55649704", "0.5564084", "0.5562276", "0.5562276", "0.5562276", "0.5562276", "0.5562276", "0.5560055", "0.5556887", "0.5555794", "0.5555651", "0.55555624", "0.55542725", "0.5545186", "0.5545042", "0.554096", "0.5540548", "0.5537395", "0.55360836", "0.55359083", "0.55250585", "0.55194676", "0.55176675", "0.5514794", "0.55101085", "0.5510089", "0.5507262", "0.5504258", "0.55022335", "0.5501283", "0.5500848", "0.5499872", "0.5497986", "0.5497986", "0.5495836", "0.54956913", "0.5494868", "0.5494812", "0.5493479", "0.5484617", "0.54805785", "0.54803264", "0.54791373", "0.546626", "0.54649556", "0.5463194", "0.54580057" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(userponencia $userponencia) { // }
{ "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
Create or update a Banner.
public function save(BannerInterface $page);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update($banner);", "public function addNewBanner() {\n $_PUT = $this->getPutData();\n $data = isset($_PUT) ? $_PUT : $_POST;\n\n\n if (!isset($data)) {\n\n throw new RestException(HttpStatusCodes::BAD_REQUEST, \"Missing required params\");\n }\n try {\n if (isset($_POST) && isset($data['width']) && filter_var($data['width'], FILTER_VALIDATE_INT) && filter_var($data['height'], FILTER_VALIDATE_INT) && isset($data['height']) && isset($data['name']) && isset($data['content'])) {\n return Banner::addNewBanner($data);\n } else if (isset($_PUT) && filter_var($data['id'], FILTER_VALIDATE_INT)) {\n return Banner::updateBanner($data);\n } else {\n throw new RestException(HttpStatusCodes::BAD_REQUEST, \"Not valid data.\");\n }\n\n http_response_code(HttpStatusCodes::CREATED);\n } catch (Exception $e) {\n throw new RestException($e->getCode(), $e->getMessage());\n }\n }", "public function update(Request $r, Banner $banner)\n {\n /* set variable */\n $orders = explode(',', $r->input('orders'));\n\n /* validation */\n $validate = [\n 'title' => 'required',\n 'description' => 'required',\n // 'image' => 'required',\n ];\n if (bool($r->input('only_image'))) {\n unset($this->image_rule[0]);\n $validate = [\n 'image' => $this->image_rule,\n ];\n }\n $this->validate($r, $validate);\n\n /* save data */\n $banner->title = $r->input('title');\n $banner->description = $r->input('description');\n $banner->url = $r->input('url');\n $banner->url_external = 'no';\n if ($r->input('url') == 'external') {\n $banner->url = $r->input('url_external');\n $banner->url_external = 'yes';\n }\n $banner->target = $r->input('target');\n $banner->only_image = $r->input('only_image') ?? 'no';\n $banner->status = $r->input('status') ?? 'inactive';\n $banner->save();\n\n /* process image */\n if ($r->hasFile('image')) {\n $file = $r->file('image');\n $ext = $file->getClientOriginalExtension();\n $name = 'banner-' . (md5($banner->id . getDatabasePort())) . '.' . $ext;\n\n if ($this->uploadImage($file, '/assets/images/banners/', $name)) {\n $banner->image = $name;\n }\n }\n $banner->save();\n\n /* set order */\n if ($r->input('order') == 'first') {\n array_unshift($orders, $banner->id);\n } else {\n $key = array_search($r->input('order'), $orders);\n array_splice($orders, ($key + 1), 0, $banner->id);\n }\n $this->sortQuery($r, $orders);\n\n /* save activity */\n $this->activityLog('[~name] (' . $this->getUserRoles() . ') memperbarui spanduk \"' . $banner->title . '\"');\n\n /* clear cache */\n \\Cache::flush();\n\n return redirect($this->current_url)->with('success', 'Spanduk berhasil disimpan!');\n }", "public function update(Request $request, Banner $banner)\n {\n $this->authorize('update', Banner::class);\n\n $this->validate($request, [\n // validation rules...\n ]);\n\n $banner->update($request->all());\n\n return new BannerResource(Banner::create($request->all()));\n }", "public function update(Request $request, Banner $banner)\n {\n //\n }", "public function update(Request $request, Banner $banner)\n {\n //\n }", "public function update(BannerRequest $request, Banner $banner)\n {\n try {\n $data = $request->only(['title', 'content', 'link']);\n if ($request->image) {\n $data['way'] = Storage::disk(ConfigHelper::get('filesystem.disk'))\n ->put(ConfigHelper::get('filesystem.path.banners'), $request->image);\n }\n if ($banner->update($data)) {\n return response(['error' => false, 'message' => Terminologies::get('all.common.save_data')], 200);\n }\n\n return response(['error' => true, 'message' => Terminologies::get('all.common.error_save_data')], Response::HTTP_BAD_REQUEST);\n } catch (\\Throwable $th) {\n return response(['error' => true, 'message' => Terminologies::get('all.common.error_save_data')], Response::HTTP_BAD_REQUEST);\n }\n }", "public function actionCreate()\n {\n $model = new Banner();\n $model->time = date(\"Y-m-d H:i:s\");\n $model->position = $model->getLast();\n $model->isdel = 0;\n\t\t\n\t\t$post = Yii::$app->request->post();\n\t\tif (isset($post['Banner']['tags']))\n\t\t{\n\t\t\tif (is_array($post['Banner']['tags']))\n\t\t\t{\n\t\t\t\t$post['Banner']['tags'] = implode(\",\",$post['Banner']['tags']);\n\t\t\t}\t\n\t\t}\n\t\t\n\t\t$transaction = Yii::$app->db->beginTransaction();\n\t\ttry {\t\t\t\t\n\t\t\tif ($model->load($post) && $model->save()) {\n\t\t\t\t$model->updatePosition($model->position);\n\t\t\t\t$transaction->commit();\n\t\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t\t}\t\t\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$transaction->rollBack();\t\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\t$transaction->rollBack();\n\t\t}\n\t\t\n\t\treturn $this->render('create', [\n\t\t\t'model' => $model,\n\t\t]);\n\t\n }", "public function store(BannerRequest $request)\n {\n try {\n $data = $request->only(['title', 'content', 'link']);\n $data['way'] = Storage::disk(ConfigHelper::get('filesystem.disk'))\n ->put(\n ConfigHelper::get('filesystem.path.banners'),\n $request->image\n );\n\n if ($banner = Banner::create($data)) {\n return (new BannerResource($banner->refresh(), Terminologies::get('all.common.save_data')))\n ->response()->setStatusCode(Response::HTTP_CREATED);\n }\n\n return response(['error' => true, 'message' => Terminologies::get('all.common.error_save_data')], Response::HTTP_BAD_REQUEST);\n } catch (\\Throwable $th) {\n return response(['error' => true, 'message' => Terminologies::get('all.common.error_save_data')], Response::HTTP_BAD_REQUEST);\n }\n }", "public function update($bannerclient);", "public function insert($banner);", "public function update(Request $request, Banner $banner)\n {\n $updated_file = $this->upload( $request, 'image');\n \n $banner->update([\n 'name' => $request->name ?: $banner->name,\n 'image' => $updated_file ?: $banner->image,\n 'url' => $request->url ?: $banner->url,\n 'duration' => $request->duration ?: $banner->duration,\n 'iframe' => $request->has('iframe') ? $request->iframe : $banner->iframe,\n 'enabled' => $request->has('enabled') ? $request->enabled : $banner->enabled\n ]);\n \n if( $request->expectsJson() ){\n return response()->json( ['data'=>$banner] );\n }\n $request->session()->flash('message', 'Banner Ad Updated Successfully!');\n return redirect()->route('admin.banners.index');\n }", "public function update(Request $request, Banner $banner)\n {\n $this->validate($request, [\n 'titulo' => 'required',\n 'url_site' => 'required',\n 'url_banner' => 'required',\n ]);\n\n $input = $request->all();\n\n if ($request->has('titulo') && $banner->titulo != $request->titulo) {\n $banner->titulo = $request->titulo;\n }\n\n if ($request->has('url_site') && $banner->url_site != $request->url_site) {\n $banner->url_site = $request->url_site;\n }\n\n if ($request->has('url_banner') && $banner->url_banner != $request->url_banner) {\n $banner->url_banner = $request->url_banner;\n }\n\n if (!$banner->isDirty()) {\n notify()->flash('Oops', 'error',[\n 'text' => 'Debe realizar por lo menos un cambio para poder actualizar',\n 'timer'=> 4000\n ]);\n\n return back();\n }\n\n $banner->save();\n\n notify()->flash('Bien', 'success',[\n 'text' => 'Se ha actualizado el banner correctamente',\n 'timer'=> 4000\n ]);\n\n return redirect()->route('banner.index');\n }", "public function actionCreate()\n\t{\n\t\t$model = new Banner('create');\n\t\t$media = new Media('create');\n\n\t\tif (isset($_POST['Banner'])) {\n\t\t\t$model->attributes=$_POST['Banner'];\n\n $media->attributes = $_POST['Media'];\n $media->file = CUploadedFile::getInstance($media,'file');\n\n if ($media->save()) {\n $model->media_id = $media->media_id;\n\n if ($model->save()) {\n Yii::app()->user->setFlash(\n 'success',\n Yii::t('admin', 'The banner {title} has been created!', array('{title}' => $media->title))\n );\n $this->redirect(array('index'));\n }\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model' => $model,\n 'media' => $media,\n\t\t));\n\t}", "public function insert($bannerclient);", "public function update(StoreBannerPost $request)\n {\n $datas = $request->all();\n if(!isset($datas['id'])) {\n $this->set_error('缺少参数');\n }else {\n $file = $request->hasFile('image') ? $request->file('image') : null;\n $error = $this->checkError($datas, $file);\n if(!$error) {\n $ret = $this->banner->update($datas);\n if($ret) $this->set_success('更新成功');\n else $this->set_error('更新失败');\n }else {\n $this->set_error($error);\n }\n }\n return response()->json($this->get_result());\n }", "public function store(BannerRequest $request)\n {\n $data = $request->all();\n\n $slug = Str::slug($request->title);\n\n $count = Banner::where('slug', $slug)->count();\n\n if ($count > 0) {\n $slug = $slug . '-' . date('ymdis') . '-' . rand(0, 999);\n }\n\n $data['slug'] = $slug;\n\n if ($request->hasFile('photo')) {\n $image = $request->file('photo');\n $filename = time() . '.' . $image->getClientOriginalExtension();\n $location = public_path('frontend/banners/' . $filename);\n \\Image::make($image)->resize(1200, 809)->save($location);\n $data['photo'] = $filename;\n }\n\n $status = Banner::create($data);\n\n if ($status) {\n request()->session()->flash('success', 'Banner adicionado com sucesso.');\n\n } else {\n request()->session()->flash('error', 'Erro ao criar o banner. Por favor, tente novamente.');\n }\n\n return redirect()->route('banners.index');\n }", "public function update(Request $request, Banner $banner)\n {\n $data = $request->except('_token');\n\n $validate = Validator::make($data,[\n 'img' => 'nullable|file',\n 'link' => 'required|max:255|url',\n 'str_link' => 'string|nullable|max:255'\n ]);\n\n if ($validate->fails()) {\n return redirect()->back()\n ->withErrors($validate)\n ->withInput();\n }\n\n if ($request->hasFile('img')){\n\n if (isset($banner) && file_exists(public_path() . '/images/banner_img/' . $banner->img)){\n unlink(public_path() . '/images/banner_img/' . $banner->img);\n }\n\n $file = $request->file('img');\n $file_name = time() . $file->getClientOriginalName();\n $file->move(public_path() . '/images/banner_img/',$file_name);\n }\n\n Banner::where('id',$banner->id)->update([\n 'img' => isset($file_name)?$file_name:$banner->img,\n 'link' => $data['link'],\n 'str_link' => $data['str_link'],\n 'text' => $data['text'],\n ]);\n\n return redirect()->back()->with('status','Данные сохранены');\n }", "public function update(Request $request) {\n $rules = array(\n 'id' => 'numeric',\n 'Title' => 'required',\n 'DisplayOrder' => 'required|numeric|min:1',\n 'Image' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048'\n );\n // run the validation rules on the inputs from the form\n $validator = Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n return BaseResult::error(400, $validator->messages()->toJson());\n } else {\n $user = Session::get('user');\n $banner = Banner::find($request->input('id'));\n if ($banner) {\n try {\n $banner->Title = $request->Title;\n $banner->DisplayOrder = $request->DisplayOrder; \n $banner->IsDeleted = 0;\n $banner->UpdatedDate = now();\n $banner->UpdatedBy = $user->USE_ID;\n\n $banner->save();\n\n if ($request->hasFile('Image')) {\n \n // delete old file\n $oldFile = $banner->Banner;\n if (File::exists(public_path('data/banners/' . $oldFile))) {\n File::delete(public_path('data/banners/' . $oldFile));\n }\n\n $filename = pathinfo($request->Image->getClientOriginalName(), PATHINFO_FILENAME);\n $imageName = $banner->BAN_ID . '_' . $filename . '_' . time() . '.' . $request->Image->extension();\n $request->Image->move(public_path('data/banners'), $imageName);\n $banner->Banner = $imageName;\n $banner->save();\n }\n\n return BaseResult::withData($banner);\n } catch (\\Exception $e) {\n return BaseResult::error(500, $e->getMessage());\n }\n } else {\n return BaseResult::error(404, 'Data not found!.');\n }\n }\n }", "public function update(Request $request, $id)\n {\n $banner = Banner::find($id);\n $banner->title = $request->input('title');\n $banner->slug = Str::slug($request->input('title'));\n $banner->url = $request->input('url');\n $banner->type = $request->input('type');\n\n if ($request->hasFile('image')) {\n $file = $request->file('image');\n $filename = time() . '_' . $file->getClientOriginalName();\n $path_upload = 'upload/banner/';\n $file->move($path_upload, $filename);\n $banner->image = $path_upload . $filename;\n }\n\n $position = 0;\n if ($request->has('position')) {\n $position = $request->input('position');\n }\n $banner->position = $position;\n\n $is_active = 0;\n if ($request->has('is_active')) {\n $is_active = $request->input('is_active');\n }\n $banner->is_active = $is_active;\n $banner->description = $request->input('description');\n\n $banner->save();\n\n return redirect()->route('admin.banner.index');\n }", "public function update(BannerRequest $request, Banner $banner)\n {\n if($request->hasFile('image_file')){\n $image = FileUpload::upload($request->file('image_file'),'banner');\n if($image){\n $request->merge(['image' => $image]);\n }\n }\n $banner->update($request->except('image_file'));\n return redirect('admin/banner')->with('status','Sửa liên hệ thành công');\n }", "public function update(Request $request, Banner $banner)\n {\n $validator = $this->validator($request, $banner);\n\n if ($validator->fails()) {\n return redirect()\n ->back()\n ->withErrors($validator)\n ->withInput();\n }\n\n if ($request->has('img')) {\n $this->deleteFile($banner->img);\n $path = $request->file('img')->store('public/banner');\n $image = basename($path);\n }\n\n $banner->update([\n 'img' => $request->has('img') ? (config('app.url') . '/banner/' . $image) : $banner->img,\n 'description' => $request->description ?? $banner->description\n ]);\n\n return redirect()\n ->route('admin.banner.index')\n ->with('status', __('Banner diedit'));\n }", "public function edit(Banner $banner)\n {\n //\n }", "public function edit(Banner $banner)\n {\n //\n }", "public function bannerUpdate(BannerRequest $request, $id)\n {\n\n $banner=Banner::find($id);\n /* dd($service); */\n $input= $request->all();\n\n if($request->hasFile('image')) {\n if($request->image==$banner->image){\n $input['image']=$banner->image;\n }else{\n $fileName=$request->file('image')->store('banner','public');\n\n $input['image'] =$fileName;\n \n @unlink('storage/'.$banner->image);\n }\n } else {\n\n $input['image']=$banner->image;\n\n }\n $banner->update([\n 'content'=>$request->content,\n 'image'=>$input['image'],\n ]);\n /* dd($service); */\n\n return new BannerResource($banner);\n }", "public function update(Request $request, $id){\n $request->validate([\n 'title' => 'required|string|max:100',\n 'sub_title' => 'required|string|max:255',\n 'image' => 'nullable|image|mimes:jpeg,jpg,png,gif',\n 'button_text' => 'nullable|string|max:30',\n 'button_link' => 'nullable|url',\n 'admin_id' => 'numeric',\n ]);\n\n $banner = Banner::find($id);\n\n $banner->title = $request->title;\n $banner->sub_title = $request->sub_title;\n $banner->button_text = $request->button_text;\n $banner->button_link = $request->button_link;\n $banner->status = $request->status;\n $banner->admin_id = $request->admin_id;\n\n// delete old image\n\n if ($request->image > 0){\n if (File::exists('images/banners/'.$banner->image)){\n File::delete('images/banners/'.$banner->image);\n }\n }\n\n //insert image\n if ($request->image > 0){\n $image = $request->file('image');\n $image_name = 'BarisalGeek-Banner'.'-'.time().'.'.$image->getClientOriginalExtension();\n $location = public_path('images/banners/'.$image_name);\n Image::make($image)->resize(1920, 900)->save($location);\n $banner->image = $image_name;\n }\n\n $banner->save();\n\n session()->flash('success','Banner Has Updated');\n return redirect()->route('admin.banner.index');\n }", "public function update(BannerRequest $request, $id)\n {\n $banner = Banner::findOrFail($id);\n\n $data = $request->all();\n\n if ($request->hasFile('photo')) {\n $image = $request->file('photo');\n $filename = time() . '.' . $image->getClientOriginalExtension();\n $location = public_path('frontend/banners/' . $filename);\n \\Image::make($image)->resize(1200, 809)->save($location);\n if ($banner->photo != null) {\n Storage::delete($banner->photo);\n unlink(public_path('frontend/banners/' . $banner->photo));\n }\n $data['photo'] = $filename;\n }\n\n $status = $banner->fill($data)->save();\n\n if ($status) {\n request()->session()->flash('success', 'Banner atualizado com sucesso.');\n } else {\n request()->session()->flash('error', 'Erro ao atualizar o banner. Por favor, tente novamente.');\n }\n return redirect()->route('banners.index');\n }", "public function create()\n {\n return view('admin.banner.insertupdate');\n }", "public function store(Request $request)\n {\n $this->authorize('create', Banner::class);\n\n $this->validate($request, [\n ]);\n\n return new BannerResource(Banner::create($request->all()));\n }", "public function actionCreate()\n {\n $model = new Banner();\n $model->scenario = 'create';\n\n $model->active = true;\n $model->visit_count = 0;\n\n if ($model->load(Yii::$app->request->post())) {\n $model->image = UploadedFile::getInstance($model, 'image');\n\n if ($model->upload() && $model->save(false)) {\n return $this->redirect(['index']);\n } else {\n notify()->addError(t('app', 'Something went wrong'));\n }\n }\n\n return $this->render('form', [\n 'action' => 'create',\n 'model' => $model,\n ]);\n }", "public function store(CreateBannerRequest $request) {\n\t\t$this->dispatch(new CreateBannerCommand(Auth::user(), $request));\n\n\t\t$type = $request['banner_type_id'] ? BannerType::findOrFail($request['banner_type_id']) : BannerType::find(1);\n\n\t\treturn redirect('/admin/banner?type='.$type->id);\n\t}", "public function create()\n {\n abort_if(Gate::denies('banner_add'), Response::HTTP_FORBIDDEN, '403 Forbidden');\n return view('admin.banner.create_banner');\n }", "public function store(BannerRequest $request)\n {\n $input= $request->all();\n\n \n\n if($request->file('image')) {\n\n $fileName=$request->file('image')->store('banners','public');\n\n $input['image'] = $fileName;\n }\n $banner=Banner::create($input);\n \n\n return new BannerResource($banner);\n }", "public function store(Request $request)\n {\n $request->validate([\n 'heading'=>'nullable|min:3',\n 'sub_heading'=>'nullable|min:3|max:255',\n 'btn_url'=>'nullable|min:3|max:255',\n 'image'=> 'nullable|mimes:jpeg,jpg,png,gif|max:2048',\n 'bg'=> 'nullable|mimes:jpeg,jpg,png,gif|max:2048',\n 'url'=> 'nullable|min:3',\n 'order'=>'nullable|integer'\n ]);\n\n $image_name = $request->image;\n $image = $request->file('image');\n if($image != ''){\n $image_name = Storage::disk('public')->put('banner', $image);\n }\n\n $bg_name = $request->bg;\n $bg = $request->file('bg');\n if($bg != ''){\n $bg_name = Storage::disk('public')->put('banner', $bg);\n }\n\n $banner = new Banner([\n 'heading' => $request->heading,\n 'sub_heading' => $request->sub_heading,\n 'btn_url' => $request->btn_url,\n 'image' => $image_name,\n 'bg' => $bg_name,\n 'url' => $request->url,\n 'order' => $request->order,\n ]);\n $banner->save();\n return redirect('/admin/banner')->with('success', 'Banner has been added.');\n }", "public function update(Request $request, Banner $banner)\n {\n $data = $request->all();\n if ($file = $request->hasfile('image'))\n {\n $request->validate(\n ['image' => 'max:1000'],\n [\n 'image.max' => 'The Image May Not Be Greater Than 1 MegaBytes.',\n ]);\n (new CustomController)->deleteImage(DB::table('banner')->where('id', $banner->id)->value('image'));\n $data['image'] = (new CustomController)->uploadImage($request->image);\n }\n $banner->update($data);\n return redirect('admin/banner')->with('msg','Banner updated successfully..!!');\n }", "public function actionChangeBanner()\n {\n $this->goHomeIfNotPost();\n $this->goHomeIfNotCinema();\n\n $imageTempFile = $this->request->getFile(\"newBanner\");\n\n $validationResult = $this->isValid(\"actionChangeBanner\", [\n \"newBanner\" => $imageTempFile\n ]);\n if ($validationResult != 1)\n {\n setcookie(\"addGalleryImageErrors\", http_build_query($validationResult), time() + 3600, \"/\");\n header(\"Location: /Theatre\");\n exit();\n }\n\n try\n {\n $image = base64_encode(file_get_contents($imageTempFile));\n (new CinemaModel())->where(\"email\", $this->userMail)->set([\n \"banner\" => $image\n ])->update();\n }\n catch (Exception $e)\n {\n $msg = \"Changing the banner image failed!<br/>\".$e->getMessage();\n return view(\"Exception.php\",[\"msg\" => $msg,\"destination\" => \"/Theatre\"]);\n }\n\n header(\"Location: /Theatre\");\n exit();\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'heading'=>'nullable|min:3',\n 'sub_heading'=>'nullable|min:3|max:255',\n 'btn_url'=>'nullable|min:3|max:255',\n 'image'=> 'nullable|mimes:jpeg,jpg,png,gif|max:2048',\n 'hidden_image'=> 'nullable|string',\n 'bg'=> 'nullable|mimes:jpeg,jpg,png,gif|max:2048',\n 'hidden_bg'=> 'nullable|string',\n 'url'=> 'nullable|min:3',\n 'order'=>'nullable|integer'\n ]);\n\n $image_name = $request->hidden_image;\n $image = $request->file('image');\n if($image != ''){\n $image_name = Storage::disk('public')->put('banner', $image);\n }\n\n $bg_name = $request->hidden_bg;\n $bg = $request->file('bg');\n if($bg != ''){\n $bg_name = Storage::disk('public')->put('banner', $bg);\n }\n\n $form_data = array(\n 'heading' => $request->heading,\n 'sub_heading' => $request->sub_heading,\n 'btn_url' => $request->btn_url,\n 'image' => $image_name,\n 'bg' => $bg_name,\n 'url' => $request->url,\n 'order' => $request->order,\n );\n\n Banner::whereId($id)->update($form_data);\n return redirect('/admin/banner')->with('success', 'Banner has been updated.');\n }", "public function update(Request $request, Banner $data)\n\t{\n\t\t$request->validate([\n\t\t\t'foto' => 'sometimes|mimes:jpg,jpeg,png|image|max:3072|dimensions:width=1157,height=560',\n\t\t\t'judul' => 'required|string|min:5|max:50',\n\t\t\t'deskripsi' => 'required|string|min:10|max:180'\n\t\t]);\n\n\t\t$arr = [];\n\t\t$arr = Arr::add($arr, 'judul', nl2br($request->judul));\n\t\t$arr = Arr::add($arr, 'deskripsi', nl2br($request->deskripsi));\n\n\t\tif ($request->hasFile('foto')) {\n\t\t\t$foto = Image::make($request->file('foto'))->encode('jpg', 100);\n\t\t\t$nama_file = Str::random(50) . \".jpg\";\n\t\t\t$arr = Arr::add($arr, 'foto', $nama_file);\n\n\t\t\tif ($data->foto && Storage::disk('banner')->exists($data->foto)) {\n\t\t\t\tStorage::disk('banner')->delete($data->foto);\n\t\t\t}\n\t\t}\n\n\t\t$data->update($arr);\n\t\tif ($request->hasFile('foto')) {\n\t\t\tStorage::disk('banner')->put($nama_file, $foto);\n\t\t}\n\t\talert()\n\t\t\t->success('Data berhasil diubah', 'Sukses!')\n\t\t\t->persistent('Tutup')\n\t\t\t->autoclose(3000);\n\n\t\treturn redirect()->route('admin.master-data.banner.edit', $data->uuid);\n\t}", "public function store(Request $request)\n {\n $banner = Banner::create([\n 'name' => $request->name,\n 'image' => $this->upload( $request, 'image'),\n 'url' => $request->url,\n 'iframe' => $request->iframe,\n 'duration' => $request->duration,\n 'is_active' => Banner::count() ? 0 : 1\n ]);\n \n if( $request->expectsJson() ){\n return new BannerResource( $banner );\n }\n \n $request->session()->flash('message', 'Banner Ad Created Successfully!');\n return redirect()->route('admin.banners.index');\n }", "public function postEditBanner($id, Request $request)\n {\n $dataUpdate = [\n 'title' => $request->title,\n 'content' => $request->content,\n 'updated_at' => date('Y-m-d H:i:s'),\n ];\n\n $BannerModel = new Banner();\n $result = $BannerModel->updateBanner($id, $dataUpdate);\n if ($result > 0) {\n return redirect()->route('adgetEditBanner', ['id' => $id])->with('success', 'Cập nhật thành công!');\n } else {\n return redirect()->route('adgetEditBanner', ['id' => $id])->with('error', 'Cập nhật thất bại!');\n }\n\n }", "public function updateBanner(Request $request, $id)\n {\n $serie = Serie::findOrFail($id);\n\n if(!$serie->isOwnedBy(auth()->user()->id)) {\n return response()->json([ 'message' => MESSAGE_SERIE_NOT_ACCESSIBLE ], 403);\n }\n\n $validator = \\Validator::make($request->all(), [\n 'image'=> [ 'required', 'image' ]\n ]);\n\n if ($validator->fails()) {\n return response()->json(['message'=>$validator->errors('image')], 400);\n }\n\n $image = Image::make($request->file('image'));\n\n // Validate image size.\n if($image->width()!==COMIC_BANNER_WIDTH || $image->height()!==COMIC_BANNER_HEIGHT) {\n $error = \\Illuminate\\Validation\\ValidationException::withMessages([\n 'image' => ['The image size is not valid']\n ]);\n }\n\n // Save the image in the server.\n $image->stream();\n $filePath = 'series/' . Hashids::encode($serie->id) . '/banner_' . uniqid() . '.jpg';\n Storage::disk('spaces')->put($filePath, $image, 'public');\n\n // Update the serie,\n return tap($serie)->update([\n 'banner_url' => $filePath\n ]);\n }", "public function store(Request $request){\n\n $request->validate([\n 'title' => 'required|string|max:100',\n 'sub_title' => 'required|string|max:255',\n 'image' => 'required|image|mimes:jpeg,jpg,png,gif',\n 'button_text' => 'nullable|string|max:30',\n 'button_link' => 'nullable|url',\n 'admin_id' => 'numeric',\n ]);\n\n $banner = new Banner();\n\n $banner->title = $request->title;\n $banner->sub_title = $request->sub_title;\n $banner->button_text = $request->button_text;\n $banner->button_link = $request->button_link;\n $banner->status = $request->status;\n $banner->admin_id = $request->admin_id;\n\n //insert image\n if ($request->image > 0){\n $image = $request->file('image');\n $image_name = 'BarisalGeek-Banner'.'-'.time().'.'.$image->getClientOriginalExtension();\n $location = public_path('images/banners/'.$image_name);\n Image::make($image)->resize(1920, 900)->save($location);\n $banner->image = $image_name;\n }\n\n $banner->save();\n\n session()->flash('success','A New Banner Has Added');\n return redirect()->route('admin.banner.index');\n }", "public function update(UpdateBannerRequest $request, Banner $banner) {\n\t\t$this->dispatch(new UpdateBannerCommand(Auth::user(), $banner, $request));\n\n\t\t$type = $banner->type;\n\n\t\treturn redirect('/admin/banner?type='.$type->id);\n\t}", "public function update($id, $name, $width, $height, $display, $body, $pdo) {\r\n $dbId = mysql_real_escape_string($id);\r\n \r\n $dbName = ($name != NULL) ? mysql_real_escape_string($name) : 'NULL';\r\n $dbWidth = ($width != NULL) ? mysql_real_escape_string($width) : 'NULL';\r\n $dbHeight = ($height != NULL) ? mysql_real_escape_string($height) : 'NULL';\r\n $dbDisplay = ($display != NULL) ? mysql_real_escape_string($display) : 'NULL';\r\n $dbBody = ($body != NULL) ? stripslashes($body) : 'NULL';\r\n \r\n $sql = \"UPDATE banners SET name = ?, width = ?, height = ?, display = ?, banner_body = ? WHERE banner_id = ?\";\r\n $q = $pdo->prepare($sql);\r\n try {\r\n $q->execute(array($dbName, $dbWidth, $dbHeight, $dbDisplay, $dbBody, $dbId));\r\n } catch (PDOException $e) {\r\n echo 'update banners table failed. '.$e->getMessage();\r\n }\r\n\r\n return;\r\n }", "public function store(BannerRequest $request)\n {\n if($request->hasFile('image_file')){\n $image = FileUpload::upload($request->file('image_file'),'banner');\n if($image){\n $request->merge(['image' => $image]);\n }\n }\n $banner = Banner::create($request->except('image_file'));\n return redirect('admin/banner')->with(\"status\",\"Thêm Mới Thành Công\");\n }", "public function add(Request $request) {\n $rules = array(\n 'id' => 'numeric',\n 'Title' => 'required',\n 'DisplayOrder' => 'required|numeric|min:1',\n 'Image' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048'\n );\n // run the validation rules on the inputs from the form\n $validator = Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n return BaseResult::error(400, $validator->messages()->toJson());\n } else {\n $user = Session::get('user');\n $banner = new Banner;\n try {\n $banner->Title = $request->Title;\n $banner->DisplayOrder = $request->DisplayOrder; \n $banner->IsPublished = $request->has('IsPublished') ? true : false; \n $banner->IsDeleted = 0;\n $banner->CreatedDate = now();\n $banner->CreatedBy = $user->USE_ID;\n $banner->save();\n\n if ($request->hasFile('Image')) {\n $filename = pathinfo($request->Image->getClientOriginalName(), PATHINFO_FILENAME);\n $imageName = $banner->BAN_ID . '_' . $filename . '_' . time() . '.' . $request->Image->extension();\n $request->Image->move(public_path('data/banners'), $imageName);\n $banner->Banner = $imageName;\n $banner->save();\n }\n\n return BaseResult::withData($banner);\n } catch (\\Exception $e) {\n return BaseResult::error(500, $e->getMessage());\n }\n }\n }", "public function run()\n {\n \n $Record = [\n ['id' =>1,\"image\"=>\"banner1.jpg\",\"link\"=>\"\",\"title\"=>\"Black Jacket\",\"alt\"=>\"Black Jacket\",\"status\"=>1],\n ['id' =>2,\"image\"=>\"banner2.jpg\",\"link\"=>\"\",\"title\"=>\"Full Sleeve T-Shirt\",\"alt\"=>\"Full Sleeve T-Shirt\",\"status\"=>1],\n ['id' =>3,\"image\"=>\"banner3.jpg\",\"link\"=>\"\",\"title\"=>\"Half Sleeve T-Shirt\",\"alt\"=>\"Half Sleeve T-Shirt\",\"status\"=>1]\n ];\n\n Banner::insert($Record);\n }", "public function update(Request $request, $id)\n {\n $this->validate($request,[\n 'banner_title' => 'required'\n ]);\n\n $filename = \"\";\n if($request->hasFile('image')){\n $image = $request->file('image'); \n $filename = 'home_banner_'.time().'.'.$image->getClientOriginalExtension(); \n Storage::disk('public')->put('home_banner/'.$filename,file_get_contents($image));\n } \n\n try{\n Banners::find($id)->update(\n array(\n 'status'=>$request->input('status'),\n 'title'=>$request->input(\"banner_title\"),\n 'image'=>($filename==\"\"?$request->input(\"old_banner_image\"):$filename),\n 'updated_at'=>date(\"Y-m-d h:i:s\")\n )\n );\n\n /*for($i=0;$i<2;$i++) {\n BannerDetails::where('lang_id', '=', ($i+1))\n ->where('banner_id', '=', $id)\n ->update(\n array(\n 'title'=>$request->input('banner_title.'.($i+1))\n )\n );\n }*/\n\n } catch(\\Exception $e){\n // do task when error\n //dd($e->getMessage()); \n return redirect()->route('admin.banners.edit',$id)->with('error',$e->getMessage());\n }\n\n return redirect()->route('admin.banners.edit',$id)->with('success','Banner updated successfully');\n }", "public function create()\r\n\t{\r\n\t\t$this->auth->restrict('Banner.Content.Create');\r\n \r\n if ($this->input->post('submit'))\r\n\t\t{\r\n\t\t\tif ($insert_id = $this->save_banner_group())\r\n\t\t\t{\r\n\t\t\t\t// Log the activity\r\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('banner_act_create_record').': ' . $insert_id . ' : ' . $this->input->ip_address(), 'banner');\r\n\r\n\t\t\t\tTemplate::set_message(lang('banner_create_success'), 'success');\r\n\t\t\t\tTemplate::redirect(SITE_AREA .'/content/banner/groups');\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tTemplate::set_message(lang('banner_create_failure') . $this->banner_group_model->error, 'error');\r\n\t\t\t}\r\n\t\t}\r\n\t\tAssets::add_module_js('banner', 'banner.js');\r\n \r\n Assets::add_css(array\t(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTemplate::theme_url('css/jquery.ui.datepicker.css'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTemplate::theme_url('css/jquery-iframedialog.css'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTemplate::theme_url('css/jquery/jquery.plugin.chosen.css'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTemplate::theme_url('css/jquery/jquery.tagsinput.css'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t\t\t\t'screen');\r\n \t\t\t\t\t\t\t\t\t\r\n\t\tAssets::add_module_css('banner', 'banner.css');\r\n \r\n Assets::add_js(\tarray\t(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTemplate::theme_url('js/jquery-ui-1.8.13.min.js'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTemplate::theme_url('js/jquery-iframedialog.js'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTemplate::theme_url('js/admin.js'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTemplate::theme_url('js/jquery/jquery.plugin.chosen.js'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTemplate::theme_url('js/jquery/jquery.plugin.livequery.js'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTemplate::theme_url('js/jquery/jquery.tagsinput.min.js'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTemplate::theme_url('js/editors/ckeditor/ckeditor.js'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTemplate::theme_url('js/editors/ckeditor/adapters/jquery.js'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tTemplate::theme_url('js/my_wysiwyg.js'),\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t),\r\n\t\t\t\t\t\t\t\t\t\t'external',\r\n\t\t\t\t\t\t\t\t\t\ttrue\r\n\t\t\t\t\t\t\t\t\t);\r\n \r\n\t\tTemplate::set_view('groups/create');\r\n\t\tTemplate::set('toolbar_title', lang('banner_create') . ' Banner Group');\r\n\t\tTemplate::render();\r\n\t}", "public function store(Request $request)\n {\n $request->validate([\n 'like' => 'nullable',\n 'description' => 'nullable',\n ]);\n $banner = $request->all();\n Banner::create($banner);\n\n return redirect('admin/banner');\n }", "public function store(BannersRequest $request)\n {\n $banners = new Banners;\n $banners->main_image_id = $request->main_image_id;\n $banners->save();\n\n // translation\n $languages = Language::all();\n if($languages->count()){\n foreach ($request->language as $language) {\n $title = 'title_'.$language.'';\n $link = 'link';\n $banners_trans = new BannersTrans;\n \n $banners_trans->title = $request->$title;\n $banners_trans->link = $request->$link;\n\n $banners_trans->lang = $language;\n $banners_trans->tid = $banners->id;\n \n $banners_trans->save();\n }\n }\n session()->forget('default_contnent_language');\n // end translation\n\n Flash::success(trans('backend.saved_successfully'));\n $Currentlanguage = Lang::getLocale();\n if($request->back){\n return back();\n }\n\n return redirect(''.$Currentlanguage.'/admin/banners');\n }", "public function store(BannerRequest $request)\n {\n \n $validated = $request->validated();\n return $this->bannerService->store($validated);\n }", "public function update(BannerRequest $request, $id)\n {\n $validated = $request->validated();\n return $this->bannerService->update($validated, $id);\n }", "public function store(StoreBannerPost $request)\n {\n //\n $datas = $request->all();\n $file = $request->hasFile('image') ? $request->file('image') : null;\n $error = $this->checkError($datas, $file);\n if(!$file) {\n $this->set_error('图片不能为空');\n }else if(!$error) {\n $ret = $this->banner->create($datas);\n if($ret) $this->set_success('添加成功');\n else $this->set_error('添加失败');\n }else {\n $this->set_error($error);\n }\n return response()->json($this->get_result());\n }", "function setBanner(Banner $banner)\n {\n $this->banner = $banner;\n }", "public function create(): View\n {\n return view('admin.banner.create')\n ->withTitle('Upload Banner');\n }", "public function store(Request $request)\n {\n $request->validate([\n 'title' => 'required|max:255',\n 'image' => 'image|mimes:jpeg,png,jpg,gif,svg|max:10000',\n 'description' => 'required',\n ], [\n 'title.required' => 'Bạn cần phải nhập vào tiêu đề',\n 'image.image' => 'File ảnh phải có dạng jpeg,png,jpg,gif,svg',\n 'description.required' => 'Bạn cần phải nhập vào mô tả chi tiết',\n ]);\n\n $banner = new Banner();\n $banner->title = $request->input('title');\n $banner->slug = Str::slug($request->input('title'));\n $banner->url = $request->input('url');\n $banner->type = $request->input('type');\n\n if ($request->hasFile('image')) {\n $file = $request->file('image');\n $filename = time() . '_' . $file->getClientOriginalName();\n $path_upload = 'upload/banner/';\n $file->move($path_upload, $filename);\n $banner->image = $path_upload . $filename;\n }\n\n $position = 0;\n if ($request->has('position')) {\n $position = $request->input('position');\n }\n $banner->position = $position;\n\n $is_active = 0;\n if ($request->has('is_active')) {\n $is_active = $request->input('is_active');\n }\n $banner->is_active = $is_active;\n $banner->description = $request->input('description');\n\n $banner->save();\n\n return redirect()->route('admin.banner.index');\n }", "public function editBanner() {\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n $bid = $this->input->post('banner_id');\n $excludeArr = array(\"status\", \"banner_image\", \"banner_id\");\n\n if ($this->input->post('status') != '') {\n $banner_status = 'Publish';\n } else {\n $banner_status = 'Unpublish';\n }\n\n $inputArr = array(\n 'status' => $banner_status\n );\n\n $config['overwrite'] = FALSE;\n $config['encrypt_name'] = TRUE;\n $config['allowed_types'] = 'jpg|jpeg|gif|png|bmp';\n $config['max_size'] = 2000;\n $config['upload_path'] = './images/banner';\n $this->load->library('upload', $config);\n $banner_data = array();\n\t\t\t\n\t\t\tif($_FILES[\"banner_image\"][\"size\"]>0){\n\t\t\t\tif ($this->upload->do_upload('banner_image')) {\n\t\t\t\t\t$logoDetails = $this->upload->data();\n\t\t\t\t\t$ImageName = $logoDetails['file_name'];\n\t\t\t\t\t$target_file='images/banner/'.$ImageName;\n\t\t\t\t\t$option=$this->getImageShape(200,112,$target_file);\t\t\t\t\t\t\n\t\t\t\t\t$resizeObj = new Resizeimage($target_file);\t\t\t\t\t\t\t\n\t\t\t\t\t$resizeObj -> resizeImage(200, 112, $option);\n\t\t\t\t\t$resizeObj -> saveImage('images/banner/thumbnail-'.$ImageName, 100);\n\t\t\t\t\t$banner_data = array('image' => $ImageName);\n\t\t\t\t} else {\n\t\t\t\t\t$bannerDetails = $this->upload->display_errors();\n\t\t\t\t\t$this->setErrorMessage('error', strip_tags($bannerDetails));\n\t\t\t\t\tredirect(ADMIN_ENC_URL.'/banner/edit_banner/'.$bid);\n\t\t\t\t}\n\t\t\t}\n\n $dataArr = array_merge($inputArr, $banner_data);\n $condition = array('_id' => MongoID($bid));\n $this->banner_model->commonInsertUpdate(BANNER, 'update', $excludeArr, $dataArr, $condition);\n $this->setErrorMessage('success', 'Banner updated successfully','admin_banner_update_success');\n redirect(ADMIN_ENC_URL.'/banner/display_banner');\n }\n }", "public function update(Request $request, $id)\n {\n $banner = Banner::findOrFail($id);\n $banner->title = $request->banner_title;\n $banner->description = $request->banner_des;\n $banner->link = $request->banner_link;\n $banner->status = $request->banner_status;\n // Upload image\n if($request->hasFile('banner_image')){\n $file_name = time().'.'.$request->banner_image->getClientOriginalExtension();\n $banner_image_path = 'images/home_banners/'.$file_name;\n // Resize & upload image\n Image::make($request->banner_image)->resize(500, 500)->save($banner_image_path); \n // Remove image old\n if(file_exists('images/home_banners/'.$banner->image)){\n unlink('images/home_banners/'.$banner->image);\n }\n }else{\n $file_name = $request->banner_current_image;\n }\n $banner->image = $file_name;\n $banner->save();\n\n return redirect()->route('banner.index')->with('flash_message_success', 'Chỉnh sửa banner thành công!');\n }", "public function update(BannersRequest $request, $id)\n {\n $banners = Banners::find($id);\n $banners->main_image_id = $request->main_image_id;\n $banners->save();\n\n // translation\n $languages = Language::all();\n if($languages->count()){\n foreach ($request->language as $language) {\n $title = 'title_'.$language.'';\n $link = 'link';\n \n $banners_trans = BannersTrans::where('tid', '=', $banners->id)->where('lang', '=', $language)->first();\n if(empty($banners_trans)){\n $banners_trans = new BannersTrans;\n }\n \n $banners_trans->title = $request->$title;\n $banners_trans->link = $request->$link;\n\n $banners_trans->lang = $language;\n $banners_trans->tid = $banners->id;\n \n $banners_trans->save();\n }\n }\n\n session()->forget('default_contnent_language');\n // end translation\n\n Flash::success(trans('backend.updated_successfully'));\n $Currentlanguage = Lang::getLocale();\n if($request->back){\n return back();\n }\n return redirect(''.$Currentlanguage.'/admin/banners');\n }", "public function store(Request $request)\n {\n request()->validate([\n 'banner_title' => 'required'\n ]);\n\n $filename = \"\";\n if($request->hasFile('image')){\n $image = $request->file('image');\n $filename = 'home_banner_'.time().'.'.$image->getClientOriginalExtension();\n Storage::disk('public')->put('home_banner/'.$filename,file_get_contents($image));\n } \n\n try{\n $banners = new Banners; \n $banners->title = $request->input(\"banner_title\");\n $banners->status = $request->input(\"status\");\n $banners->image = $filename;\n $banners->created_at = date('Y-m-d h:i:s');\n $banners->save();\n\n /*for($i=0;$i<2;$i++) {\n $banner_details = new BannerDetails; \n $banner_details->banner_id = $banners->id; \n $banner_details->lang_id = ($i+1);\n $banner_details->title = $request->input(\"banner_title.\".($i+1));\n $banner_details->save();\n }*/\n\n } catch(\\Exception $e){\n // do task when error\n return redirect()->route('admin.banners.create')->with('error',$e->getMessage());\n }\n\n return redirect()->route('admin.banners.index')->with('success','Banner created successfully');\n }", "public function create()\n {\n return view('backend.banner.create');\n }", "public function create()\n {\n return view('backend.banner.create');\n }", "public function store(Request $request)\n {\n $banner = new Banner;\n $banner->title = $request->banner_title;\n $banner->description = $request->banner_des;\n $banner->link = $request->banner_link;\n $banner->status = $request->banner_status;\n \n // Upload image\n if($request->hasFile('banner_image')){\n $file_name = time().'.'.$request->banner_image->getClientOriginalExtension();\n $banner_image_path = 'images/home_banners/'.$file_name;\n // Resize image\n Image::make($request->banner_image)->resize(500, 500)->save($banner_image_path);\n\n $banner->image = $file_name;\n }\n $banner->save();\n return redirect()->route('banner.index')->with('flash_message_success', 'Thêm mới banner thành công!');\n }", "public function update(Request $request, $id)\n {\n $banner = Banner::findOrFail($id);\n $this->validate($request, [\n 'name' => 'required|unique:products',\n 'description' => 'required',\n 'link' => 'string',\n 'image' => 'mimes:jpeg,png|max:10240'\n ]);\n\n $data = $request->only('name', 'description' , 'link');\n\n if ($request->hasFile('image')) {\n $data['image'] = $this->savePhoto($request->file('image'));\n if ($banner->image !== '') $this->deletePhoto($banner->image);\n }\n\n $banner->update($data);\n\n \\Flash::success($banner->name . ' updated.');\n return redirect()->route('banner.index');\n }", "public function show(Banner $banner)\n {\n if( request()->expectsJson() ){\n return new BannerResource( $banner );\n }\n return view('admin.banners.create', $banner);\n }", "public function update(Request $request, $id)\n {\n $banner = Banner::find($id);\n $banner->photo = $request->previous_photo;\n if($request->hasFile('photo')){\n $banner->photo = $request->photo->store('uploads/banners');\n }\n $banner->url = $request->url;\n $banner->save();\n flash(__('Banner has been updated successfully'))->success();\n return redirect()->route('home_settings.index');\n }", "public function create()\n {\n return view('admin.banners.add_banner');\n }", "public function update(array $data, Banner $banner)\n {\n $update = $banner->update($data);\n //Check if updated or not\n if($update) {\n // If Updated Check Image is there or not\n if(isset($data['image'])) {\n //If There Then Update The Image\n $image = updateImage($data['image'], $banner);\n //If Image is store then return collection\n if($image) {\n return $banner;\n } else {\n return null;\n }\n //If Not Present Then Return The Category Image\n } else {\n return $banner;\n }\n } else {\n return null;\n }\n }", "public function newbanner()\n {\n if (get_option('is_on_banner_buy') == '0') {\n return new Tempcode();\n }\n\n $this->handle_has_banner_already();\n\n $title = get_screen_title('ADD_BANNER');\n\n breadcrumb_set_parents(array(\n array('_SELF:_SELF:browse', do_lang_tempcode('POINTSTORE')),\n array('_SELF:_SELF:bannerinfo:banners', do_lang_tempcode('BANNERS')),\n ));\n\n // We can purchase a banner...\n $initial_hits = intval(get_option('initial_banner_hits'));\n $banner_price = intval(get_option('banner_setup'));\n $text = paragraph(do_lang_tempcode('BANNERS_DESCRIPTION', escape_html(integer_format($initial_hits)), escape_html(integer_format($banner_price))));\n list($fields, $javascript) = get_banner_form_fields(true);\n $post_url = build_url(array('page' => '_SELF', 'type' => '_newbanner', 'id' => 'banners', 'uploading' => 1), '_SELF');\n\n $hidden = new Tempcode();\n handle_max_file_size($hidden, 'image');\n\n return do_template('FORM_SCREEN', array('_GUID' => '45b8878d92712e07c4eb5497f1a33e33', 'HIDDEN' => $hidden, 'TITLE' => $title, 'TEXT' => $text, 'FIELDS' => $fields, 'URL' => $post_url, 'SUBMIT_ICON' => 'buttons__proceed', 'SUBMIT_NAME' => do_lang_tempcode('ADD_BANNER'), 'JAVASCRIPT' => $javascript));\n }", "public function store(BannerRequest $request): RedirectResponse\n {\n $image = $request->file('image');\n if ($image->isValid()) {\n $directory = sprintf('public/banner/%s', Carbon::now()->format('Y/m'));\n $path = $image->store($directory);\n $request->merge(['path' => $path]);\n }\n\n $banner = Banner::create($request->all());\n\n return redirect()\n ->route('admin.banner.index')\n ->withSuccess('Banner has been uploaded.');\n }", "public function store(Request $r)\n {\n /* set variable */\n $orders = explode(',', $r->input('orders'));\n\n /* validation */\n $validate = [\n 'title' => 'required',\n 'description' => 'required',\n 'image' => $this->image_rule,\n ];\n if (bool($r->input('only_image'))) {\n $validate = [\n 'image' => $this->image_rule,\n ];\n }\n $this->validate($r, $validate);\n\n /* save data */\n $banner = new Banner;\n $banner->title = $r->input('title');\n $banner->description = $r->input('description');\n $banner->url = $r->input('url');\n $banner->url_external = 'no';\n if ($r->input('url') == 'external') {\n $banner->url = $r->input('url_external');\n $banner->url_external = 'yes';\n }\n $banner->target = $r->input('target');\n $banner->only_image = $r->input('only_image') ?? 'no';\n $banner->status = $r->input('status') ?? 'inactive';\n $banner->site_id = app('site')->id;\n $banner->save();\n\n /* process image */\n if ($r->hasFile('image')) {\n $file = $r->file('image');\n $ext = $file->getClientOriginalExtension();\n $name = 'banner-' . (md5($banner->id . getDatabasePort())) . '.' . $ext;\n\n if ($this->uploadImage($file, '/assets/images/banners/', $name)) {\n $banner->image = $name;\n }\n }\n $banner->save();\n\n /* set order */\n if ($r->input('order') == 'first') {\n array_unshift($orders, $banner->id);\n } else {\n $key = array_search($r->input('order'), $orders);\n array_splice($orders, ($key + 1), 0, $banner->id);\n }\n $this->sortQuery($r, $orders);\n\n /* save activity */\n $this->activityLog('[~name] (' . $this->getUserRoles() . ') menambahkan spanduk \"' . $banner->title . '\"');\n\n /* clear cache */\n \\Cache::flush();\n\n return redirect($this->current_url)->with('success', 'Spanduk berhasil ditambah!');\n }", "public function create(){\n\n return view('backend.pages.banner.create');\n }", "public function create(){\n\n $heading = 'Vytvořit banner';\n\n return view('admin.banner.create', compact('heading'));\n }", "public function update($id)\n {\n $rules = array(\n 'name' => 'required'\n );\n $validator = Validator::make(Input::all(), $rules);\n if ($validator->fails()) {\n return Response::json($validator->messages(), 500); //$validator->messages()->toJson();\n } else {\n $banner = Banner::find($id);\n $banner->name = Input::get('name');\n $banner->save();\n\n $foo = Input::get('tile_image');\n if(!empty($foo)){\n $destinationPath = 'uploads/banners/'.md5($banner->name.time()).'_banner_tile_image.png';\n $arrayBase64String = explode(\",\", $foo );\n $image = base64_decode($arrayBase64String[1]);\n file_put_contents(public_path($destinationPath), $image );\n $pictureTile = Image::make(public_path($destinationPath));\n $pictureTile->fit(1200,360)->save(public_path($destinationPath));\n $banner->tile_image = $destinationPath;\n }\n $banner->save();\n return Response::json(array('status' => 'success' , 'data' => $banner), 200);\n }\n }", "public function create()\n {\n return view('backend.banners.create');\n }", "public function create() {\n\n\n \n\n $template['main'] = $this->info->module_menu;\n $template['perm'] = $this->perm;\n $template['sub'] = $this->info->function_menu;\n $template['page'] = 'Banners/banners_create';\n $template['page_title'] = \"Create Banners\";\n $template['page_data'] = $this->info;\n $template['bundle'] = $this->db->get('bundles')->result();\n $template['department'] = $this->db->get('departments')->result();\n $template['brand'] = $this->db->get('brands')->result();\n $template['category'] = $this->db->get('categories')->result();\n $template['subcategory'] = $this->db->get('subcategories')->result();\n $template['bundlecategory'] = $this->db->get('bundles_categories')->result();\n\n \n if($_POST) {\n $data = $_POST;\n\n unset($data['submit']);\n $result = $this->Banners_model->save_banners($data);\n if($result == \"Exist\") {\n $this->session->set_flashdata('message', array('message' => 'Banner Already Exist','class' => 'danger'));\n }\n else { \n \n $this->session->set_flashdata('message', array('message' => 'Banner Created successfully','class' => 'success'));\n }\n redirect(base_url().'banners');\n }\n $this->load->view('template', $template);\n }", "public function insertBanner() {\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n\n $excludeArr = array(\"status\", \"banner_image\");\n\n if ($this->input->post('status') != '') {\n $banner_status = 'Publish';\n } else {\n $banner_status = 'Unpublish';\n }\n\n $inputArr = array(\n 'status' => $banner_status\n );\n\n $config['overwrite'] = FALSE;\n $config['encrypt_name'] = TRUE;\n $config['allowed_types'] = 'jpg|jpeg|gif|png|bmp';\n $config['max_size'] = 2000;\n $config['upload_path'] = './images/banner';\n $this->load->library('upload', $config);\n if ($this->upload->do_upload('banner_image')) {\n $bannerDetails = $this->upload->data();\n $ImageName = $bannerDetails['file_name'];\n\t\t\t\t\n\t\t\t\t$target_file='images/banner/'.$ImageName;\n\t\t\t\t$option=$this->getImageShape(200,112,$target_file);\t\t\t\t\t\t\n\t\t\t\t$resizeObj = new Resizeimage($target_file);\t\t\t\t\t\t\t\n\t\t\t\t$resizeObj -> resizeImage(200, 112, $option);\n\t\t\t\t$resizeObj -> saveImage('images/banner/thumbnail-'.$ImageName, 100);\t\n\t\t\t\t\n } else {\n $bannerDetails = $this->upload->display_errors();\n $this->setErrorMessage('error', strip_tags($bannerDetails));\n redirect(ADMIN_ENC_URL.'/banner/add_banner_form');\n }\n $banner_data = array('image' => $ImageName);\n\n $dataArr = array_merge($inputArr, $banner_data);\n\n $this->banner_model->commonInsertUpdate(BANNER, 'insert', $excludeArr, $dataArr);\n $this->setErrorMessage('success', 'Banner added successfully','admin_banner_added_success');\n redirect(ADMIN_ENC_URL.'/banner/display_banner');\n }\n }", "public function update(Request $request,$id)\n {\n $banner = Banner::find(1);\n $input = array();\n if($request->file('image')){\n foreach ($request->file('image') as $key => $file) {\n $fileName[] = $file->hashName();\n $file->store('banner');\n }\n $image = (empty(json_decode($banner['image']))) ? array() : json_decode($banner['image']);\n $image_json = json_encode(array_merge($image,$fileName));\n $input['image'] = $image_json;\n }\n if($request->file('image_left')){\n $path = $request->file('image_left')->store('banner');\n $input['image_left'] = str_replace('banner/', '', $path);\n\n }\n if($request->file('image_right')){\n $path = $request->file('image_right')->store('banner');\n $input['image_right'] = str_replace('banner/', '', $path);\n\n }\n if (!empty($input)) {\n Banner::where('id', 1)->update($input);\n }\n $banner = Banner::find(1);\n return view('admin/banner/edit', [\n 'banner' => $banner\n ]);\n }", "public function update(BannerRequest $request, $lang, Banner $banner): RedirectResponse\n {\n $request->merge([\n 'is_active' => $request->is_active == 1,\n ]);\n\n $banner->fill($request->all());\n $banner->save();\n\n return redirect()\n ->route('admin.banner.index')\n ->withSuccess('Banner has been updated.');\n }", "public function addAction(Request $request)\n {\n $banner = new Banner();\n\n $form = $this->createForm(new BannerType(), $banner);\n $form->handleRequest($request);\n\n if ($form->isSubmitted() && $form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n\n $banner->setUser($this->getUser());\n\n $em->persist($banner);\n $em->flush();\n\n $this->flash('flash_success', 'bannerAdded');\n\n return $this->redirectToRoute('bannerIndex');\n }\n\n return $this->renderEditForm($form);\n }", "public function store(Request $request)\n {\n $data = $request->except('_token');\n Banner::create($data);\n return redirect(url('serstore/banner'));\n }", "public function addCampaignBanners() {\n\n $data = $_POST;\n\n\n if (!isset($data)) {\n\n throw new RestException(HttpStatusCodes::BAD_REQUEST, \"Missing required params\");\n }\n try {\n\n $bannerDara = json_decode($data, true);\n $id = Campaign::addNewCampaign(array('name' => $bannerDara['name']));\n foreach ($bannerDara['banners'] as $key => $values) {\n\n $bannerDara['banners'][$key]['campaign_id'] = $id;\n }\n Banner::addMultipleBanner($bannerDara['banners']);\n\n return array(\"success\" => \"Campaign Banner, Updated \" . $id);\n\n http_response_code(HttpStatusCodes::CREATED);\n } catch (Exception $e) {\n throw new RestException($e->getCode(), $e->getMessage());\n }\n }", "public function updateBanner($id, $field, $value = null)\n {\n $parameters = [\n 'id' => (string) $id,\n 'field' => (string) $field\n ];\n\n if (null !== $value) {\n $parameters['value'] = $value;\n }\n\n return (bool) $this->apiClient->doCall('updateBanner', $parameters);\n }", "public function editBannerAction(Request $request, string $bannerId): Response\n {\n $form = new BannerForm();\n $infrastructureForm = $this->createPreparedForm($request, $form, BannerFormType::class);\n\n return $this->handleObjectSaveForm(\n $infrastructureForm,\n function () use ($form, $bannerId) {\n return $this->handler->handleEdit($form, $bannerId);\n },\n false\n );\n }", "public function create()\n {\n return view('serstore.banner.create');\n }", "public function store(Request $request)\n {\n $data = $this->formatData($request);\n Banner::create($data);\n\n \\Session::flash('alert', [\n 'type' => 'success',\n 'title' => '添加成功',\n 'message' => '添加Banner成功',\n ]);\n return redirect('/admin/banner');\n }", "public function __newbanner()\n {\n if (get_option('is_on_banner_buy') == '0') {\n return new Tempcode();\n }\n\n $title = get_screen_title('ADD_BANNER');\n\n breadcrumb_set_parents(array(\n array('_SELF:_SELF:browse', do_lang_tempcode('POINTSTORE')),\n array('_SELF:_SELF:bannerinfo:banners', do_lang_tempcode('BANNERS')),\n array('_SELF:_SELF:newbanner:banners', do_lang_tempcode('ADD_BANNER')),\n ));\n\n\n breadcrumb_set_self(do_lang_tempcode('DONE'));\n\n $this->check_afford_banner();\n\n // So we don't need to call these big ugly names, again...\n $image_url = post_param_string('image_url');\n $site_url = post_param_string('site_url');\n $caption = post_param_string('caption');\n $direct_code = post_param_string('direct_code', '');\n $notes = post_param_string('notes', '');\n $name = post_param_string('name');\n\n $cost = intval(get_option('banner_setup'));\n\n $this->handle_has_banner_already();\n\n check_banner();\n add_banner($name, $image_url, '', $caption, $direct_code, intval(get_option('initial_banner_hits')), $site_url, 3, $notes, BANNER_PERMANENT, null, get_member(), 0);\n $GLOBALS['SITE_DB']->query_insert('sales', array('date_and_time' => time(), 'memberid' => get_member(), 'purchasetype' => 'banner', 'details' => $name, 'details2' => ''));\n require_code('points2');\n charge_member(get_member(), $cost, do_lang('ADD_BANNER'));\n\n // Send mail to staff\n require_code('submit');\n $edit_url = build_url(array('page' => 'cms_banners', 'type' => '_edit', 'name' => $name), get_module_zone('cms_banners'), null, false, false, true);\n if (addon_installed('unvalidated')) {\n send_validation_request('ADD_BANNER', 'banners', true, $name, $edit_url);\n }\n\n $stats_url = build_url(array('page' => 'banners', 'type' => 'browse'), get_module_zone('banners'));\n $text = do_lang_tempcode('PURCHASED_BANNER');\n\n $_banner_type_row = $GLOBALS['SITE_DB']->query_select('banner_types', array('t_image_width', 't_image_height'), array('id' => ''), '', 1);\n if (array_key_exists(0, $_banner_type_row)) {\n $banner_type_row = $_banner_type_row[0];\n } else {\n $banner_type_row = array('t_image_width' => 728, 't_image_height' => 90);\n }\n $banner_code = do_template('BANNER_SHOW_CODE', array('_GUID' => 'c96f0ce22de97782b1ab9bee3f43c0ba', 'TYPE' => '', 'NAME' => $name, 'WIDTH' => strval($banner_type_row['t_image_width']), 'HEIGHT' => strval($banner_type_row['t_image_height'])));\n\n return do_template('BANNER_ADDED_SCREEN', array('_GUID' => '68725923b19d3df71c72276ada826183', 'TITLE' => $title, 'TEXT' => $text, 'BANNER_CODE' => $banner_code, 'STATS_URL' => $stats_url, 'DO_NEXT' => ''));\n }", "public function update_banner($id, $data) {\n $this->db->where('banner_id', $id);\n $query = $this->db->update('banners', $data);\n return true;\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'content' => 'required|string|not_in:<script>',\n 'image' => 'required|image|mimes:' . config('app.admin.upload.image.mimes') . '|max:' . config('app.admin.upload.image.storage')\n ]);\n\n $banner = new Banner;\n $banner->create($request->all());\n\n return redirect()->action('Admin\\BannerController@index');\n }", "public function _newbanner()\n {\n if (get_option('is_on_banner_buy') == '0') {\n return new Tempcode();\n }\n\n require_code('uploads');\n\n $title = get_screen_title('ADD_BANNER');\n\n breadcrumb_set_parents(array(\n array('_SELF:_SELF:browse', do_lang_tempcode('POINTSTORE')),\n array('_SELF:_SELF:bannerinfo:banners', do_lang_tempcode('BANNERS')),\n array('_SELF:_SELF:newbanner:banners', do_lang_tempcode('ADD_BANNER')),\n ));\n\n breadcrumb_set_self(do_lang_tempcode('CONFIRM'));\n\n $member_id = get_member(); // the ID of the member who is logged in right now\n $cost = intval(get_option('banner_setup'));\n $points_after = available_points($member_id) - $cost; // the number of points this member has left\n\n // So we don't have to call these big ugly names, again...\n $name = post_param_string('name');\n $urls = get_url('image_url', 'file', 'uploads/banners', 0, CMS_UPLOAD_IMAGE);\n $image_url = $urls[0];\n $site_url = post_param_string('site_url');\n $caption = post_param_string('caption');\n $direct_code = post_param_string('direct_code', '');\n $notes = post_param_string('notes', '');\n\n $this->check_afford_banner();\n\n $this->handle_has_banner_already();\n\n $banner = show_banner($name, '', comcode_to_tempcode($caption), $direct_code, (url_is_local($image_url) ? (get_custom_base_url() . '/') : '') . $image_url, '', $site_url, '', get_member());\n $proceed_url = build_url(array('page' => '_SELF', 'type' => '__newbanner', 'id' => 'banners'), '_SELF');\n $cancel_url = build_url(array('page' => '_SELF'), '_SELF');\n $keep = new Tempcode();\n $keep->attach(form_input_hidden('image_url', $image_url));\n $keep->attach(form_input_hidden('site_url', $site_url));\n $keep->attach(form_input_hidden('caption', $caption));\n $keep->attach(form_input_hidden('notes', $notes));\n $keep->attach(form_input_hidden('name', $name));\n\n return do_template('POINTSTORE_CONFIRM_SCREEN', array(\n '_GUID' => '6d5ac2177bd76e31b915d4358c0bbbf4',\n 'ACTION' => '',\n 'COST' => integer_format($cost),\n 'POINTS_AFTER' => integer_format($points_after),\n 'TITLE' => $title,\n 'MESSAGE' => $banner,\n 'PROCEED_URL' => $proceed_url,\n 'CANCEL_URL' => $cancel_url,\n 'KEEP' => $keep,\n ));\n }", "public function actionCreate()\n {\n $model = new Banners();\n if(!empty(Yii::$app->request->post())) {\n $postData = Yii::$app->request->post();\n if(!empty($_FILES['Banners']['name']['image'])) {\n $postData['Banners']['image'] = $this->uploadFiles($_FILES)['file_path'];\n } else {\n Yii::$app->session->setFlash('error', \"Image should be mandatory\");\n return $this->redirect(['create']);\n }\n if ($model->load($postData) && $model->save()) {\n return $this->redirect(['index']);\n } \n }\n \n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function update($id)\n\t{\n $data = Banners::find($id);\n\t\t$rules = array(\n\t\t\t'name' => 'required'\n\t\t);\n\t\t$input = Input::except('_token');\n\t\t$validator = Validator::make($input,$rules);\n\t\tif($validator->fails()) {\n\t\t\treturn Redirect::action('BannerController@edit', $id)\n\t ->withErrors($validator)\n\t ->withInput(Input::except('password'));\n } else {\n \tif($input['image_url']){\n\t\t\t\t$image = Common::uploadImage(IMAGEBANNER, 'image_url');\n\t\t\t\t$input['image_url'] = $image;\n\t\t\t\t$imageMobile = Common::uploadImage(IMAGEBANNER, 'image_url_mobile');\n\t\t\t\t$input['image_url_mobile'] = $imageMobile;\n \t}else{\n \t\t$input['image_url'] = $data->image_url;\n \t\t$input['image_url_mobile'] = $data->image_url_mobile;\n \t}\n \t$input['expire_time'] = (isset($input['expire_time'])) ? $input['expire_time'] : 0 ;\n \t$input['status'] = ACTIVE;\n \tself::setAllDeactive();\n \tCommonNormal::update($id,$input);\n\t\t\treturn Redirect::action('BannerController@index') ;\n\t\t}\n\t\t\t\n\t}", "public function create()\n {\n echo 'create a banner juice';\n }", "public function create()\n {\n $banners = Banner::all();\n return view('admin.banners.create', ['banners'=>$banners]);\n }", "public function create()\n {\n return view('admin.banner.create');\n }", "public function create()\n {\n return view('admin.banner.create');\n }", "public function update(Request $request, $id)\n {\n\n $data = $this->formatData($request);\n $banner = Banner::find($id);\n $banner->update($data);\n\n \\Session::flash('alert', [\n 'type' => 'success',\n 'title' => '修改成功',\n 'message' => '修改Banner成功',\n ]);\n return redirect('/admin/banner');\n }", "public function create()\n {\n return view('admin.main.banner.create');\n }", "public function update($id, Request $request)\n {\n $this->validate($request, [\n 'banner_image' => 'image',\n 'image' => 'image',\n\t\t\t'name' => 'required',\n\t\t\t'tagline' => 'required',\n\t\t\t'description' => 'required'\n\t\t]);\n\n if (Input::hasFile('banner_image')) {\n $file = Input::file('banner_image');\n $pictureName = 'service-banner-'.time();\n Cloudder::upload($file->getPathName(), $pictureName);\n $upload = Cloudder::getResult();\n $requestData['banner_image'] = $upload['url'];\n } else {\n $requestData = $request->except('banner_image');\n }\n\n if (Input::hasFile('image')) {\n $file = Input::file('image');\n $pictureName = 'service-'.time();\n Cloudder::upload($file->getPathName(), $pictureName);\n $upload = Cloudder::getResult();\n $requestData['image'] = $upload['url'];\n } else {\n $requestData = $request->except('image');\n }\n\n $service = Service::findOrFail($id);\n $service->update($requestData);\n\n Session::flash('flash_message', 'Service updated!');\n\n return redirect('admin/service-niagaart');\n }" ]
[ "0.6961966", "0.67935413", "0.6491377", "0.64908135", "0.6486933", "0.6486933", "0.6448797", "0.63820636", "0.6318804", "0.61566603", "0.6144687", "0.61257404", "0.6048333", "0.6042516", "0.60043013", "0.5964782", "0.5931426", "0.586561", "0.58325297", "0.58258915", "0.5818258", "0.58092564", "0.5808537", "0.5808537", "0.57955295", "0.57869273", "0.5762812", "0.575038", "0.57483166", "0.57427007", "0.5734882", "0.5723208", "0.57084525", "0.5697309", "0.5663286", "0.56601244", "0.5620985", "0.5620565", "0.5607574", "0.560296", "0.55822194", "0.55816835", "0.5579278", "0.5576003", "0.55331194", "0.5521858", "0.5509343", "0.5491997", "0.548276", "0.54819447", "0.5473158", "0.5466105", "0.54655206", "0.54546875", "0.54489195", "0.544102", "0.5405301", "0.5401812", "0.54015213", "0.53964996", "0.5380127", "0.5371969", "0.5371969", "0.53674245", "0.5358968", "0.5339344", "0.5333521", "0.530344", "0.5302385", "0.5300093", "0.52836615", "0.5281628", "0.5269771", "0.5267213", "0.5253463", "0.524553", "0.52399826", "0.5220183", "0.52046615", "0.52014804", "0.5198412", "0.5195418", "0.51927304", "0.5182682", "0.51758635", "0.5172284", "0.51692903", "0.516164", "0.5150541", "0.514658", "0.5140521", "0.51274127", "0.512133", "0.51165396", "0.5113974", "0.5106416", "0.5106416", "0.510236", "0.509813", "0.5094326" ]
0.57050496
33
Get a Banner by Id
public function getById($id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBanner($id = false){\n if($id === false){\n return $this->findAll();\n }else{\n return $this->getWhere(['banner_id' => $id])->getRowArray();\n }\n }", "public function consultaUnicaPorId($id) {\r\n $sql = \"SELECT * FROM \" . $this->prefixoTabela . \"banners WHERE id = \" . $id;\r\n $resultado = $this->conexao->consultaDB($sql);\r\n \r\n $linha = mysql_fetch_array($resultado);\r\n \r\n $banner = new BannerModelo();\r\n \r\n $banner->setId($linha[\"id\"]);\r\n $banner->setLinkSite($linha[\"link_site\"]);\r\n $banner->setLinkBanner($linha[\"link_banner\"]);\r\n \r\n $this->conexao->desconectar();\r\n return $banner;\r\n }", "public function show($id)\n {\n return $this->bannerService->find($id);\n }", "public function get_banner($id) {\n $this->db->where('banner_id', $id);\n $query = $this->db->get('banners');\n return $query->row_array();\n }", "public static function getBannerById($id)\n {\n $banner = self::with(['items','items.img'])->find($id);\n return $banner;\n// $result=Db::query('select * from banner_item WHERE banner_id=?',[$id]);\n// $result = Db::table('banner_item')->where('banner_id','=',$id)->select();\n //表达式、数组法、闭包\n /*$result = Db::table('banner_item')\n ->where(function($query) use ($id){\n $query->where('banner_id','=',$id);\n })->select();\n return $result;*/\n }", "public function getBanner($id){\n $validate = new IsINT();\n $validate->goCheck();\n\n //get the Banner data by banner ID\n //try{\n $banner = BannerModel::getBannerByID($id);\n// $banner = BannerModel::all(['banner_id'=>$id]);\n// }catch (Exception $ecp){\n// $rtnMsg = [\n// //get the error message\n// 'return_MSG' => 'This is test message!',\n// 'return_Code' => '10001',\n// ];\n// // return the error message\n// //json(array, code)\n// //array => return data\n// // code => Http state code, e.g. 400, 404, 500\n //return json($rtnMsg, 400);\n\n// }\n if($banner){\n //if no exception, return the correct data\n return json($banner,200);\n }else{\n //if have exception, then throw it to exception handler\n throw new NoBannerData();\n //this is GITHUB\n //throw new Exception();\n //return '11111111111';\n }\n // return json($rtnMsg,200);\n\n }", "public function show($id)\n {\n $banners = Banner::find($id);\n return $banners;\n }", "public function getBanner($seriesId);", "public function get_banner_by_id($id){\n //$this->db->select('id,sub_category');\n $query = $this->db->get_where('banner',array('id' => $id));\n return $query->row(); \n }", "public function show($id)\n {\n if($id) {\n $banner = $this->banner->getById($id);\n if($banner) {\n $result = new BannerResource($banner);\n $this->set_success('获取成功')->set_data('banner', $result);\n }else {\n $this->set_error('获取失败');\n }\n }else {\n $this->set_error('缺少参数');\n }\n return response()->json($this->get_result());\n }", "function Get($id = 0)\n\t{\t$this->Reset();\n\t\tif (is_array($id))\n\t\t{\t$this->details = $id;\n\t\t\t$this->id = $id[\"hbid\"];\n\t\t\t$this->AddDetailsForLang($this->language);\n\t\t} else\n\t\t{\tif ($result = $this->db->Query(\"SELECT * FROM homebanner WHERE hbid=\" . (int)$id))\n\t\t\t{\tif ($row = $this->db->FetchArray($result))\n\t\t\t\t{\t$this->Get($row);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public function selectById($id, $pdo) {\r\n $dbId = mysql_real_escape_string($id);\r\n $sql = \"SELECT banners.banner_id, banners.name, banners.width, banners.height, banners.display, banners.banner_body, urls.page_address\r\n FROM banners\r\n JOIN banner_url ON banner_url.id_banner = banners.banner_id\r\n JOIN urls ON urls.url_id = banner_url.id_url\r\n WHERE banners.banner_id = ?\";\r\n\r\n $q = $pdo->prepare($sql);\r\n try {\r\n $q->execute(array($dbId));\r\n } catch (PDOException $e) {\r\n echo 'select by id failed. ' . $e->getMessage();\r\n }\r\n\r\n return $q->fetch(PDO::FETCH_OBJ);\t\t\r\n }", "public function getBannerNameById($id)\n {\n $adapter = $this->getConnection();\n $select = $adapter->select()\n ->from($this->getMainTable(), 'name')\n ->where('banner_id = :banner_id');\n $binds = ['banner_id' => (int)$id];\n return $adapter->fetchOne($select, $binds);\n }", "public function getById($bannerId)\n {\n $banner = $this->bannerFactory->create();\n $this->resource->load($banner, $bannerId);\n if (!$banner->getId()) {\n throw new NoSuchEntityException(__('The banner with the \"%1\" ID doesn\\'t exist.', $bannerId));\n }\n return $banner;\n }", "public function get(string $id);", "public function getById( $id );", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function get($id);", "public function getBanner() {\n\t\t$ls = DBModel::getByFields('cernet_contest');\n\t\treturn $ls[0]['h_banner'];\n\t}", "public function byId($id);", "public function byId($id);", "public function byId($id);", "public function byId($id);", "public function get( $id );", "static function getTrans($id)\n {\n return BannerTrans::where('banner_id', $id)->get();\n }", "public function get( $id ){}", "public function getById(string $id);", "public function byId($id)\n {\n return $this->cottage //->with('images', 'areas', 'features')\n ->find($id);\n }", "public function getById(int $id);", "protected function findModel($id)\n {\n if (($model = Banner::find()->where(['slug' => $id])->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested banner does not exist.');\n }\n }", "abstract public function getById($id);", "abstract public function getById($id);", "abstract public function get($id);", "abstract public function get($id);", "abstract public function get($id);", "public function GetById($id);", "public function GetById($id);", "public function show($id)\n {\n $banner = DB::SELECT('SELECT fb.`Formato`,b.`imagen`,fb.`Ancho`,fb.`Alto`,b.`id`\n FROM formatoBanner AS fb \n INNER JOIN banner AS b ON b.`id_formato`=fb.`id`\n WHERE fb.`id`='.$id.'');\n if (count($banner) > 0) {\n $nameBanner = $banner[0]->Formato;\n }else{ \n $try = DB::SELECT('SELECT fb.`Formato` FROM formatoBanner AS fb WHERE fb.`id`='.$id.''); \n $banner = 'error'; \n $nameBanner = $try[0]->Formato;\n }\n return view('Banners/showBanner',compact('banner','nameBanner')); \n }", "public function getBanner()\n {\n return $this->banner;\n }", "function getBanner()\n {\n return $this->banner;\n }", "public function getById() {}", "function getPageBanners($id) {\n $this->db->select(\"*\");\n $this->db->where(\"pageID\", $id);\n $this->db->order_by(\"slideOrder ASC\");\n \t$query = $this->db->get('banner');\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return array();\n }", "public function getBillet($id){\n $db = $this -> init();\n \n $request = $db -> prepare('SELECT * from posts where id = ?') or die(print_r($db->errorInfo()));\n $request -> execute(array($id));\n $billet = $request -> fetch();\n return $billet;\n }", "public abstract function getById($id);", "public function get_ads_byID($id, $adid){\n $sql = \"select *,(select Images from advertisement_image where AdsID=advertisement.ID and StatusID <>3 limit 1) as image from advertisement where UserID=? and ID=? and StatusID <>3\";\n $data = $this->db->query($sql, array($id,$adid));\n return $data->row();\n }", "public abstract function get($id);", "public function show($id)\n {\n $banners = Slogan::find($id);\n if ($banners){\n return $this->sendSuccess($banners);\n }\n return $this->sendFail(\"获取失败!\");\n }", "public function get( $iId );", "public function get_ad_byID($id) {\n $sql = \"select * from advertisement where ID=? and StatusID <>3\";\n $data = $this->db->query($sql, array($id));\n return $data->row();\n }", "public function getEditBanner($id)\n {\n\n $BannerModel = new Banner();\n $Banner = $BannerModel->getBannerById($id);\n\n if ($Banner) {\n $this->data['news'] = $Banner;\n return view('admin.banner_edit', $this->data);\n } else {\n return redirect()->route('adgetListBanner');\n }\n\n }", "public function byId($id)\n\t{\n\t\treturn $this->find('id', $id)->first();\n\t}", "public function getOne($id) {\n\n }", "public function getBrandById($id);", "public function get($id) {\n\t}", "public function getById($id) {\n return $this->getBy(id, \"id\");\n }", "public function get($name) {\n\t\tif(isset($name) && strlen($name) >= 1) {\n\t\t\t$banner = $this -> Banner -> findByName($name);\n\t\t\treturn $banner['Banner']['content'];\n\t\t} else {\n\t\t\treturn array();\n\t\t}\n\t}", "public function getById($id)\n {\n }", "public function getById($id)\n {\n }", "public function get($id)\n {\n }", "public function get($id)\n {\n }", "function get(string $id);", "public function get($id) {\r\n\treturn $this->getRepository()->find($id);\r\n }", "public function get_one($id)\n {\n }", "public function loadbanner(){\n\t\t$query=$this->db->get('tbl_banner');\n\t\treturn $query->result();\n\t}", "public function getBanner(Request $request)\n {\n $data = [];\n\n $position = $request->get('position', 'top');\n\n if ($request->get('page_id')) {\n $page_id = $request->get('page_id');\n $page_type = $request->get('type', 'page');\n $data = Banner::getByPageId($page_id, $page_type, $position)->betweenDate()->get();\n }\n\n $settingsName = $position . '_sizes';\n $settings = Cache::remember(\n $settingsName,\n now()->addDay(),\n function () use ($settingsName) {\n return BannerSettings::where('name', $settingsName)->first();\n }\n );\n $additional = [];\n if ($settings) {\n $additional = [\n 'carousel_settings' => [\n 'interval' => $settings->data['interval'] ?? 3000,\n 'indicators' => $settings->data['indicators'] ?? true,\n 'nav' => $settings->data['nav'] ?? true,\n ]\n ];\n }\n return BannerResource::collection($data)->additional($additional);\n }", "public function get($Id)\n {\n }", "public function byId($id)\n {\n return $this->cache->tags('image')->rememberForever('image.byId.'.$id, function () use ($id) {\n return $this->BanksRepository->byId($id);\n });\n }", "public function get($id){\n }" ]
[ "0.7575038", "0.75157756", "0.7497893", "0.7490877", "0.74429935", "0.74218374", "0.73325104", "0.715337", "0.711524", "0.70594966", "0.6856317", "0.6668583", "0.65766543", "0.6449319", "0.6440086", "0.6427638", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64178765", "0.64129555", "0.6386767", "0.6386767", "0.6386767", "0.6386767", "0.6374237", "0.63426715", "0.63421696", "0.63060564", "0.6262409", "0.625455", "0.62463987", "0.62336266", "0.62336266", "0.6212953", "0.6212953", "0.6212953", "0.6184487", "0.6184487", "0.6172058", "0.616859", "0.61628807", "0.6154409", "0.61513066", "0.6150995", "0.6149834", "0.6144095", "0.6143542", "0.6137188", "0.6132574", "0.6122099", "0.6101848", "0.6098805", "0.6091262", "0.60605496", "0.60595423", "0.6055252", "0.60514843", "0.60414284", "0.60414284", "0.60313284", "0.60313284", "0.60203123", "0.60154897", "0.5998528", "0.5988637", "0.5972332", "0.59634835", "0.5954941", "0.594948" ]
0.63994116
49
Retrieve Banners which match a specified criteria.
public function getList(SearchCriteriaInterface $criteria);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBanners($perPage = 20, array $filter = array(), array $sort = array(), $paginate = true);", "public function get_allBanners($where_banner)\t\n\t{\n\t\t$query = $this->db->get_where('announcement',$where_banner);\n\n\t\t$result = $query->result_array();\n\n\t\tif(!empty($result))\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t}", "public function getBanners()\n {\n $rows = $this->iaDb->all(iaDb::ALL_COLUMNS_SELECTION, \"`status` = 'active'\", null, null, self::getTable());\n\n if (is_array($rows) && $rows) {\n $banners = [];\n foreach ($rows as $entry) {\n $banners[$entry['position']][] = $entry;\n }\n\n return $banners;\n }\n\n return false;\n }", "function getBanners($page,$position,$image_banner,$BannerDisplayed){\r\n\r\n\t\t\t$sql = \"select * from banner where Status='1' \";\r\n\r\n\t\t\t$sql.= (!empty($page))?(\" and ShowOn like '%\".$page.\"%'\"):(\"\");\r\n\r\n\t\t\t$sql.= (!empty($position))?(\" and position = '\".$position.\"'\"):(\"\");\r\n\r\n\t\t\t$sql.= ($image_banner==1)?(\" and ( Image like '%jpg%' or Image like '%gif%')\"):(\"\");\r\n\r\n\t\t\t$sql.= (!empty($BannerDisplayed))?(\" and BannerID != '\".$BannerDisplayed.\"'\"):(\"\");\r\n\r\n\t\t\t$sql.= \" order by rand() \";\r\n\r\n\t\t\t $sql.= \" limit 0,1 \"; \r\n\t\t\t//$sql.= (!empty($BannerLimit))?(\" limit 0,\".$BannerLimit.\"\"):(\"\");\r\n\r\n\t\t\t//echo $sql;\r\n\t\t\treturn $this->query($sql, 1);\r\n\t\t}", "public function getBannersArhived($searchText = NULL) {\n return $this->where('archive', 1)\n ->orderBy('id', 'DESC')\n ->paginate(10);\n }", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria)\n {\n /** @var \\Mage2\\Banners\\Model\\ResourceModel\\Banner\\Collection $collection */\n $collection = $this->bannerCollectionFactory->create();\n $collection->load();\n\n /** @var Data\\BannerSearchResultsInterface $searchResults */\n $searchResults = $this->searchResultsFactory->create();\n $searchResults->setSearchCriteria($searchCriteria);\n $searchResults->setItems($collection->getItems());\n $searchResults->setTotalCount($collection->getSize());\n return $searchResults;\n }", "public function getBannersByDimensions() {\n\n try {\n $result = Banner::getBannersByDimensions($_GET);\n return $result;\n } catch (Exception $e) {\n throw new RestException($e->getCode(), $e->getMessage());\n }\n }", "public static function GetBanners()\n\t{\n\t\t$output = '';\n\t\t\n\t\t$sql = 'SELECT\n\t\t\t\t\tb.id, b.image_file, b.link_url, b.priority_order,\n\t\t\t\t\tbd.image_text\n\t\t\t\tFROM '.TABLE_BANNERS.' b\n\t\t\t\t\tLEFT OUTER JOIN '.TABLE_BANNERS_DESCRIPTION.' bd ON b.id = bd.banner_id\n\t\t\t\tWHERE b.is_active = 1 AND b.image_file != \\'\\' AND bd.language_id = \\''.encode_text(Application::Get('lang')).'\\' \n\t\t\t\tORDER BY RAND() ASC';\n\t\t$result = database_query($sql, DATA_AND_ROWS, FIRST_ROW_ONLY);\n\t\tif($result[1] > 0){\n\t\t\t$image = '<img src=\"'.APPHP_BASE.'images/banners/'.$result[0]['image_file'].'\" width=\"723px\" height=\"140px\" alt=\"banner\" />';\t\n\t\t\tif($result[0]['link_url'] != '' && $result[0]['link_url'] != 'http://'){\n\t\t\t\t$output .= '<a href=\"'.$result[0]['link_url'].'\" title=\"'.$result[0]['image_text'].'\">'.$image.'</a>';\n\t\t\t}else{\n\t\t\t\t$output .= $image;\n\t\t\t}\t\t\t\n\t\t}\n\t return $output;\n\t}", "public function getBy(array $criteria);", "public function getBanners() {\n\n try {\n\n $result = Banner::getAllBanners();\n return $result;\n } catch (Exception $e) {\n throw new RestException($e->getCode(), $e->getMessage());\n }\n }", "public function fetch(array $criteria)\n {\n array_walk($criteria['filters'], function (&$item) {\n $item = $item['value'];\n });\n\n $query = array_merge(\n array(\n 'location' => $criteria['location'],\n 'f' => $criteria['f'],\n 'q' => $criteria['q']\n ),\n $criteria['filters']\n );\n\n $query = array_filter($query);\n\n $request = $this->guzzle->get(sprintf('/%s/offres/%s/%s', $criteria['category'], $criteria['region'], (isset($criteria['department']) ? $criteria['department'].'/' : '')), null, array(\n 'query' => $query\n ));\n\n $this->requestUrl = $request->getUrl();\n\n $response = $request->send();\n $crawler = new Crawler((string) $response->getBody());\n\n $bids = $crawler->filter('.list-lbc > a')->each(function ($node, $i) {\n return $this->processBid($node);\n });\n\n return $bids;\n }", "public function index()\n {\n \n if(isset( $_GET['search']) && $_GET['search']!='' ){\n $searched= $_GET['search'];\n $banners=Banner::where('content', 'like',\"%{$searched}%\")\n ->latest()->paginate(2);\n \n }else{\n $banners=Banner::latest()->paginate(2);\n\n }\n return BannerResource::collection($banners);\n }", "function _nbabanner_get_banners($randomise = false)\n{\n $banners = nbacontent_get_vocabulary('nbabanner', true);\n \n $filteredBanners = array_filter($banners, function($ele) {\n return $ele->nbabanner_link_live['und'][0]['value'] == 1;\n });\n \n if ($randomise === true) {\n shuffle($filteredBanners);\n }\n \n return $filteredBanners;\n}", "public function getBans(User_Model_Row_Account $account, $filter = null) {\n\t\t\n\t}", "function findBooksWithParams($condition, $param){\n\t$sql = \"SELECT * FROM book WHERE $condition LIKE '%$param%'\";\n\t\t\n\t\t$stmt = $this -> db->prepare($sql);\n\t\t\n\t\t$stmt -> execute();\n\t\t\n\t\t$books = array();\n\t\t\n\t\twhile($row = $stmt->fetchObject()){\n\t\t\t$book=new Book();\n\t\t\t$book->setId($row->id);\n\t\t\t$book->setAuthor($row->author);\n\t\t\t$book->setTitle($row->title);\n\t\t\t$book->setGenre($row->genre);\n\t\t\t$book->setContactEmail($row->contactemail);\n\t\t\t$book->setPublicationDate($row->publicationdate);\n\t\t\t$book->setSynopsis($row->synopsis);\n\t\t\t\n\t\t\t$books[] = $book;\n\t\t}\n\t\t$this->counter = $stmt->rowCount();\n\t\treturn $books;\n\t\t\n\t}", "public function getBrandRetailerWithBannerList($position = 0) {\n if ($position == 0) {\n $query = $this->getEntityManager()\n ->createQuery(\"\n SELECT b.id as brand_id,b.name as brand_name,b.image as brand_image\n FROM LoveThatFitAdminBundle:Brand b\n WHERE b.disabled=0 and b.screen_position = :screen_position\")\n ->setParameters(array('screen_position' => $position));\n try {\n return $query->getResult();\n } catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n }\n } else {\n\n $query = $this->getEntityManager()\n ->createQuery(\"\n SELECT b.id as brand_id,b.name as brand_name,b.top_banner_image as brand_image\n FROM LoveThatFitAdminBundle:Brand b\n WHERE b.disabled=0 and b.screen_position = :screen_position\")\n ->setParameters(array('screen_position' => $position));\n try {\n return $query->getResult();\n } catch (\\Doctrine\\ORM\\NoResultException $e) {\n return null;\n }\n }\n }", "public function findDemanded(BannerDemand $demand)\n {\n /* Override the default sorting for random mode. Must be called before\n createQuery() */\n if ($demand->getDisplayMode() == 'allRandom') {\n $this->defaultOrderings = [];\n }\n\n $query = $this->createQuery();\n\n $constraints = [];\n\n if ($demand->getStartingPoint() != 0) {\n $pidList = GeneralUtility::intExplode(',', $demand->getStartingPoint(), true);\n $constraints[] = $query->in('pid', $pidList);\n }\n\n if ($demand->getCategories() != 0) {\n $categoryConstraints = [];\n $categories = GeneralUtility::intExplode(',', $demand->getCategories(), true);\n foreach ($categories as $category) {\n $categoryConstraints[] = $query->contains('category', $category);\n }\n if (count($categoryConstraints) > 0) {\n $constraints[] = $query->logicalOr($categoryConstraints);\n }\n }\n $query->matching($query->logicalAnd($constraints));\n\n /* Get banners without respect to limitations */\n $unfilteredResult = $query->execute();\n if ($unfilteredResult->count() > 0) {\n $finalQuery = $this->getQueryWithLimitation($unfilteredResult, $demand);\n $result = $this->getResult($finalQuery, $demand);\n } else {\n $result = $unfilteredResult;\n }\n return $result;\n }", "public function getBorrowings();", "public function get_banners($offset = 0, $limit = LIST_LIMIT) {\n $this->db->limit($limit, $offset);\n $query = $this->db->get('banners');\n return $query->result_array();\n }", "public abstract function findHolderBy(array $criteria);", "public function findBy(array $criteria);", "public function findBy($criteria);", "public function findBy($criteria);", "public function matching(Criteria $criteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $criteria)\n {\n /** @var \\Baguette\\Bakery\\Model\\ResourceModel\\Bakery\\Collection $collection */\n $collection = $this->bakeryCollectionFactory->create();\n\n /** @var Data\\BakerySearchResultsInterface $searchResults */\n $searchResults = $this->searchResultsFactory->create();\n $searchResults->setSearchCriteria($criteria);\n $searchResults->setItems($collection->getItems());\n $searchResults->setTotalCount($collection->getSize());\n\n return $searchResults;\n }", "function getPageBanners($id) {\n $this->db->select(\"*\");\n $this->db->where(\"pageID\", $id);\n $this->db->order_by(\"slideOrder ASC\");\n \t$query = $this->db->get('banner');\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return array();\n }", "public function get_search()\n\t\t{\n\t\t\t$retArr = null;\n\t\t\tforeach($this->obj as $obj)\n\t\t\t{\n\t\t\t\t$retArr[] = $obj->getBasics($this->response_profile);\n\t\t\t}\n\t\t\treturn $retArr;\n\t\t}", "public function find(array $conditions = []);", "public function findMediaBy(array $criteria);", "public function banners()\n {\n $banners = DB::table('banners')->latest('created_at')->limit(5)->get();\n\n return response()->json($banners);\n }", "public function buscarBancos() {\r\n return $this->find(\"b_estatus = 'activa'\");\r\n }", "public function index(Request $request)\n {\n $banners = Banner::latest()->filter($request->all())->paginate($request->get('per_page', 20));\n\n return BannerResource::collection($banners);\n }", "abstract public function findBy($criteria);", "public function getCriteria();", "public function getBanner($id = false){\n if($id === false){\n return $this->findAll();\n }else{\n return $this->getWhere(['banner_id' => $id])->getRowArray();\n }\n }", "public function find(array $criteria);", "public function getBannersByPeriod($dateStart, $dateEnd)\n {\n $parameters = [\n 'dateBegin' => date('Y-m-d H:i:s', (int) $dateStart),\n 'dateEnd' => date('Y-m-d H:i:s', (int) $dateEnd)\n ];\n\n return (array) $this->apiClient->doCall('getBannersByPeriod', $parameters);\n }", "public function Search($criteria);", "protected function getBannerItems()\n {\n $self = $this;\n\n return Cache::remember(\n 'home_banner_items',\n config('kosher.cache_expiration_time'),\n function () use ($self) {\n $recipes = Recipe::banner()->with('categories')->get();\n $articles = Article::banner()->published()->with('category')->get();\n $shows = Show::banner()->get();\n\n $banner = $recipes->merge($articles)\n ->merge($shows)\n ->shuffle()\n ->take(config('kosher.pagination.home_banner_items'));\n\n if (0 == $banner->count()) {\n $recipes = Recipe::featured()->with('categories')->get();\n $articles = Article::featured()->published()->with('category')->get();\n $shows = Show::featured()->get();\n\n $banner = $recipes->merge($articles)\n ->merge($shows)\n ->shuffle()\n ->take(config('kosher.pagination.home_banner_items'));\n }\n\n if (0 == $banner->count()) {\n $banner = Recipe::published()\n ->with('categories')\n ->take(config('kosher.pagination.home_banner_items'))\n ->get();\n $self->mergeReceivedRecipes($banner);\n } else {\n $recipes = collect();\n foreach ($banner as $item) {\n if ($item->isRecipe()) {\n $recipes->push($item);\n }\n }\n $self->mergeReceivedRecipes($recipes);\n }\n\n return $banner;\n }\n );\n }", "function _paginate_leads($criteria) {\n\t\t$order='desc';\n\t\t$page='5';\t\t\n\t\tlist($order,$limit,$page) = $this->Pagination->init($criteria);\n\t\t$leads = $this->Advertisement->findAll($criteria, NULL, $order, $limit, $page);\t\n\t\treturn $leads;\n\t}", "public function match(array $conditions);", "public function scan()\n {\n // If no interface is provided we will scan all.\n $command = $this->interface ? sprintf(\n 'arp-scan --interface=%s -l',\n $this->interface\n ) : 'arp-scan -l';\n\n $arp_scan = shell_exec(\n $command\n\n );\n $arp_scan = explode(\"\\n\", $arp_scan);\n\n $matches = $records = [];\n foreach ($arp_scan as $scan) {\n $matches = [];\n\n // Matching the arp-scan output\n if (preg_match(\n '/^([0-9\\.]+)[[:space:]]+([0-9a-f:]+)[[:space:]]+(.+)$/',\n $scan,\n $matches\n ) !== 1\n ) {\n continue;\n }\n\n $record = new ScanRecord();\n $record->ip = $matches[1];\n $record->mac = $matches[2];\n $record->description = $matches[3];\n\n $records[] = $record;\n }\n\n return $records;\n }", "public function getItemsCriteria() {}", "public function getItemsCriteria() {}", "public function show($id)\n {\n $banners = Banner::find($id);\n return $banners;\n }", "function get_criteria($criteria, $user_statuses = array(), $number = 0,\n $first = 0) {\n\n $selector = $this->__criteria_selector_ids($criteria,\n $user_statuses,\n $number,\n $first);\n\n return $this->__do_get('AdGroupCriterionService', $selector);\n\n}", "function getbanners()\n\t\t{\n\t\t\t$banners = $this->manage_content->getValue('banner_info','*');\n\t\t\techo '<div id=\"add_space\">';\n\t\t\tforeach($banners as $banner)\n\t\t\t{\n\t\t\t\tif($banner['banner_status'] == 1)\n\t\t\t\t{\n\t\t\t\t\techo '<a href=\"'.$banner['banner_link'].'\">';\n\t\t\t\t\techo '<div class=\"add_section\"><img src=\"images/'.$banner['banner_image'].'\" style=\"height:'.$banner['banner_height'].'px;width:'.$banner['banner_width'].'px;float:left;\"/></div></a>';\n\t\t\t\t}\n\t\t\t}\n\t\t\techo '</div>';\n\t\t}", "public function findPostcardsBy(array $criteria)\n\t{\n\t\treturn $this->repository->findBy($criteria);\n\t}", "public function getRelatedBannersByRule($ruleId)\n {\n return $this->bannerFactory->create()->getRelatedBannersByCatalogRuleId($ruleId);\n }", "private function getFilteredCarers($criteria) {\n //always on\n $active = true;\n $nationality = 'all';\n\n //dynamic\n $personGender = $criteria['person_gender'];\n if ($personGender == Constants::GENDER_FEMALE) {\n $workWithMale = false;\n $workWithFemale = true;\n } else {\n $workWithMale = true;\n $workWithFemale = false;\n }\n\n //default value if not saved before in DB\n if (!isset($criteria['showMale'])) {\n $criteria['showMale'] = false;\n }\n if (!isset($criteria['showFemale'])) {\n $criteria['showFemale'] = false;\n }\n if (!isset($criteria['type_care']) || $criteria['type_care'] == \"\") {\n $criteria['type_care'] = Constants::HOURLY;\n }\n\n $showMale = $criteria['showMale'];\n $showFemale = $criteria['showFemale'];\n\n $physicalId = $criteria['physical_condition'];\n $mentalId = $criteria['mental_condition'];\n $ageGroupId = $criteria['age_group'];\n\n if ($criteria['type_care'] == Constants::HOURLY) {\n $hourly = true;\n $liveIn = false;\n } else {\n $hourly = false;\n $liveIn = true;\n }\n\n $activities = array();\n foreach ($criteria as $key => $value) {\n\n if (Util::startsWith($key, 'activities_')) {\n\n $val = Util::lastCharactersAfter($key, 'activities_condition_');\n $activities[] = $val;\n }\n }\n\n $model = Condition::loadModel($physicalId);\n $physicals = $model->getConditionsIdsUp();\n\n $model = Condition::loadModel($mentalId);\n $mentals = $model->getConditionsIdsUp();\n\n $ageGroup = array($ageGroupId);\n\n $postCodeRaw = $criteria['postCode'];\n $postCode = strip_tags(trim(strtoupper($postCodeRaw)));\n if (empty($postCode)) {\n $postCode = null;\n }\n\n $language = 'english';\n\n $carers = DBServices::getFilteredCarers2($activities, $physicals, $mentals, $ageGroup, $active, $workWithMale, $workWithFemale, $nationality, $liveIn, $hourly, $showMale, $showFemale, $postCode, $language);\n\n return $carers;\n }", "public function get($conditions, $opts=[]){\n return $this->queryset($opts)->get($conditions);\n }", "public function findLikeBy(array $conditions, array $orderBy = null, $limit = null, $offset = null): array;", "public static function searchResults($request)\n {\n $shortId = $request->shortId ?? '';\n $fullName = $request->fullName ?? '';\n $lastName = $request->lastName ?? '';\n $firstName = $request->firstName ?? '';\n $association = $request->association ?? '';\n $officeShortId = $request->officeShortId ?? '';\n // Sometimes the full name isn't in the database, so we'll fake one using the request and then check the\n // first_name and last_name fields against it.\n $derivedFullName = $fullName != null ? explode(' ', $fullName) : ''; // Array(['First', 'Last'])\n\n\n $agents = Agent::when($shortId, function ($query) use ($shortId) {\n return $query->where('short_id', $shortId);\n })\n ->when($lastName, function ($query) use ($lastName) {\n return $query->where('last_name', $lastName);\n })\n ->when($firstName, function ($query) use ($firstName) {\n return $query->where('first_name', $firstName);\n })\n ->when($association, function ($query) use ($association) {\n return $query->where('association', $association);\n })\n ->when($officeShortId, function ($query) use ($officeShortId) {\n return $query->where('office_short_id', $officeShortId);\n })\n ->when($fullName, function ($query) use ($fullName, $derivedFullName) {\n return $query->whereRaw(\n \"((full_name LIKE '{$fullName}') OR (first_name LIKE '{$derivedFullName[0]}' AND last_name LIKE '{$derivedFullName[1]}'))\"\n );\n })\n ->with('photos')\n ->orderBy('last_name', 'ASC')\n ->orderBy('date_modified', 'DESC')\n ->paginate(36);\n\n // returns paginated links (with GET variables intact!)\n $agents->appends($request->all())->links();\n\n return $agents;\n }", "public function getBanners(Request $request)\n {\n\t\t$user = null;\n\t\t$nope = false;\n\t\t$v = \"\";\n\t\t\n\t\t$signals = $this->helpers->signals;\n\t\t$plugins = $this->helpers->getPlugins();\n\t\t\n\t\t#$this->helpers->populateTips();\n $cpt = ['user','signals','plugins'];\n\t\t\t\t\n\t\tif(Auth::check())\n\t\t{\n\t\t\t\n\t\t\t$user = Auth::user();\n\t\t\t\n\t\t\tif($this->helpers->isAdmin($user))\n\t\t\t{\n\t\t\t\t$hasPermission = $this->helpers->hasPermission($user->id,['view_banners']);\n\t\t\t\t#dd($hasPermission);\n\t\t\t\t$req = $request->all();\n\t\t\t\t\n\t\t\t\tif($hasPermission)\n\t\t\t\t{\n\t\t\t\t $v = \"banners\";\n\t\t\t\t $banners = $this->helpers->getBanners();\n\t\t\t\t #dd($banners);\n\t\t\t\t array_push($cpt,'banners');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tsession()->flash(\"permissions-status-error\",\"ok\");\n\t\t\t\t\treturn redirect()->intended('/');\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tAuth::logout();\n\t\t\t\t$u = url('/');\n\t\t\t\treturn redirect()->intended($u);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$v = \"login\";\n\t\t}\n\t\treturn view($v,compact($cpt));\n }", "function get($search) {\r\n\t\tglobal $wpdb;\r\n\t\t$conds = array(); \r\n\t\tforeach($search as $key => $value) {\r\n\t\t\tif( array_key_exists($key, $this->fields) ){\r\n\t\t\t\t$value = $wpdb->escape($value);\r\n\t\t\t\t$conds[] = \"`$key`='$value'\";\r\n\t\t\t} \r\n\t\t}\r\n\t\t$sql = \"SELECT * FROM \". $wpdb->EM_BOOKINGS_TABLE .\" WHERE \" . implode(' AND ', $conds) ;\r\n\t\t$result = $wpdb->get_row($sql, ARRAY_A);\r\n\t\tif($result){\r\n\t\t\t$this->to_object($result);\r\n\t\t\treturn true;\t\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function findmatches($type, $options, $userClass, $limit = false)\r\n\t{\r\n\t\t\r\n\t\t$matches = new Application_Model_Matches();\r\n\t\tif ($type == 'games') {\r\n\t\t\t// Looking for games\r\n\t\t\t$games = new Application_Model_Games();\r\n\t\t\t$games->findGames($options, $userClass, $limit);\r\n\t\t\t$matches->addMatches($games->getAll());\r\n\t\t\t$matches->totalRows = $games->totalRows;\r\n\t\t} elseif ($type == 'teams') {\r\n\t\t\t$teams = new Application_Model_Teams();\r\n\t\t\t$teams->findTeams($options, $userClass, $limit);\r\n\t\t\t$matches->addMatches($teams->getAll());\r\n\t\t\t$matches->totalRows = $teams->totalRows;\r\n\t\t} elseif ($type == 'players') {\r\n\t\t\t$players = new Application_Model_Users();\r\n\t\t\t$players->findUsers($options, $userClass, $limit);\r\n\t\t\t$matches->addMatches($players->getAll());\r\n\t\t\t$matches->totalRows = $players->totalRows;\r\n\t\t} elseif ($type == 'parks') {\r\n\t\t\t$parks = new Application_Model_Parks();\r\n\t\t\t$parks->findParks($options, $userClass, $limit);\r\n\t\t\t$matches->addMatches($parks->getAll());\r\n\t\t\t$matches->totalRows = $parks->totalRows;\r\n\t\t}\r\n\t\t\r\n\t\treturn $matches;\r\n\t\t\r\n\t}", "public function find(\n\t\t$_criteria=NULL,\n\t\t$_order=NULL,\n\t\t$_limit=NULL,\n\t\t$_ttl=0) {\n\t\t\treturn $this->lookup('*',$_criteria,NULL,$_order,$_limit,$_ttl);\n\t}", "public function getList(SearchCriteriaInterface $searchCriteria): DonationSearchResultsInterface;", "public function businessBanners()\n {\n $pageTitle = \"Business Banners | WeAfrican\";\n $businessBanners = BusinessBanner::where('user_id', Auth::id())->get();\n return view('my-account.business', compact('pageTitle','businessBanners'));\n }", "public function findWhere(array $conditions);", "public function search()\n\t{\n\t\t// Warning: Please modify the following code to remove attributes that\n\t\t// should not be searched.\n\n\t\t$criteria=new CDbCriteria;\n\n\t\t$criteria->compare('banner_id',$this->banner_id,true);\n\t\t$criteria->compare('banner_name',$this->banner_name,true);\n\t\t$criteria->compare('channel_id',$this->channel_id,true);\n\t\t$criteria->compare('agent_id',$this->agent_id);\n\t\t$criteria->compare('banner_width',$this->banner_width);\n\t\t$criteria->compare('banner_height',$this->banner_height);\n\t\t$criteria->compare('ad_inputs',$this->ad_inputs,true);\n\t\t$criteria->compare('up_time',$this->up_time,true);\n\t\t$criteria->compare('jurl_id',$this->jurl_id,true);\n\t\t$criteria->compare('enabled',$this->enabled);\n\t\t$criteria->compare('area',$this->area,true);\n\t\t$criteria->compare('content',$this->content,true);\n\t\t$criteria->compare('service_type',$this->service_type,true);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t));\n\t}", "public function getPlansBySearch(string $toSearch){\n $this->open();\n\n $result = $this->query('SELECT * FROM '.$this->TABLE_NAME.' WHERE name LIKE :name', array(\n new QueryParam(':name', '%'.$toSearch.'%'),\n ));\n\n // Close connection\n $this->close();\n\n // Check if is found\n if($result->rowCount() > 0){\n\n $plans = array();\n\n // Check result\n while($row = $result->fetch(PDO::FETCH_OBJ)){\n $foundPlan = new Plan(\n $row->id,\n $row->name,\n $row->price,\n $row->detail,\n $row->docsUrl\n );\n\n array_push($plans, $foundPlan);\n }\n\n return $plans;\n\n }\n else{\n // It isn't found so return false\n return array();\n }\n\n }", "public function getPromotionalbanners(Request $request)\n\t{\n\t\t$params = $request->all();\n\n\t\t$user = Auth::user('user');\n\t\t$status = $user?2:1;\n\t\t$promotionalbanners = PromotionalBanners::where('status', '!=', $status)->orderBy('displayorder', 'asc')->get();\n\t\t\n\t\treturn response($promotionalbanners);\n\t}", "public function getListing(){\n $BusInfo = $this->BusinessOwnerModel->getBusinessID();\n \n foreach($BusInfo as $row1){\n $busID = $row1->bid;\n }\n \n $query = $this->db->get_where('BusinessListing', array('bid' => $busID));\n \n if($query->num_rows() > 0){\n foreach($query->result() as $row){\n $data[] = $row;\n }\n return $data;\n }\n return false;\n }", "public function findContactsBy(array $criteria);", "public function getSearchResults($moderation_states = null,$limit=null)\n {\n $items = array();\n\n\n try {\n\n $db = DB::get();\n \n if(!is_null($limit))\n $limit_clause = ' LIMIT '.$limit;\n \n $query = ' SELECT * \n\t\t\t\t\t FROM t_assurance\n\t\t\t\t\t WHERE assurance_supprime=\\'0\\'';\n \n if (!is_null($moderation_states))\n $query .= $moderation_states;\n \n $query .= ' ORDER BY assurance_id DESC '.$limit_clause;\n \n \n \n \n $result = $db->query($query);\n\n while ($row = $db->fetch_assoc($result)) {\n $items[] = new Assurance($row['assurance_id']);\n }\n $this->setItems($items);\n return $items;\n\n }\n catch (exception $e) {\n //echo $e->getMessage();\n }\n\n\n }", "function paginationConditions() {\n // Only retrieve attributes in the current match server\n \n $ret = array();\n \n $ret['conditions']['MatchServerAttribute.match_server_id'] = $this->request->params['named']['matchserver'];\n \n return $ret;\n }", "public abstract function getCriteriaFrom($criteria);", "static function getGroupBookingsReport() {\n global $wpdb;\n $resultset = $wpdb->get_results($wpdb->prepare(\n \"SELECT reservation_id, guest_name, booking_reference, booking_source, checkin_date, checkout_date, \n booked_date, payment_outstanding, num_guests, data_href, notes, viewed_yn \n FROM wp_lh_group_bookings\n WHERE job_id IN (SELECT CAST(value AS UNSIGNED) FROM wp_lh_job_param WHERE name = 'allocation_scraper_job_id' AND job_id = (SELECT MAX(job_id) FROM wp_lh_jobs WHERE classname = 'com.macbackpackers.jobs.GroupBookingsReportJob' AND status = 'completed'))\n AND ( num_guests >= %d \" .\n (get_option('hbo_include_5_guests_in_6bed_dorm') == 'true' ? ' OR num_guests = 5' : '' ) . \"\n )\n ORDER BY checkin_date\", get_option('hbo_group_booking_size')));\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n\n return $resultset;\n }", "public function findBy(array $filters);", "private static function _searchImages($criteria){\n\n $db = \\PhotoLibrary\\Shortcuts::getDatabase();\n\n $rows = $db->getImages($criteria);\n\n if (is_null($rows)){\n return null;\n }\n\n $withId = (isset($criteria['withId']) && $criteria['withId'] == true);\n $imageArray = array_map(function($row) use ($withId) {\n return ImageSearch::_buildImageObject($row, $withId);\n }, $rows\n );\n\n return $imageArray;\n }", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function getList(\\Magento\\Framework\\Api\\SearchCriteriaInterface $searchCriteria);", "public function search() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$arrSearchResults = array ();\r\n\r\n\t\t\tparent::initSearch ();\r\n\r\n\t\t\t$stmt = $ks_db->query ( $this->searchSQL, $this->searchBinding );\r\n\r\n\t\t\t//record is found, associate columns to the object properties\r\n\t\t\twhile ( true == ($row = $stmt->fetch ()) ) {\r\n\r\n\t\t\t\t$objResult = new KS_Dashboard ( );\r\n\r\n\t\t\t\t$objResult->id = $row ['dsh_id'];\r\n\t\t\t\t$objResult->title = $row ['dsh_title'];\r\n\t\t\t\t$objResult->desc = $row ['dsh_desc'];\r\n\t\t\t\t$objResult->portlet = $row ['dsh_portlet'];\r\n\t\t\t\t$objResult->hide = $row ['dsh_hide'];\r\n\t\t\t\t$objResult->createdBy = $row ['dsh_created_by'];\r\n\t\t\t\t$objResult->modifiedBy = $row ['dsh_modified_by'];\r\n\t\t\t\t$objResult->createdDate = $row ['dsh_created_date'];\r\n\t\t\t\t$objResult->modifiedDate = $row ['dsh_modified_date'];\r\n\r\n\t\t\t\t$arrSearchResults [] = $objResult;\r\n\r\n\t\t\t\t$objResult->searchResultAssociativeArray = $row;\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn $arrSearchResults;\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\techo \"Fatal Error: \" . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t}\r\n\t}", "public static function getBannerById($id)\n {\n $banner = self::with(['items','items.img'])->find($id);\n return $banner;\n// $result=Db::query('select * from banner_item WHERE banner_id=?',[$id]);\n// $result = Db::table('banner_item')->where('banner_id','=',$id)->select();\n //表达式、数组法、闭包\n /*$result = Db::table('banner_item')\n ->where(function($query) use ($id){\n $query->where('banner_id','=',$id);\n })->select();\n return $result;*/\n }", "function getBillsByUser($userID, $filterDest=\"any\") {\n\t$db = connectDB();\n $sql = <<<SQL\n \tSELECT billID, startDate, destination, description, cost, isPaid, userID\n \tFROM bills\n\t\tWHERE userID = ?\nSQL;\n\n\tif ($filterDest != \"any\") {\n\t\t$sql .= \" AND destination = ?\";\n\t\t$stmt = $db->prepare($sql);\n\t\t$stmt->bind_param(\"ss\", $userID, $filterDest);\n\n\t} else {\n\t\t$stmt = $db->prepare($sql);\n\t\t$stmt->bind_param(\"s\", $userID);\n\t}\n\n\n\t$stmt->execute();\n\n\t$res = $stmt->get_result()->fetch_all(MYSQLI_ASSOC);\n\n\t$stmt->close();\n\t$db->close();\n\treturn $res;\n}", "public function index(Request $request)\n {\n $aResult = Util::getDefaultArrayResult();\n \n if ($this->user->hasAccess($this->resource . '.view')) {\n \n $modelName = $this->modelName;\n \n $pageSize = $request->input('iDisplayLength', 10);\n $offset = $request->input('iDisplayStart');\n $currentPage = ($offset / $pageSize) + 1;\n\n if (!$sortCol = $request->input('mDataProp_'.$request->input('iSortCol_0'))) {\n $sortCol = 'id';\n $sortDir = 'desc';\n } else {\n \n $sortDir = $request->input('sSortDir_0');\n }\n\n //Search filter\n $search = \\trim($request->input('sSearch'));\n \n\n Paginator::currentPageResolver(function() use ($currentPage) {\n return $currentPage;\n });\n\n $items = \n $modelName::select(\n 'banners_banners.id',\n 'banners_tipos.nombre as tipo',\n \\DB::raw('CONCAT(banners_clientes.apellido, \", \", banners_clientes.nombre) as cliente'),\n 'banners_posiciones.nombre as posicion',\n 'banners_banners.nombre',\n 'banners_banners.inicio',\n 'banners_banners.fin',\n 'banners_banners.impresiones',\n 'banners_banners.clicks',\n 'banners_banners.habilitado'\n )\n ->join('banners_tipos','banners_tipos.id','=','banners_banners.id_tipo')\n ->join('banners_clientes','banners_clientes.id','=','banners_banners.id_cliente')\n ->join('banners_posiciones','banners_posiciones.id','=','banners_banners.id_posicion')\n ->orderBy($sortCol, $sortDir)\n ;\n\n if ($search) {\n $items->where(function($query) use ($search){\n $query\n ->where('banners_banners.nombre','like',\"%{$search}%\")\n ->orWhere('banners_tipos.nombre','like',\"%{$search}%\")\n ->orWhere('banners_clientes.nombre','like',\"%{$search}%\")\n ->orWhere('banners_clientes.apellido','like',\"%{$search}%\")\n ->orWhere('banners_posiciones.nombre','like',\"%{$search}%\")\n ;\n });\n }\n \n $items = $items\n ->paginate($pageSize)\n ;\n\n $aItems = $items->toArray(); \n \n $total = $aItems['total'];\n $aItems = $aItems['data']; \n \n $aResult['data'] = $aItems;\n $aResult['recordsTotal'] = $total;\n $aResult['recordsFiltered'] = $total;\n \n } else {\n $aResult['status'] = 1;\n $aResult['msg'] = \\config('appCustom.messages.unauthorized');\n }\n\n return response()->json($aResult);\n }", "public abstract function getCriteriaWhere($criteria);", "public function getBannersByField($field, $value, $limit)\n {\n if ($limit <= 0 || $limit > 1000) {\n throw new \\Exception('Invalid limit, the size of the list must be between 1 and 1000');\n }\n\n $parameters = [\n 'field' => (string) $field,\n 'value' => $value,\n 'limit' => (int) $limit\n ];\n\n return (array) $this->apiClient->doCall('getBannersByField', $parameters);\n }", "public function whoAreBuddies(){\n $conn = Db::getConnection();\n\n $statement = $conn->prepare(\"\n SELECT \n u1.firstname as firstnameBuddy1, \n u1.lastname as lastnameBuddy1,\n u1.avatar as avatar1,\n u2.firstname as firstnameBuddy2, \n u2.lastname as lastnameBuddy2, \n u2.avatar as avatar2\n FROM \n buddies as b, user u1, user u2\n WHERE\n u1.userID = b.buddy1ID AND\n u2.userID = b.buddy2ID AND\n b.status = true\n \");\n if ($statement->execute()) {\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }\n }", "public function gp_qry_all_banner($website_id)\n {\n $sql = \"Select \n B.PK_BANNER\n ,B.C_DEFAULT\n ,B.C_FILE_NAME\n ,BC.FK_CATEGORY\n From t_ps_banner B\n Right Join t_ps_banner_category BC \n On BC.FK_BANNER=B.PK_BANNER\n Where B.FK_WEBSITE=$website_id\n And B.C_STATUS=1\n Order By C_DEFAULT Desc, BC.FK_CATEGORY Asc\";\n \n return $this->db->GetAll($sql);\n }", "public function search($conditions)\n\t{\n\t\t$limit = (isset($conditions['limit']) && $conditions['limit'] !== null ? $conditions['limit'] : 10);\n\t\t$result = array();\n\t\t$alphabets = [];\n\n\t\tDB::enableQueryLog();\n\n\t\t$mem = new Memcached();\n\t\t$mem->addServer(env('memcached_server'), env('memcached_port'));\n\n\t\t/* Get Default Logo Link on setting_object table */\n\t\t$logoMem = $mem->get('logo_course');\n\n\t\tif ($logoMem)\n\t\t{\n\t\t\t$default_logo = $logoMem;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$default_logo = $this->getDefaultLogo();\n\t\t\t$mem->set('logo_course', $default_logo);\n\t\t}\n\n\t\tif (isset($conditions['alphabet']) && $conditions['alphabet'] !== null && sizeof($conditions['alphabet']) > 0) {\n\t\t\tforeach ($conditions['alphabet'] as $item) {\n\t\t\t\t$alphabets[] = \"lower(entity.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t\t$alphabets[] = \"lower(curriculum.name) like \" . DB::Raw(\"'\" . strtolower($item) . \"%'\");\n\t\t\t}\n\t\t}\n\n\t\t$extraGroup = (isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : '' );\n\t\t$extraGroup = str_replace(' ASC', '',$extraGroup);\n\t\t$extraGroup = str_replace(' DESC', '',$extraGroup);\n\n\t\t$searchData = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->limit($limit)\n\t\t\t->offset(isset($conditions['page']) && $conditions['page'] !== null ? ($conditions['page']-1) * $limit : 0)\n\t\t\t->get();\n\n\t\t$searchAll = DB::table('course')\n\t\t\t->select('curriculum.curriculum_id','course.course_id', DB::raw('entity.logo entity_logo'), 'course.day_of_week',\n\t\t\t\tDB::raw('entity.name entity_name, curriculum.name curriculum_name'), 'course.time_start', 'course.time_end')\n\t\t\t->whereRaw(\n\t\t\t\t(isset($conditions['is_free_trial'])&& sizeof($conditions['is_free_trial']) > 0 ? \"course.is_free_trial in (\" . implode(\",\", $conditions['is_free_trial']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['country_id']) && $conditions['country_id'] !== null ? \"campus.country_id in (\" . implode(\",\",$conditions['country_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['city_id']) && $conditions['city_id'] !== null ? \"campus.city_id in (\" . implode(\",\",$conditions['city_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['location_id']) && $conditions['location_id'] !== null ? \"campus.location_id in (\" . implode(\",\",$conditions['location_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['event_type_id']) && $conditions['event_type_id'] !== null ? \"program.event_type_id in (\" . implode(\",\",$conditions['event_type_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['facility_id']) && $conditions['facility_id'] !== null ? \"campus.facility_id in (\" . implode(\",\",$conditions['facility_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['campus_id']) && $conditions['campus_id'] !== null ? \"campus_arena.campus_id in (\" . implode(\",\",$conditions['campus_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['program_id']) && $conditions['program_id'] !== null ? \"curriculum.program_id in (\" . implode(\",\",$conditions['program_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['arena_id']) && $conditions['arena_id'] !== null ? \"campus_arena.arena_id in (\" . implode(\",\",$conditions['arena_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['provider_id']) && $conditions['provider_id'] !== null ? \"program.provider_id in (\" . implode(\",\",$conditions['provider_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['user_id']) && $conditions['user_id'] !== null ? \"schedule.instructor_id in (\" . implode(\",\",$conditions['user_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['day_of_week']) && $conditions['day_of_week'] !== null ? \"course.day_of_week in (\" . implode(\",\",$conditions['day_of_week']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['time_start']) && $conditions['time_start'] !== null ? \"time(course.time_start) = time('\" . $conditions['time_start'] . \"') AND \" : '') .\n\t\t\t\t(isset($conditions['time_end']) && $conditions['time_end'] !== null ? \"time(course.time_end) = time('\" . $conditions['time_end'] . \"') AND \" : '') .\n\n\t\t\t\t(isset($conditions['audience_gender_id']) && $conditions['audience_gender_id'] !== null ? \"course.audience_gender_id in (\" . implode(\",\",$conditions['audience_gender_id']) . \") AND \" : '') .\n\t\t\t\t(isset($conditions['audience_generation_id']) && $conditions['audience_generation_id'] !== null ? \"course.audience_generation_id in (\" . implode(\",\",$conditions['audience_generation_id']) . \") AND \" : '') .\n\n\t\t\t\t(isset($conditions['age_range_top']) && $conditions['age_range_top'] !== null ? \"course.age_range_top >= \" . $conditions['age_range_top'] . \" AND \" : '') .\n\t\t\t\t(isset($conditions['age_range_bottom']) && $conditions['age_range_bottom'] !== null ? \"course.age_range_bottom <= \" . $conditions['age_range_bottom'] . \" AND \" : '') .\n\n\t\t\t\t(isset($conditions['keyword']) && sizeof($conditions['keyword']) > 0 ? \"(\" . implode(\" OR \", $conditions['keyword']) . \") AND \" : '') .\n\t\t\t\t(isset($alphabets) && sizeof($alphabets) > 0 ? \"(\" . join(\" OR \", $alphabets) . \") AND \" : '') .\n\t\t\t\t('course.status = 0')\n\t\t\t)\n\t\t\t->join('campus_arena', function($join){\n\t\t\t\t$join->on('course.campus_arena_id','campus_arena.campus_arena_id');\n\t\t\t\t//$join->on('course.arena_id', 'campus_arena.arena_id');\n\t\t\t})\n\t\t\t->leftjoin('campus', 'campus_arena.campus_id', 'campus.campus_id')\n\t\t\t->leftjoin('location', 'campus.location_id', 'location.location_id')\n\n\t\t\t->leftjoin('facility', function ($join) {\n\t\t\t\t$join->on('campus.facility_id','facility.facility_id');\n\t\t\t\t$join->on('campus.country_id','facility.country_id');\n\t\t\t})\n\n\t\t\t->leftjoin('curriculum', 'course.curriculum_id', 'curriculum.curriculum_id')\n\n\t\t\t->leftjoin('program','program.program_id','curriculum.program_id')\n\t\t\t->leftjoin('provider', 'program.provider_id', 'provider.provider_id')\n\t\t\t->leftjoin('entity','provider.entity_id','entity.entity_id')\n\t\t\t->leftjoin('event_type', 'program.event_type_id', 'event_type.event_type_id')\n\t\t\t/*->join('entity', 'provider.entity_id', 'entity.entity_id')*/\n\n\t\t\t->leftjoin('schedule', 'course.course_id', 'schedule.course_id')\n\t\t\t->leftjoin('user', 'schedule.instructor_id', 'user.user_id')\n\t\t\t->leftjoin('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t->leftjoin('activity_classification', 'activity_classification.activity_classification_id', 'activity.activity_classification_id')\n\t\t\t//->groupBy('course.course_id','schedule.instructor_id','curriculum.curriculum_id','entity.logo', 'course.day_of_week','entity.name','curriculum.name','course.time_start', 'course.time_end','event_type.name')\n\t\t\t->groupBy(\n\t\t\t\tDB::raw('curriculum.curriculum_id, course.course_id, entity.logo, course.day_of_week, entity.name, curriculum.name, course.time_start, course.time_end' .\n\t\t\t\t\t(isset($conditions['sort']) && $conditions['sort'] !== null ? \", \" . $extraGroup : '' )\n\t\t\t\t)\n\t\t\t)\n\t\t\t->orderByRaw(isset($conditions['sort']) && $conditions['sort'] !== null ? $conditions['sort'] : 'course.day_of_week ASC, course.course_id DESC')\n\t\t\t->get();\n\n\t\t//echo(\"<br>Total : \" . sizeof($searchData) . \" records\");\n\t\tforeach ($searchData as $data) {\n\t\t\t/*echo('<br>' . $data->program_id . '|' . $data->program_name . '|'. $data->activity_id . '|' . $data->provider_name . '|' . $data->location_name);*/\n\t\t\t//echo('<br>' . $data->provider_id . '|' . $data->provider_name . '|' . $data->location_name);\n\n\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\t\t\t$day = DB::table('day_of_week')->where('day_of_week.day_of_week_id',$data->day_of_week)->first();\n\n\n\t\t\t//echo('<br>' . $data->course_id . \"~\" . $data->program_name . '#'.$day->name. \"|\". date('h:i',strtotime($data->time_start)) . '-' .date('h:i',strtotime($data->time_end)));\n\t\t\t$item = ['course_id' => $data->course_id,\n\t\t\t\t'entity_logo' => ($data->entity_logo ? $data->entity_logo : $default_logo),\n\t\t\t\t'entity_name' => $data->entity_name,\n\t\t\t\t'curriculum_name' => $data->curriculum_name,\n\t\t\t\t'day_name' => $day->name,\n\t\t\t\t'time_start' => date('H:i',strtotime($data->time_start)),\n\t\t\t\t'time_end' => date('H:i',strtotime($data->time_end))];\n\n\t\t\t/*$schedules = DB::table('schedule')\n\t\t\t\t->select('schedule.schedule_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\tforeach ($schedules as $schedule) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t}*/\n\n\t\t\t$programs = DB::table('curriculum')\n\t\t\t\t->select('program.program_id', 'program.name')\n\t\t\t\t->join('program', 'program.program_id', 'curriculum.program_id')\n\t\t\t\t->where('curriculum.curriculum_id', $data->curriculum_id)\n\t\t\t\t->orderBy('program.activity_id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\t$searchActivities = [];\n\t\t\tforeach ($programs as $program) {\n\t\t\t\t//echo($program->program_id . '|' . $program->name );\n\t\t\t\t$activities = DB::table('program')\n\t\t\t\t\t->select('activity.logo', 'program.provider_id', DB::raw('program.name program_name'))\n\t\t\t\t\t->join('activity', 'program.activity_id', 'activity.activity_id')\n\t\t\t\t\t->leftjoin('activity_classification', 'activity.activity_classification_id', 'activity_classification.activity_classification_id')\n\t\t\t\t\t->where('program.program_id', $program->program_id)\n\t\t\t\t\t->whereRaw(\n\t\t\t\t\t\t(isset($conditions['activity_id']) && $conditions['activity_id'] !== null ? \"program.activity_id in (\" . implode(\",\",$conditions['activity_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_classification_id']) && $conditions['activity_classification_id'] !== null ? \"activity.activity_classification_id in (\" . implode(\",\",$conditions['activity_classification_id']) . \") AND \" : '') .\n\t\t\t\t\t\t(isset($conditions['activity_type_id']) && $conditions['activity_type_id'] !== null ? \"activity_classification.activity_type_id in (\" . implode(\",\",$conditions['activity_type_id']) . \") AND \" : '') .\n\t\t\t\t\t\t('program.status = 0')\n\t\t\t\t\t)\n\t\t\t\t\t//->groupBy('activity.logo')\n\t\t\t\t\t->get();\n\n\t\t\t\tforeach ($activities as $activity) {\n\t\t\t\t\t//echo('<img src=\"' . $activity->logo . '\" style=\"width:2%;\" alt=\"' . $activity->program_name . '\" title=\"' . $activity->program_name . '\">');\n\t\t\t\t\t$searchActivity = [\n\t\t\t\t\t\t'logo' => $activity->logo,\n\t\t\t\t\t\t'name' => $activity->program_name,\n\t\t\t\t\t];\n\t\t\t\t\tarray_push($searchActivities, $searchActivity);\n\t\t\t\t}\n\t\t\t}\n\t\t\tarray_push($result, array('item' => $item, 'activity' => $searchActivities));\n\t\t}\n\n\t\t$final = array('totalPage' => ceil(sizeof($searchAll)/$limit), 'total' => ( sizeof($searchAll) > 0 ? sizeof($searchAll) : 0), 'result' => $result, 'debug' => DB::getQueryLog()[0]['query']);\n\t\treturn $final;\n\t}", "function _paginate_leads($criteria) {\n\t\t$order='desc';\n\t\t$page='5';\t\t\n\t\tlist($order,$limit,$page) = $this->Pagination->init($criteria);\n\t\t$leads = $this->Gender->findAll($criteria, NULL, $order, $limit, $page);\t\n\t\treturn $leads;\n\t}", "public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null);", "private function getTodayAdvertisements() {\n \treturn AdvertisementQuery::create()\n\t\t\t\t->filterByCurrent()\n\t\t\t\t->filterByBillboard($this)\n\t\t\t\t->find();\n }", "public function actionIndex()\n {\n $searchModel = new BannerSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "function getDynamicAds()\n\t\t{\n\t\t\t$dynamicBanner_1 = $this->manage_content->getValue_where('banner_info','banner_image','id',5);\n\t\t\t$dynamicBanner_2 = $this->manage_content->getValue_where('banner_info','banner_image','id',6);\n\t\t\t//print_r($dynamicBanner[0]['banner_image']);\n\t\t\t//get dynamic banner 1\n\t\t\tif($dynamicBanner_1[0]['banner_image'] == 'NULL')\n\t\t\t{\n\t\t\t\techo '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<div class=\"dynamic_banner\">'.$dynamicBanner_1[0]['banner_image'].'</div>';\n\t\t\t}\n\t\t\t//get the dynamic banner 2\n\t\t\tif($dynamicBanner_2[0]['banner_image'] == 'NULL')\n\t\t\t{\n\t\t\t\techo '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo '<div class=\"dynamic_banner\">'.$dynamicBanner_2[0]['banner_image'].'</div>';\n\t\t\t}\n\t\t}", "public function find()\n\t{\n\t\t$query = array_filter([\n\t\t\t'labelSelector' => $this->getLabelSelectorQuery(),\n\t\t\t'fieldSelector' => $this->getFieldSelectorQuery(),\n\t\t]);\n\n\t\tif ($this->beta) {\n\t\t\t$response = $this->client->sendBetaRequest('GET', '/' . $this->uri, $query, null, $this->namespace);\n\t\t} else {\n\t\t\t$response = $this->client->sendRequest('GET', '/' . $this->uri, $query, null, $this->namespace);\n\t\t}\n\n\t\t$this->resetParameters();\n\n\t\treturn $this->createCollection($response);\n\t}", "function getBookingsByCustomerId($customerid) {\n $query = \"SELECT * FROM `bookings` WHERE CustomerId='\" . $customerid . \"'\";\n \n $result = Database::selectQuery($query);\n \n if($result == null) {\n return null;\n } else {\n return $result;\n }\n }", "public function getBlackBoardRecords($rank, $section){\n \n $day = \"%,\" . date('N') .\"%\";\n $month = \"%,\" . date('n') . \"%\";\n //create blackboard record query\n $blackboard_record_query = Doctrine_Query::create() \n ->from('Pizarra p')\n ->leftJoin('p.PizarraSectionMapping psm')\n ->leftJoin('psm.PizarraSection ps')\n ->where('ps.short_name =?',$section)\n ->andWhere('p.visibilidad <=?', $rank)\n ->andWhere('p.desde < \"'. date('Y-m-d H:i:s') .'\"')\n ->andWhere('p.hasta > \"'. date('Y-m-d H:i:s') .'\"')\n ->andWhere('p.days LIKE ?', $day)\n ->andWhere('p.months LIKE ?', $month)\n ->limit(10);\n \n //get balckborad records\n $blackboard_records = $blackboard_record_query->fetchArray();\n \n return $blackboard_records;\n }", "function get_criteria_by_ad_group($ad_group_id, $user_statuses = array(),\n $number = 0, $first = 0) {\n\n $selector = $this->__criteria_selector_ad_group_id($ad_group_id,\n $user_statuses,\n $number,\n $first);\n\n return $this->__do_get('AdGroupCriterionService', $selector);\n\n}", "private function getList()\n\t{\n\t\t// Get the correct billboards collection to display from the parameters\n\t\t$collection = (int) $this->params->get('collection', 1);\n\n\t\t// Grab all the buildboards associated with the selected collection\n\t\t// Make sure we only grab published billboards\n\t\t$rows = Billboard::whereEquals('published', 1)\n\t\t ->whereEquals('collection_id', $collection)\n\t\t ->order('ordering', 'asc')\n\t\t ->rows();\n\n\t\treturn $rows;\n\t}", "function findByCondition($condition = array()){\n $mBlog = M('artical');\n $count = $mBlog->field(\"a.*,u.nickname\")\n ->alias(\"a\")\n ->join(\"LEFT JOIN db_user u on u.id = a.u_id\")\n ->order('a.addtime desc')\n ->where($condition)\n ->count();\n $page = new \\Think\\Page($count,2);\n $show = $page->show();\n $data = $mBlog->field(\"a.*,u.nickname\")\n ->alias(\"a\")\n ->join(\"LEFT JOIN db_user u on u.id = a.u_id\")\n ->order('a.addtime desc')\n ->where($condition)\n ->limit($page->firstRow.','.$page->listRows)->select();\n return array(\n 'show' => $show,\n 'data' => $data\n );\n }", "protected function getListQuery() {\n // Create a new query object.\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n\n // Select the required fields from the table.\n $query->select(\n $this->getState(\n 'list.select', 'a.*'\n )\n );\n $query->from('`#__breedable` AS a');\n\n \n\t\t// Join over the users for the checked out user\n\t\t$query->select(\"uc.name AS editor\");\n\t\t$query->join(\"LEFT\", \"#__users AS uc ON uc.id=a.checked_out\");\n\t\t// Join over the category 'breedable_type'\n\t\t$query->select('breedable_type.title AS breedable_type');\n\t\t$query->join('LEFT', '#__categories AS breedable_type ON breedable_type.id = a.breedable_type');\n\t\t// Join over the user field 'created_by'\n\t\t$query->select('created_by.name AS created_by');\n\t\t$query->join('LEFT', '#__users AS created_by ON created_by.id = a.created_by');\n\n \n\n // Filter by search in title\n $search = $this->getState('filter.search');\n if (!empty($search)) {\n if (stripos($search, 'id:') === 0) {\n $query->where('a.id = ' . (int) substr($search, 3));\n } else {\n $search = $db->Quote('%' . $db->escape($search, true) . '%');\n\t\t\t\t$query->where('( a.status LIKE '.$search.' OR a.id LIKE '.$search.' OR a.breedable_name LIKE '.$search.' OR a.mother_name LIKE '.$search.' OR a.father_name LIKE '.$search.' OR a.owner_name LIKE '.$search.' OR a.owner_key LIKE '.$search.' OR a.breedable_gender LIKE '.$search.' )');\n \n }\n }\n\n\t\t//Filtering owner_name\n\t\t$filter_owner_name = $this->state->get(\"filter.owner_name\");\n\t\tif ($filter_owner_name != '') {\n\t\t\t$query->where(\"a.owner_name = '\".$db->escape($filter_owner_name).\"'\");\n\t\t}\n\t\t//Filtering status\n\n\t\t//Filtering generation\n\n\t\t//Filtering breedable_gender\n\t\t$filter_breedable_gender = $this->state->get(\"filter.breedable_gender\");\n\t\tif ($filter_breedable_gender != '') {\n\t\t\t$query->where(\"a.breedable_gender = '\".$db->escape($filter_breedable_gender).\"'\");\n\t\t}\n\n\t\t//Filtering breedable_eyes\n\n\t\t//Filtering breedable_fevor\n\n\t\t//Filtering breedable_pregnant\n\n\n // Add the list ordering clause.\n $orderCol = $this->state->get('list.ordering');\n $orderDirn = $this->state->get('list.direction');\n if ($orderCol && $orderDirn) {\n $query->order($db->escape($orderCol . ' ' . $orderDirn));\n }\n\n return $query;\n }", "public function matching(Criteria $criteria)\n {\n }", "function getBanner($page, $bannerPath)\n\t{\n\t\t//determine context closure of $page, include $page itself too\n\t\t$clos = array($page);\n\t\tgetContextClosure($page, $clos);\n\t\t//get values of banner properties in closure (max one per page!)\n\t\t$banners = array();\n\t\t$query = \"[[\".implode(']] OR [[', $clos) . \"]]\";\n\t\t$query = $query.\"|?\".BANNERPROPERTY;\n\t\t$result = APIAsker::getInstance()->ask($query);\n\t\tforeach($result[\"query\"][\"results\"] as $pagina)\n\t\t{\n\t\t\tif($bannerFileName = $pagina[\"printouts\"][BANNERPROPERTY][0]){\t\t//als property niet als String type gedefinieerd: gaat fout!\n\t\t\t\t// er wordt alleen gekeken naar de eerste occurence van banner property (dus max 1 def heeft zin).\n\t\t\t\t$wikiImageUrl = APIAsker::getInstance()->queryImageUrl($bannerFileName);\n\t\t\t\t$banners[] = ($wikiImageUrl) ? $wikiImageUrl : $bannerPath.\"/\".$bannerFileName;\n\t\t\t}\n\t\t}\n\t\treturn $banners[0];\t\t//return the first one for now\n\t\t\t\t\t\t\t\t//Note that, if present, that is the value of BANNERPROPERTY of the current page (see first code line).\n\t}", "function helperGetAvailableRecords($catList='', $areaSearch='') {\n\t\t$where = ' lng!=0 AND lat!=0 '.$this->config['pid_list'];\n\n\t\tif (!empty($areaSearch)) {\n\t\t// build the query\n\t\t$areaArr= $this->intExplode('%2C%20',$areaSearch, 1);\n\t\t$where .= ' AND lng between '.$areaArr[1].' AND '.$areaArr[3].'\n\t\t\t\t\t\t\tAND\tlat between '.$areaArr[0].' AND '.$areaArr[2];\n\t\t}\n\n\t\t// if no category chosen, be sure no result gets displayed\n\t\tif($catList==9999) {\n\t\t\t$where .= ' AND 1=2 ';\n\t\t} elseif ($catList!='') {\n\n\t\t\t$catList = $this->intExplode(',', $catList);\n\t\t\tforeach ($catList as $key=>$value) {\n\t\t\t\t$where2 = ' FIND_IN_SET('.$value.',rggmcat) OR';\n\t\t\t}\n\t\t\t$where .= ' AND ( '.substr($where2,0,-3).' ) ';\n\t\t}\n\n\t\treturn $where;\n\t}", "public function get_matches()\r\n\t\t{\r\n\t\t\t$retArr = null;\r\n\t\t\t// Scaffolding Code For Array:\r\n\t\t\t$objs = $this->obj->find_all();\r\n\t\t\tforeach($objs as $obj)\r\n\t\t\t{\r\n\t\t\t\t$retArr[] = $obj->getBasics();\r\n\t\t\t}\r\n\t\t\treturn $retArr;\r\n\t\t}", "function search($params, $perpage = null, $page = null)\n {\n $offset = null;\n if ($page != null) {\n $offset = ($page == 1) ? 0 : ($page * $perpage) - $perpage;\n }\n\n $this->db->join('pt_accounts', 'pt_accounts.accounts_id = pt_bookings.booking_user');\n foreach ($params as $key => $value) {\n if ($key == 'ai_last_name' && $value) {\n $this->db->like('pt_accounts.ai_last_name', $value);\n } else {\n if ($value) {\n $this->db->where('pt_bookings.' . $key, $value);\n }\n }\n\n }\n if (!empty($perpage)) {\n $this->db->order_by('booking_id', 'desc');\n $this->db->limit($perpage, $offset);\n\n $query = $this->db->get('pt_bookings');\n $data = $query->result();\n } else {\n $query = $this->db->get('pt_bookings');\n $data = $query->num_rows();\n }\n\n return $data;\n }", "public static function getAllInstance()\n {\n try {\n $config = Zend_Registry::get('production');\n $db = Zend_Db::factory($config->resources->db->adapter, $config->resources->db->params);\n\n $sql = 'SELECT * FROM bplace';\n $result = $db->query($sql)->fetchAll();\n\n if (isset($result[0])) {\n $retArray = array();\n foreach ($result as $res) {\n $retArray[] = SM_Banner_Place::getInstanceByArray($res);\n }\n return $retArray;\n } else {\n return false;\n }\n } catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n }" ]
[ "0.6489817", "0.619009", "0.61641455", "0.5908825", "0.5861976", "0.575718", "0.57488054", "0.5327648", "0.5307905", "0.5306884", "0.5296258", "0.5285805", "0.52042824", "0.5016086", "0.49992895", "0.49956042", "0.49784806", "0.4935946", "0.493419", "0.48799345", "0.4867206", "0.486344", "0.486344", "0.48607135", "0.4827315", "0.48214185", "0.47958875", "0.4784673", "0.47650105", "0.47617227", "0.47282776", "0.47240075", "0.47184113", "0.47076377", "0.46949282", "0.46849233", "0.46810278", "0.46733564", "0.46680847", "0.4660949", "0.4660414", "0.46584576", "0.46543878", "0.46541226", "0.4638313", "0.46357325", "0.46264386", "0.46215948", "0.4603133", "0.46001866", "0.45969424", "0.45893207", "0.45885637", "0.45848843", "0.4582196", "0.45711744", "0.4569903", "0.45691353", "0.45598483", "0.45588198", "0.4541469", "0.45380786", "0.45367485", "0.4531252", "0.4530155", "0.45274043", "0.45205316", "0.45154783", "0.44813898", "0.4477911", "0.44640347", "0.445206", "0.445206", "0.445206", "0.4448927", "0.44486243", "0.44422802", "0.4433432", "0.4429715", "0.4410222", "0.4401054", "0.4397828", "0.43901342", "0.43893293", "0.43838918", "0.43735334", "0.43698907", "0.43609497", "0.43554208", "0.4354771", "0.43513203", "0.43471825", "0.43467474", "0.43396655", "0.43365175", "0.43360484", "0.43296602", "0.43254507", "0.4319013", "0.43177637", "0.431642" ]
0.0
-1
Delete a Banner by Id
public function deleteById($id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteBanner() {\n $_DELETE = $this->getDeleteData();\n if (isset($_DELETE['id'])) {\n $id = $_DELETE['id'];\n } else {\n throw new RestException(HttpStatusCodes::BAD_REQUEST, \"Missing required params\");\n }\n try {\n\n Banner::deleteBanner($id);\n } catch (Exception $e) {\n throw new RestException($e->getCode(), $e->getMessage());\n }\n }", "public static function DeleteBanner($id)\n\t{\n\t\t$sql = 'DELETE FROM adbanner WHERE adb_id = ' .(int)$id;\n\t\t$res = Query::Execute($sql);\n return $res;\t\n\t}", "public function destroy($id)\n {\n try {\n \n $banner = Banner::find($id);\n $banner->delete();\n return Response::json(array('status' => 'success' , 'message' => 'Successfully deleted ! ' ),200);\n \n }catch (Exception $ex ){\n return Response::json(array('status' => 'error' , 'error' => $ex->getMessage() ),500);\n }\n }", "protected function DeleteBannerItem($id) {\n return w_adv_bunners_object::RemoveBanner($id, $this->control); \n }", "public function deleteById($bidId);", "public function delete()\r\n\t{\r\n\t\t$this->auth->restrict('Banner.Content.Delete');\r\n\r\n\t\t$id = $this->uri->segment(6);\r\n\r\n\t\tif (!empty($id))\r\n\t\t{\r\n\r\n\t\t\tif ($this->banner_group_model->delete($id))\r\n\t\t\t{\r\n\t\t\t\t// Log the activity\r\n\t\t\t\t$this->activity_model->log_activity($this->current_user->id, lang('banner_act_delete_record').': ' . $id . ' : ' . $this->input->ip_address(), 'banner');\r\n \r\n // Delete all banner in the group\r\n\t\t\t\t$this->banner_model->delete_where(array('banner.group_id' => $id));\r\n \r\n\t\t\t\tTemplate::set_message(lang('banner_delete_success'), 'success');\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\tTemplate::set_message(lang('banner_delete_failure') . $this->banner_group_model->error, 'error');\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tredirect(SITE_AREA .'/content/banner/groups');\r\n\t}", "public function destroy($id) {\n $banner = Banner::find($id);\n\n if (! $banner) {\n return redirect()->back()->with(['error' => 'Data Not Found']);\n }\n Banner::destroy($id);\n return redirect()->back()->with(['success' => 'Banner deleted successfully']);\n }", "public function destroy($id)\n {\n $banner = Banners::find($id);\n //$banner->banner_details()->delete();\n $banner->delete();\n\n return redirect()->route('admin.banners.index')->with('success','Banner deleted successfully');\n }", "public function destroy($id)\n {\n $banner = Banner::findOrFail($id);\n // Remove Image\n $banner_image_path = 'images/home_banners/'.$banner->image;\n if(file_exists($banner_image_path)){\n unlink($banner_image_path);\n }\n\n // Delete Banner\n $banner->delete();\n\n return redirect()->route('banner.index')->with('flash_message_success', 'Xóa banner thành công!');\n }", "public function actionDelete($id)\n {\n $banner = $this->findModel($id);\n\n if ($banner) {\n Banner::deleteImage($banner->image);\n $banner->delete();\n } else {\n notify()->addError(t('app', 'Something went wrong'));\n }\n\n return $this->redirect(['index']);\n }", "public function deleteById($bannerId)\n {\n return $this->delete($this->getById($bannerId));\n }", "public function destroy($id)\n {\n $banner = Banner::find($id);\n if ($banner->image !== '') $this->deletePhoto($banner->image);\n $banner->delete();\n \\Flash::success('Banner deleted.');\n return redirect()->route('banner.index');\n }", "public function delete_banner($id) {\n $this->db->where_in('banner_id', $id);\n $query = $this->db->delete('banners');\n if ($this->db->affected_rows() > 0) {\n return true;\n } else {\n return false;\n }\n }", "public function superadmin_deletebanner($id = null) {\t\t\n\t\tif ($this->request->is('get')) {\n\t\t\tthrow new MethodNotAllowedException();\n\t\t}else{\n\t\t\t$this->request->data = $this->Banner->find('first',array('conditions'=>array('Banner.id'=>$id)));\t\t\t\t\t\t\n\t\t\t\n\t\t\tApp::import('Vendor', 'Uploader.Uploader');\n\t\t\t$this->Uploader = new Uploader();\n\t\t\t\t\n\t\t\tif($this->request->data['Banner']['filename']!=NULL) {\n\t\t\t\t$this->Uploader->remove(WWW_ROOT.'Banner/'.$this->request->data['Banner']['filename']);\n\t\t\t\t$this->Uploader->remove(WWW_ROOT.'Banner/150x80_'.$this->request->data['Banner']['filename']);\n\t\t\t}\t\t\n\t\t\t\t\n\t\t\tif ($this->Banner->delete($id)) {\n\t\t\t\t$this->Session->write('popup','Banner has been deleted successfully.');\n\t\t\t\t$this->Session->setFlash('Banner has been deleted successfully.'); \n\t\t\t\t$this->redirect(array('controller'=>'banners','action' => \"index/message:success\")); \n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('Deletion problem, Please try again.'); \n\t\t\t\t$this->redirect(array('controller'=>'banners','action' => \"index\"));\n\n\t\t\t}\n\t\t}\t\n\t}", "public function destroy($id)\n {\n $banner = Banner::findOrFail($id);\n if(Banner::destroy($id)){\n //unlink($banner->photo);\n flash(__('Banner has been deleted successfully'))->success();\n }\n else{\n flash(__('Something went wrong'))->error();\n }\n return redirect()->route('home_settings.index');\n }", "public function destroy($id)\n {\n $banner = Banner::find($id);\n if ($banner) $banner->delete();\n return redirect()->action('Admin\\BannerController@index');\n }", "public function destroy($id)\n {\n Banner::findOrFail($id)->delete();\n return redirect('/admin/banner')->with('success', 'Banner deleted successfully.');\n }", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function delete($id);", "public function destroy($id)\n {\n try {\n \n $banner = Banner::findOrFail($id);\n \n $isDeleted = $banner->delete();\n\n // if banner deleted successfully\n if($isDeleted){\n return redirect('ssfs-admin/banners')->with('err_message', 'Banner deleted successfully');\n }\n else{\n return redirect('ssfs-admin/banners')->with('err_message', 'Failed to delete banner. Please try again');\n }\n\n } catch (\\Exception $e) {\n return redirect('ssfs-admin/banners')->with('err_message', 'Failed to delete banner. Please try again');\n }\n }", "public function destroy($id)\n {\n $banner = Banner::findOrFail($id);\n $banner->delete();\n Session::flash('message','تم المسح بنجاح');\n return redirect()->back();\n }", "public function deleteBannerImage($id=null){\n //get banner/slider image name\n $bannerImage =Banner::where(['id'=>$id])->first();\n \n //get banner/slider image paths\n $banner_image_path = 'images/frontend_images/images/banners/';\n\n //delete banner image if exist in folder\n if(file_exists($banner_image_path.$bannerImage->image)){\n unlink($banner_image_path.$bannerImage->image);\n }\n \n // delete image from banner table\n Banner::where(['id'=>$id])->update(['image'=>'']);\n return redirect()->back()->with('flash_success_msg','Slider Image Deleted successfully!');\n }", "public function delete( $id );", "public function destroy($id){\n if (Auth::user()->role != 'Editor') {\n $banner = Banner::find($id);\n\n if (File::exists('images/banners/' . $banner->image)) {\n File::delete('images/banners/' . $banner->image);\n }\n\n $banner->delete();\n\n session()->flash('success', 'Banner Has Deleted');\n return redirect()->route('admin.banner.index');\n }else{\n session()->flash('errormsg','You have no permission for requested page!');\n return redirect()->route('admin.index');\n }\n }", "public function actionDelete($id)\n\t{\n $model = $this->loadModel($id);\n $media = $model->media;\n $model->delete();\n\n Yii::app()->user->setFlash(\n 'success',\n Yii::t('admin', 'The banner {title} has been deleted!', array('{title}' => $media->title))\n );\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('/admin/banner/index'));\n\t}", "abstract public function delete($id);", "abstract public function delete($id);", "abstract public function delete($id);", "function delete($id) {\n Ad::deleteAd($id);\n unset($_GET['delete']);\n }", "abstract public function deleteById($id);", "function delete($id);", "public function delete($id) {\r\n\r\n }", "public function delete(int $id);", "public function destroy($id)\n\t{\n\t\tCommonNormal::delete($id);\n\t\treturn Redirect::action('BannerController@index');\n\t}", "public function delete($id) { \n $this -> advertisementsmodel -> delete_advertisement($id);\n $this -> session -> set_userdata('success_message', \"Advertisement deleted successfully\");\n redirect('advertisements', 'refresh');\n }", "public function delete($id)\n {\n // ..\n }", "public function delete($id)\r\n {\r\n }", "public function deleteAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Gou_Service_Ad::getAd($id);\r\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\r\n//\t\tUtil_File::del(Common::getConfig('siteConfig', 'attachPath') . $info['img']);\r\n\t\t$result = Gou_Service_Ad::deleteAd($id);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "public function destroy($id)\n {\n $banner = Banner::findOrFail($id);\n\n $status = $banner->delete();\n\n if ($status) {\n Storage::delete($banner->photo);\n unlink(public_path('frontend/banners/' . $banner->photo));\n \n request()->session()->flash('success', 'Banner removido com sucesso.');\n } else {\n request()->session()->flash('error', 'Erro ao deletar o banner. Por favor, tente novamente.');\n }\n \n return redirect()->route('banners.index');\n }", "public function delete($id){\r\n }", "public function delete($id)\n {\n //\n }", "public function delete($id)\n {\n //\n }", "public abstract function delete($id);", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n {\n }", "public function delete($id)\n\t {\n\t //\n\t }" ]
[ "0.7982423", "0.78837967", "0.7604473", "0.74484277", "0.7446744", "0.7371294", "0.733841", "0.7318522", "0.7311878", "0.73094606", "0.73046416", "0.7277278", "0.7249913", "0.7244768", "0.7234516", "0.7211527", "0.72091764", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.71757174", "0.7160081", "0.71562994", "0.714818", "0.7146673", "0.71175", "0.7045795", "0.7029854", "0.7029854", "0.7029854", "0.7011977", "0.7011205", "0.6999282", "0.6998956", "0.69958186", "0.69801354", "0.69681865", "0.696233", "0.69580096", "0.69396186", "0.693133", "0.69300145", "0.6903388", "0.6903388", "0.68918794", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68872714", "0.68824667" ]
0.7160974
54
Computes the tail offset of this vector based on the count.
private function tailOffset(): int { if ($this->count < self::BRANCH_FACTOR) { return 0; } return $this->count - count($this->tail); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rd_kafka_offset_tail(int $cnt): int\n{\n\n}", "function tail($count = 10)\n\t{\n\t\treturn array_slice($this->_data, 0 - $count);\n\t}", "function trailing($count = 10)\n\t{\n\t\treturn array_slice($this->_data, 0 - $count);\n\t}", "public function right ( $count = 0 ) {\n $this->_currentPosition = array(\n $this->_currentPosition[0] + $count,\n $this->_currentPosition[1],\n );\n return $this;\n }", "public function tail(?int $length = null): Base;", "public function getOffset()\r\n {\r\n return ( $this->_pageno - 1 ) * $this->_size;\r\n }", "function offset($count) {\n\t\t$this->appendStmt('offset', \"OFFSET ?\", [$count]);\n\t\treturn $this;\n\t}", "public function getOffsetEnd()\n\t{\n\t\treturn $this->start + count($this->entities);\n\t}", "public function up ( $count = 0 ) {\n $this->_currentPosition = array(\n $this->_currentPosition[0],\n $this->_currentPosition[1] - $count,\n );\n return $this;\n }", "public function down ( $count = 0 ) {\n $this->_currentPosition = array(\n $this->_currentPosition[0],\n $this->_currentPosition[1] + $count,\n );\n return $this;\n }", "function tail() {\r\n return new self(array_slice($this->list, 1));\r\n }", "public function get_offset() {\n\t\treturn ( $this->step - 1 ) * $this->per_step;\n\t}", "public function Tail() {\n\t\treturn $this->tail;\n\t}", "function stripLast ($count = 1)\n {\n $this->A = array_slice ($this->A, 0, -$count);\n return $this;\n }", "private function offset()\n {\n if(is_array($this->limite)): $this->limite=$this->limite['limite']; endif;\n\t$offset = ($this->paginaAtual() - 1) * $this->limite;\n\treturn $offset;\n }", "function tail(array $list)\n{\n return array_slice($list, 1);\n}", "public function last()\n {\n if($this->length()>0)\n {\n return $this->getAt(($this->length()-1));\n }\n throw new \\OutOfBoundsException();\n }", "public function lead(): Number\n {\n return $this->vector->lead();\n }", "public function offset() {\n return ($this->current_page - 1) * $this->per_page;\n }", "public function getOffset()\n {\n return ($this->number_of_items_per_page * $this->current_page) - $this->number_of_items_per_page;\n }", "static function SumUpto($count)\n\t\t{\n\t\t\t$sum = 0 ;\n\t\t\t\n\t\t\tfor(; $count > 0; $count--)\n\t\t\t{\n\t\t\t\t$sum += $count ;\n\t\t\t}\n\t\t\t\n\t\t\treturn $sum ;\n\t\t}", "public function last()\n {\n return $this->fixedArray->offsetGet($this->currentSize - 1);\n }", "public function getLastIndex()\n {\n return $this->index - 1;\n }", "private function calculateOffset() {\n $this->offset = ($this->currentpage - 1) * $this->limit;\n }", "public function element_end_position(){\n if($this->number_of_pages() == $this->current_page){\n return $this->total_amount - 1;\n }\n else{\n return $this->element_start_position() + $this->amount_per_page - 1;\n }\n }", "protected final function getAfterOffset ($match) {\n\t\treturn $match[1] + strlen($match[0]);\n\t}", "public function getOffset() {\n return ($this->getCurrentPage() - 1) * $this->getItemCountPerPage();\n }", "public function getLength() : int\n {\n return $this->b[$this->offset];\n }", "protected function getOffset(): int\n {\n return ($this->page - 1) * $this->limitPerPage;\n }", "public function getNextByteOffset()\n {\n return $this->offset + $this->length;\n }", "public function thruIndex() {\n\t\treturn $this->thru > 0 ? $this->thru - 1 : 0;\n\t}", "private function getOffset()\n {\n $this->current_offset = null;\n \n $headers = $this->getHead();\n \n if (isset($headers['Offset']) === true) {\n $this->current_offset = $headers['Offset'];\n }\n \n return $this->current_offset;\n }", "public function getSuperscriptYOffset() {}", "private function get_offset() {\n\t\treturn ( (time() - $this->skew) % ($this->lifetime + $this->skew) );\n\t}", "public function getCurrentOffset() {\n return ($this->getCurrentPage() - 1) * $this->_itemsPerPage;\n }", "public function getOffset() {}", "public function getOffset() {}", "public function getOffset() {}", "public function getStartOffset() {}", "public function getLength($atOffset = false) {}", "public function shift()\r\n\t{\r\n\t\t$this->count--;\r\n\t\t$start = array_shift($this->elements);\r\n\t\t$this->rewind();\r\n\t\treturn $start;\r\n\t}", "protected function get_length(): int\n\t{\n\t\treturn $this->end - $this->start + 1;\n\t}", "public function getEndPosition()\n\t{\n\t\treturn -1;\n\t}", "function right($value, $count){\n return substr($value, ($count*-1));\n}", "public function GetXEnd(){\n return $this->w-$this->rMargin;\n }", "public function getLastSize()\n {\n $count = count($this->sizeList);\n if ($count === 0) {\n return;\n }\n \n return $this->sizeList[$count - 1];\n }", "private function getOffset($limit='unset') \n { \n if ($limit != 'unset'){return ($this->getCurrentPage() - 1 ) * $this->getLimitPerPage($limit);}\n\t else {return ( $this->getCurrentPage() - 1 ) * $this->getLimitPerPage(); } \n \n }", "public function getOffset();", "public function getOffset();", "public function getOffset();", "public function getEnd(): int\n {\n return $this->end;\n }", "public function getOffset(): int;", "public function limit($count, $offset);", "function getOffset() ;", "public function LastItem()\n {\n $pageLength = $this->getPageLength();\n if (!$pageLength) {\n return $this->getTotalItems();\n } elseif ($start = $this->getPageStart()) {\n return min($start + $pageLength, $this->getTotalItems());\n } else {\n return min($pageLength, $this->getTotalItems());\n }\n }", "public function getLength($atOffset = false);", "public function reduce($count, $start = 0)\n\t{\n\t\tif ($count == NULL || $count > 0) { //intentionally ==\n\t\t\t$this->df->limit($count == NULL ? 0 : $count);\n\t\t} else throw new \\OutOfRangeException;\n\n\t\tif ($start == NULL || ($start > 0 && $start < count($this))) {\n\t\t\t$this->df->offset($start == NULL ? 0 : $start);\n\t\t} else throw new \\OutOfRangeException;\n\n\t\treturn $this;\n\t}", "public function incLen() { return $this->_m_incLen; }", "public function getOffset(): int\n {\n return $this->offset;\n }", "public function getOffsets() {}", "public function take(int $n): VectorInterface;", "protected function get_offset(): int\n\t{\n\t\treturn $this->start;\n\t}", "public function offset(){\n\t\t//Page 1 has an offset of 0 (1-1) * 20\n\t\t//Page 2 has an offset of 20 (2-1) * 20\n\t\t//in other words, page 2 starts with item 21\n\t\treturn ($this->current_page - 1) * $this->per_page;\t\n\t}", "public function getEndIndex()\n {\n return $this->end_index;\n }", "public function getOffset()\n {\n $page = $this->getRequest()->get('page', 1);\n $limit = $this->getRequest()->get('limit');\n\n return (null != $limit) ? $limit * ($page - 1) : null;\n }", "public function getIndexEnd();", "function getTail($i) {\n return $i > 0;\n }", "public function getSequenceTail(int $limit = 15): array\n {\n $output = [];\n $totalElements = $this->getSequenceLength();\n $fibonacciSequence = $this->getLastNumbersFromSequence($limit);\n\n foreach (array_reverse($fibonacciSequence) as $index => $fibonacci) {\n $output[$totalElements - $index] = $fibonacci;\n }\n\n return $output;\n }", "public function getSubscriptYOffset() {}", "function tail(iterable $collection): array\n{\n return asList(TailOperation::of($collection)());\n}", "public function getCaretOffset() {}", "function getRowOffset($index)\n\t{\n\t\treturn $index +1 + $this->limitstart;\n\t}", "public function getEnd(): int;", "public function allocations(): int {\n return $this->last + 1;\n }", "function headTail(array $list) {\n assert(count($list) > 0);\n \n return [\n $list[0],\n array_slice($list, 1),\n ];\n}", "public function getOffset(): int\n {\n return $this->pageIndex * $this->pageSize;\n }", "protected function _findStartOffset() {}", "public function nthToEnd($n) {\n if ($n >= $this->size) {\n return;\n }\n // calculate the number of times of traversal, starting from head node\n $lastIndex = $this->size - 1 ;\n $travCount = $lastIndex - $n - 1; // traverse 1 less time since starting from head node\n $curr = $this->head;\n\n for ($i=0; $i <= $travCount; $i++) { \n $curr = $curr->next;\n }\n return $curr->data;\n }", "public function getOffsetStart()\n\t{\n\t\treturn $this->start + 1;\n\t}", "public function getLeaderLineOffset() {}", "function getOffset(){\r\n $t=time()+microtime()-$this->api->start_time;\r\n $res=$t-$this->offset;\r\n $this->offset=$t;\r\n return $res;\r\n }", "protected function setIndexAtMax()\n {\n return count($this->segments) - 1;\n }", "function Rear() {\n if ($this->isEmpty()){\n return -1;\n }\n return $this->data[($this->rear+$this->size-1)%$this->size];\n }", "public function getOffset() {\n // page 1 has an offset of 0 (1-1) * 20\n // page 2 has an offset of 20 (2-1) * 20\n // in other words, page 2 starts with item 21\n return ( $this->currentPage - 1 ) * $this->perPage;\n }", "public function prev()\n {\n --$this->offset;\n }", "public function getLastCharIndex() {}", "public function getUtcOffset(){\n $datetime = new DateTime('now', 'UTC');\n return parent::getOffset($datetime);\n }", "public function preceding(int $offset): mixed;", "public function getOffset() { return $this->_offset; }", "public function get_offset(){\r\n return $this->$new_offset;\r\n }", "function offset_pos(){\n\t // $this->count_uri();\n\n\t \tif(isset($this->uri_array['osp']))\n\t\t{\n\t \t\t//ops without and with offset page value\n\t \t\tif(count($this->uri_array['osp'])==1){\n\t \t\t\t$pos = $this->count_uri()+1;\n\t \t\t}else{\n\t\t\t\t$segment_array = $this->uri->segment_array();\n\t\t\t\t$pos = array_search(RAPYD_URI_OSP,$segment_array)+1;\n\t \t\t}\n\t \t}\n\n\t \t/*****************************************************************************\n\t \t * We take care of this case even if we have added it in explode_uri for more\n\t \t * security in URI reading\n\t \t *****************************************************************************/\n\t \telse{\n\t \t\t$pos = $this->count_uri()+2;\n\t \t}\n\t\treturn $pos;\n\t}", "public function last()\n {\n $this->cursor = $this->length - 1;\n\n return $this->current();\n }", "public function slice(int $start, ?int $length = null): VectorInterface;", "public function getEndPosition($position) {\n $endPosition = $position;\n for ($i = $position; $i < $this->length; $i++) {\n if ($this->words[$i]['processed'] || $this->isModifierPosition($i)) {\n $endPosition = $i - 1;\n break;\n }\n $endPosition = $i;\n }\n return $endPosition;\n }", "private function getOldestZoneIndex() {\n\n assert( $this->locks::$oldestZoneIndex->isLockedForRead() );\n\n $data = shmop_read( $this->shm, $this->metaArea->startOffset + $this->LONG_SIZE, $this->LONG_SIZE );\n $index = unpack( 'l', $data )[ 1 ];\n\n if ( !is_int( $index ) ) {\n trigger_error( 'Could not find the oldest zone index' );\n return -1;\n }\n\n assert( $index >= 0 );\n assert( $index < $this->ZONE_COUNT );\n\n return $index;\n }", "public function addLastCounts( $value){\n return $this->_add(8, $value);\n }", "private function getOffsetPaginacao()\n {\n if (!isset($this->filtros['pagina']) || !is_numeric($this->filtros['pagina'])) {\n return 0;\n }\n\n return (int)($this->filtros['pagina'] * $this->getLengthPaginacao()) - $this->getLengthPaginacao();\n }", "public function getLast(): int {\n return $this->last;\n }", "public function getOffset() {\n return $this->offset;\n }", "public function last(int $limit = 10, int $offset = 0)\n {\n return is_array($this->data) ? array_slice($this->data, -($offset + $limit), $limit) : $this->data;\n }" ]
[ "0.6184288", "0.5869342", "0.5548657", "0.53165996", "0.5278075", "0.5256761", "0.5218838", "0.5196203", "0.5167473", "0.50806606", "0.50633454", "0.49882317", "0.4983374", "0.49206883", "0.4891835", "0.48677522", "0.4832852", "0.47968096", "0.4789541", "0.4747482", "0.47405192", "0.47163147", "0.47030765", "0.4687677", "0.46852127", "0.46484962", "0.46128428", "0.45733866", "0.45724916", "0.45463744", "0.45276478", "0.4524593", "0.45152503", "0.45055154", "0.44979563", "0.44911918", "0.44911918", "0.44911918", "0.44866303", "0.4484379", "0.44788486", "0.4474843", "0.44728535", "0.44595313", "0.4454395", "0.44497368", "0.44476995", "0.4446843", "0.4446843", "0.4446843", "0.44175684", "0.44166142", "0.4409108", "0.4408793", "0.4400677", "0.43952248", "0.43853247", "0.43777978", "0.43661442", "0.43563592", "0.43281928", "0.4305532", "0.43047416", "0.43011963", "0.42853352", "0.42665693", "0.4265742", "0.4240046", "0.42398706", "0.4238658", "0.4235977", "0.42305198", "0.42302313", "0.42285192", "0.42211574", "0.42129102", "0.4203176", "0.41934875", "0.41874763", "0.41868278", "0.41866207", "0.4183256", "0.41810527", "0.41779935", "0.4163309", "0.41628772", "0.41593856", "0.4151665", "0.41478628", "0.41463706", "0.41405433", "0.41375476", "0.41292137", "0.4128133", "0.41168946", "0.41111526", "0.41091478", "0.4108503", "0.41079745", "0.41077518" ]
0.77066344
0
Log a message if a post is deleted
public function setControllerContext(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint) { $this->controllerContext = $joinPoint->getMethodArgument('controllerContext'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleted(Post $post)\n {\n $post->recordActivity('deleted');\n }", "public function deleteAction() {\n\t\t// if($post->delete()) {\n\t\t// \tSession::message([\"Post <strong>$post->name</strong> deleted!\" , \"success\"]);\n\t\t// \tredirect_to('/posts/index');\n\t\t// } else {\n\t\t// \tSession::message([\"Error saving! \" . $error->get_errors() , \"success\"]);\n\t\t// }\n\t}", "public function deleted_post($post_id)\n {\n }", "public function deleted(Post $post)\n {\n //\n $this->postElasticSearch->deleteDoc($post->id);\n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "public function forceDeleted(Post $post)\n {\n }", "public function deleted(BlogPost $blogPost)\n\t{\n\t\t//\n\t}", "public function destroy(Post $post)\n {\n $post->delete();\n return ['message'=>'Deleted successfully'];\n }", "public function forceDeleted(Post $post)\n {\n //\n }", "public function forceDeleted(Post $post)\n {\n //\n }", "public function delete() {\n\t\t$query = new WP_Query( array(\n\t\t\t'name' => $this->params['post_name'],\n\t\t\t'post_type' => $this->params['post_type']\n\t\t) );\n\n\t\t$post = array_shift( $query->posts );\n\n\t\t// die('<pre>'.var_export($post,true).'</pre>');\n\n\t\tif ( $post ) {\n\t\t\t$current_action = $this->get_current_action();\n\t\t\t$this->action_results[ 'status' ] = 'success';\n\t\t\t$this->action_results[ 'messages' ][ $post->post_type ][ $post->ID ][ 'note' ] = __( 'The information has been deleted', 'kickpress' );\n\t\t\t$this->action_results[ 'data' ][ 'post_id' ] = $post->ID;\n\n\t\t\twp_trash_post( $post->ID );\n\t\t}\n\t}", "function _update_posts_count_on_delete($post_id, $post)\n {\n }", "public function deleted(Post $post)\n {\n Category::where('id', $post->category)\n ->where('num', '>', 0)->decrement('num');\n Tag::whereIn('id', explode(',', $post->tags))\n ->where('num', '>', 0)->decrement('num');\n Archive::where('month', $post->archive)->where('num', '>', 0)->decrement('num');\n Archive::where('num', 0)->forceDelete();\n }", "public function isDeleted() {}", "public function isDeleted() {}", "public function delete($idPost);", "public function delete()\n\n {\n Customers::find($this->deleteId)->delete();\n session()->flash('message', 'Post Deleted Successfully.');\n\n }", "public function destroy($post_id)\n {\n $post = BlogPost::findOrFail($post_id);\n if(Auth::id() == $post->user_id) {\n $post->delete();\n return redirect()->route('posts.index')->withMessage('...and we shall never see it\\'s like again. And now, it\\'s watch has ended.');\n }else{\n return redirect('/')->withWarning(\"Thats not your post, mate.\");\n }\n\n\n\n }", "public function onAfterDelete();", "public function processDelete(): void \n {\n if ($this->delete()) { // The tag is deleted in the database storage.\n auth()->user()->logActivity($this, 'Tags', 'Has deleted an issue tag with the name ' . $this->name);\n flash(\"The ticket tag with the name <strong>{$this->name}</strong> has been deleted in the application.\")->info()->important();\n }\n }", "function Log_remove($post)\r\n {\r\n if(isset($post['action']) && $post['action']=='delete')\r\n {\r\n $table_name=(isset($post['table']) && $post['table']=='Admin_logs') ? 'Admin_logs' : 'User_logs';\r\n //delete certain log\r\n if(isset($post['id']) && intval($post['id'])>0)\r\n {\r\n $query = $this->db->get_where(db_prefix.$table_name, array('id' => $post['id']),1);\r\n $email_list=$query->result_array();\r\n if(count($email_list)>0)\r\n {\r\n if($this->db->delete(db_prefix.$table_name, array('id' => intval($post['id']))) && $this->db->affected_rows()>0)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return \"not_deleted\";\r\n }\r\n }\r\n }\r\n //delete expired log\r\n if(isset($post['limit']) && $post['limit']=='expired')\r\n {\r\n $period = intval(config_get(\"system\",\"config\",\"history_kept\"));\r\n if($period>0)\r\n {\r\n $this->db->where(\"NOW()>DATE_ADD(time,INTERVAL '\".$period.\"' DAY)\");\r\n if($this->db->delete(db_prefix.$table_name) && $this->db->affected_rows()>0)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return \"not_deleted\";\r\n } \r\n } \r\n }\r\n //delete all log\r\n if(isset($post['limit']) && $post['limit']=='all')\r\n {\r\n if($this->db->delete(db_prefix.$table_name) && $this->db->affected_rows()>0)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return \"not_deleted\";\r\n } \r\n }\r\n return \"not_found\";\r\n }\r\n return \"not_found\";\r\n }", "function deletePost($postId)\n{\n $affectedLines = postDelete($postId);\n if ($affectedLines === false) {\n throw new Exception('Impossible de supprimer l\\'article');\n }\n else {\n header('Location: index.php?action=managePosts');\n }\n}", "public function isDeleted();", "public function isDeleted();", "protected function _postDelete()\n\t{\n\t}", "function delete()\n{\n\t$model = $this->getModel('logs');\n\t$read = $model->delete();\n\t$this->view_logs();\n}", "function _update_posts_count_on_delete( $post_id ) {\n\t$post = get_post( $post_id );\n\n\tif ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {\n\t\treturn;\n\t}\n\n\tupdate_posts_count();\n}", "public function delete($post_id) {\n //get user id.\n if (!isset($user_id)) {\n $user_id = $this->Session->read('Auth.User.id');\n }\n //check if is any\n $conditions = array('id' => $post_id, 'uid' => $user_id);\n if ($this->SocialPosts->hasAny($conditions)) {\n $delete_update['SocialPosts']['id'] = $post_id;\n $delete_update['SocialPosts']['deleted'] = 1;\n //remove post from everywhere \n if ($this->SocialPosts->save($delete_update)) {\n //check if any scheduled\n $cond = array('post_id' => $post_id);\n if ($this->SocialScheduled->hasAny($cond)) {\n $delete = array('post_id' => $post_id);\n //remove scheduled\n $this->SocialScheduled->deleteAll($delete);\n }\n $this->Session->setFlash(__(\"Post Succesfully Removed.\"), 'cake-success');\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__(\"Something Went Wrong! Please try again later.\"), 'cake-error');\n $this->redirect(array('action' => 'index'));\n }\n } else {\n //hmmm somebody sending http requests trying to delete posts?!\n $this->Session->setFlash(__(\"You are not authorized to perform this operation!\"), 'cake-error');\n $this->redirect(array('action' => 'index'));\n }\n }", "public function delete_log_entry( $id ) {\n\t\t$post = get_post( $id );\n\n\t\tif ( $this->post_type === $post->post_type ) {\n\t\t\t$r = wp_delete_post( $id );\n\t\t\tif ( ! empty( $r ) || false !== $r ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function destroy(post $post)\n {\n //\n }", "public function interceptDelete()\n\t{\n\t\t$user = $this->getService('com://admin/ninjaboard.model.people')->getMe();\n\t\t$rows = $this->getModel()->getList();\n\t\tforeach($rows as $row)\n\t\t{\n\t\t\t$topic = $this->getService('com://site/ninjaboard.model.topics')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($row->ninjaboard_topic_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\t\t\t$forum = $this->getService('com://site/ninjaboard.model.forums')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($topic->forum_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\n\t\t\t// @TODO we migth want to add an option later, wether or not to allow users to delete their own post.\n\t\t\tif($forum->post_permissions < 3 && $row->created_by != $user->id) {\n\t\t\t\tJError::raiseError(403, JText::_('COM_NINJABOARD_YOU_DONT_HAVE_THE_PERMISSIONS_TO_DELETE_OTHERS_TOPICS'));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function handle_deletion_cache( $post_id ) {\n\t\tif ( get_post_status( $post_id ) !== 'publish' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::$cache_trigger_url = get_permalink( $post_id );\n\t\tself::$status_before = 'publish';\n\t\tself::$status_after = 'delete';\n\t\tself::$suppress_notification = true;\n\t\tself::$which_cloudflare_method = __METHOD__;\n\n\t\tself::purge_cloudflare_cache();\n\t}", "public function destroy(Post $post)\n {\n $nombre = $post->titulo;\n\n $post->delete();\n\n return \"El post: \" . $nombre . \"ha sido eliminado\";\n }", "public function deleteAction() {\n\n //GET POST SUBJECT\n $post = Engine_Api::_()->core()->getSubject('sitereview_post');\n\n //GET LISTING SUBJECT\n $sitereview = $post->getParent('sitereview_listing');\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n if (!$sitereview->isOwner($viewer) && !$post->isOwner($viewer)) {\n return $this->_helper->requireAuth->forward();\n }\n\n //AUTHORIZATION CHECK\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, null, \"view_listtype_$sitereview->listingtype_id\")->isValid())\n return;\n\n //MAKE FORM\n $this->view->form = $form = new Sitereview_Form_Post_Delete();\n\n //CHECK METHOD\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n //FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n //PROCESS\n $table = Engine_Api::_()->getDbTable('posts', 'sitereview');\n $db = $table->getAdapter();\n $db->beginTransaction();\n $topic_id = $post->topic_id;\n try {\n $post->delete();\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n //GET TOPIC\n $topic = Engine_Api::_()->getItem('sitereview_topic', $topic_id);\n\n $href = ( null == $topic ? $sitereview->getHref() : $topic->getHref() );\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'closeSmoothbox' => true,\n 'parentRedirect' => $href,\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Post deleted.')),\n ));\n }", "protected function check_delete_permission($post)\n {\n }", "public function destroy(Post $post)\n {\n $post->delete();\n\n return \"ok\";\n }", "private function deletePost() {\n\t\tif( !isset($_SESSION['id']) ) {\n\t\t\treturn;\n\t\t}\n\t\t// Make sure the user owns this post\n\t\t$postID = $this->dbc->real_escape_string($_GET['postid']);\n\t\t$userID = $_SESSION['id'];\n\t\t$privilege = $_SESSION['privilege'];\n\t\t\n\t\t// If the user is not an admin\n\t\tif( $privilege != 'admin' ) {\n\t\t\t$sql .= \" AND user_id = $userID\";\n\t\t}\n\t\t// Run this query\n\t\t$result = $this->dbc->query($sql);\n\t\t// If the query failed\n\t\t// Either post doesn't exist, or you don't own the post\n\t\tif( !$result || $result->num_rows == 0 ) {\n\t\t\treturn;\n\t\t}\n\t\t$result = $result->fetch_assoc();\n\t\t\n\t\t// Prepare the SQL\n\t\t$sql = \"DELETE FROM posts\n\t\t\t\tWHERE id = $postID\";\n\t\t// Run the query\n\t\t$this->dbc->query($sql);\n\t\t// Redirect the user back to blog\n\t\t// This post is dead :(\n\t\theader('Location: index.php?page=blog');\n\t\tdie();\n\t}", "function delete_post( $post_id ) {\n\t\t\t$this->model->remove_indexed_entry_for_blog( $post_id, $this->db->blogid );\n\t\t}", "public function delete(Request $request)\n {\n //checks if the post to delete is users own post\n if (auth()->user() != Post::find($request->post_id)->user) {\n return 'Du kannst nur deine eigenen Posts löschen';\n }\n\n //todo: use Route model binding (here and on similar expressions)\n $post = Post::find(request('post_id'));\n\n //deletes posts body if ist has answers\n if ($post->children->isNotEmpty()) {\n $post->body = '-Inhalt wurde gelöscht-';\n $post->save();\n }\n\n else {\n $post->delete();\n }\n\n return redirect()->back();\n }", "public function destroy(Post $post ,Request $request){\n\n // $this->authorize('delete', $notice);\n\n\n $post->delete();\n\n $request->session()->flash('message', 'Post was deleted');\n\n return back();\n }", "public static function del_auction_logs( $post_id){\n global $wpdb;\n if ( $wpdb->get_var( $wpdb->prepare( 'SELECT auction_id FROM '.$wpdb -> prefix .'wauc_auction_log WHERE auction_id = %d', $post_id ) ) )\n return $wpdb->query( $wpdb->prepare( 'DELETE FROM '.$wpdb -> prefix .'wauc_auction_log WHERE auction_id = %d', $post_id ) );\n\n return true;\n }", "public function destroy(Post $post)\n{\n if ($post->user_id !== auth()->id()) {\n return redirect()->route('posts.index')\n ->with('error', 'You cannot delete this post');\n }\n $post->delete();\n return redirect()->route('posts.index')\n ->with('success', 'Post deleted successfully');\n}", "protected function onDelete() {\n\t\tif (!$this->post = $this->loadPost()) {\n\t\t\treturn null;\n\t\t}\n\t\t$this->post->delete();\n\t\t// $this->onRun();\n\t\treturn Redirect(Request::url());\n\t}", "public function deleting(Post $post)\n {\n //-------we delete picture and comments before deletd post -----------\n\n $post->picture()->delete();\n $post->comments()->delete();\n // delete picture physicly and comments before delete physic post and after post is deleted logic =>(picture,comments was deleted)\n if($post->deleted_at)\n {\n $post->comments()->forceDelete();\n $post->picture()->forceDelete();\n }\n }", "function deletePost($id)\n {\n $userLogged = Auth::check(['administrateur']);\n\n $errors = [];\n \n // we delete the comments linked to the post (if there are any) \n $commentManager = new CommentManager();\n $listCommentsDelete = $commentManager->getListCommentsForPost($id);\n \n if ($listCommentsDelete !== []) {\n foreach($listCommentsDelete as $comment){\n try{\n $commentManager->deleteComment($comment->getId()); //deletion from the database \n } catch (Exception $e) {\n $errors[] = $e->getMessage();\n }\n }\n }\n \n // we delete the media linked to the post (if there is any) \n $mediaManager = new MediaManager();\n $listMediasDelete = $mediaManager->getListMediasForPost($id);// we get the media list for this $ post \n \n if ($listMediasDelete !== []) {\n foreach($listMediasDelete as $media){\n try{\n unlink($media->getPath()); //delete media on the server in the media folder \n $mediaManager->deleteMedia($media->getId()); //deletion from the database \n } catch (Exception $e) {\n $errors[] = $e->getMessage();\n } \n }\n }\n \n // we delete the post \n $postManager = new PostManager();\n try{\n $post = $postManager->deletePost($id);\n } catch (Exception $e) {\n $errors[] = $e->getMessage();\n } \n\n setFlashErrors($errors);\n\n require'../app/Views/backViews/post/backDeletePostView.php';\n }", "public function destroy(Post $post) {\n $this -> authorize('delete', $post); // this will throw an exception and render out status code 403\n $post -> delete();\n\n return back();\n }", "public function destroy(Post $post) {\n //\n }", "public function delete($post_id = NULL) {\n\t\t\n\t\t# Sanitize by ensuring $post_id is numeric \n\t\tif (is_numeric($post_id)) {\n\t\t\t\n\t\t\t# Ensure post to be deleted matches on post_id AND user_id of current user\n\t\t\t# to prevent users from altering URL to delete other people's posts\n\t\t\t$where_condition = \"WHERE\n\t\t\t\tuser_id = \".$this->user->user_id.\"\n\t\t\t\tAND post_id = \".$post_id;\n\t\t\t\t\n\t\t\tDB::instance(DB_NAME)->delete(\"posts\", $where_condition);\n\t\t\t\n\t\t\tRouter::redirect('/posts/stream/yours');\n\t\t}\n\t\telse {\n\t\t\tRouter::redirect('/posts/stream/yours');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "public function deleted() {\n // TODO Implement this\n }", "function qa_wall_delete_post($userid, $handle, $cookieid, $message)\n{\n\trequire_once QA_INCLUDE_DIR . 'db/messages.php';\n\n\tqa_db_message_delete($message['messageid']);\n\tqa_db_user_recount_posts($message['touserid']);\n\n\tqa_report_event('u_wall_delete', $userid, $handle, $cookieid, array(\n\t\t'messageid' => $message['messageid'],\n\t\t'oldmessage' => $message,\n\t));\n}", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function onAfterDelete() {\r\n\t\tparent::onAfterDelete();\r\n\t\t$this->zlog('Delete');\r\n\t}", "public function delete_post($postid)\n {\n hooks()->do_action('before_delete_post', $postid);\n echo json_encode([\n 'success' => $this->mention_model->delete_post($postid),\n ]);\n }", "public function destroy(Post $post)\n {\n $post->delete();\n\n if (Auth::user()->admin && Auth::id() !== $post->user_id) {\n // if Post was deleted by an admin user, send notification to User who posted post\n $post->user->notify(new PostDeletedByAdmin());\n }\n\n return redirect()\n ->route('home')\n ->with('message', 'Post deleted.');\n }", "protected function onDeleted()\n {\n return true;\n }", "function user_can_delete_post($user_id, $post_id, $blog_id = 1)\n {\n }", "public function delete( $post=null, $config=null ) {\n\n $re = $post->delete();\n\n if ( is_success($re) ) success( ['idx' => in('idx') ]);\n else error( $re );\n\n }", "public function onAfterDelete() {\n\t\tparent::onAfterDelete();\n\n\t\tif($this->isPublished()) {\n\t\t\t$this->doUnpublish();\n\t\t}\n\t}", "public function destroy(Post $post)\n {\n $image_one=$post->post_image;\n $path_imgone=('/media/post/'. $image_one);\n $nn=File::delete(public_path($path_imgone));\n $post->delete();\n $notification = array(\n 'message' => 'Data Inserted Successfully', \n 'alert-type' => 'warning');\n return redirect('/blog/post')->with($notification);\n }", "public function delete(User $user, Post $post);", "public function destroy(Post $post)\n {\n if($post->delete()) \n { \n return back()->with('success','Post was deleted');\n } \n else \n { \n return back()->with('error','there was a problem with deleting');\n }\n }", "function block_core_calendar_update_has_published_post_on_delete($post_id)\n {\n }", "public function destroy($post_id)\n {\n\n }", "function admin_delete($id)\n {\n $this->lordModel('Post');\n //$this->Post->delete($id);\n $this->session->setflash('mon contenu a bien ete supprimer');\n $this->redirect('admin/posts/index');\n }", "public function delete_post( $post ) \n\t{\n\t\t$term = new Zend_Search_Lucene_Index_Term( $post->id, 'postid' );\n\t\t$docIds = $this->_index->termDocs( $term );\n\t\tforeach ( $docIds as $id ) {\n\t\t\t$this->_index->delete( $id );\n\t\t}\n\t}", "public function destroy(Post $post)\n {\n/* \n $user = Auth::user();\n if (Gate::forUser($user)->denies('delete-post', $post)) {\n return redirect()->back();\n } */\n\n /* if (Auth::user()->cant('delete', $post)) {\n return redirect()->route('posts.my')->with('message','No tienes permisos para eliminar este post');\n } */\n\n $this->authorize('delete', $post);\n $post->delete();\n \n return redirect()->route('posts.index')->with('message','Post Eliminado');\n \n }", "public function destroy(Request $request, Post $post)\n {\n try {\n $post->update(['updated_by' => Auth::user()->id]);\n $post->delete();\n }catch (\\Exception $exception){\n dd($exception->getMessage());\n }\n\n Session::flash('danger', 'پست مورد نظر با موفقیت پاک شد');\n\n if($request->header('referer') == URL::to('/posts/drafts')) {\n return redirect(route('posts.draft'));\n }\n\n return redirect(route('posts.index'));\n }", "public function deleting(Post $post)\n {\n if ($post->image) {\n Storage::delete([$post->image->url]);\n }\n }", "public function delete($id){\n \n //Check if record id is passed\n if($id){\n \n Post::where('id',$id)->delete();\n session()->flash('message','Post Deleted Successfully');\n }\n }", "public function delete() {\n\t\t$db = self::getDB();\n\t\t$sql = \"DELETE FROM posts \n\t\t\t\tWHERE\n\t\t\t\t\tidPost = :idPost \";\n\t\t$query = $db->prepare($sql);\n\t\t$query->execute([\n\t\t\t':idPost' => $this->getIdPost()\n\t\t]);\n\t}", "public function onBeforeDelete();", "protected function _afterDelete()\r\n {\r\n $this->updatePostCommentCount();\r\n parent::_afterDelete();\r\n\r\n }", "protected function _postDelete()\n\t{\n\t\t//register events\n\t\t\\Base\\Event::trigger('user.delete',$this->id);\n\t\t//end events\n\t}", "public function delete($id){\n\n if($this->Blog->delete($id)){\n $this->Session->setFlash(__('Your blog and blog posts have been removed'), 'success');\n $this->redirect($this->referer());\n }else{\n $this->Session->setFlash(__('There was a problem removing your blog'), 'error');\n $this->redirect($this->referer());\n }\n\n }", "function edithistory_delete_post($pid)\n{\n\tglobal $db, $mybb;\n\t$db->delete_query(\"edithistory\", \"pid='{$pid}'\");\n}", "public function deleteAction()\n {\n $postId = (int)$this->params()->fromRoute('id', -1);\n \n // Validate input parameter\n if ($postId<0) {\n $this->getResponse()->setStatusCode(404);\n return;\n }\n \n $post = $this->entityManager->getRepository(Post::class)\n ->findOneById($postId); \n if ($post == null) {\n $this->getResponse()->setStatusCode(404);\n return; \n }\n \n if (!$this->access('post.own.delete', ['post'=>$post])) {\n return $this->redirect()->toRoute('not-authorized');\n }\n \n $this->postManager->removePost($post);\n $this->imageManager->removePost($postId);\n $this->videoManager->removePost($postId);\n $this->audioManager->removePost($postId);\n \n // Redirect the user to \"admin\" page.\n return $this->redirect()->toRoute('posts', ['action'=>'admin']); \n \n }", "public function destroy(post $post)\n {\n $post->delete();\n return redirect()->route('posts.index')->with('message', 'Deleted successful!');\n }", "public function forceDeleted(Post $post)\n {\n $post->recordActivity('forceDeleted');\n $post->deleteImage($post->image);\n }", "public function destroy($id)\n {\n $post=Post::find($id);\n if($post['user_id']==auth()->user()->id){\n $post->delete();\n return response(['message'=>\"deleted successfully\"]);}\n else {return response(['message'=>'Post is not yours']);}\n\n }", "public function deleteFromNotificationList($postID) {\n $sqlQuery = \"delete from laf873.notifications where ntf_postID = ?\";\n\n $statement = $this->_dbHandle->prepare($sqlQuery);\n $statement->execute([$postID]);\n }", "public function deleting(BlogPost $blogPost)\n\t{\n\t\t//\n\t}", "function admin_delete($id){\n $this->loadModel('Post');\n $this->Post->delete($id);\n $this->Session->setFlash('Le contenu à bien été supprimée');\n\n $this->redirect('admin/posts/index');\n }", "public function testDelete(): void\n {\n $this->markTestSkipped('Skipping as PostsService::delete() is not yet ready for prod/testing');\n $this->mock(PostsRepository::class, static function ($mock) {\n $mock->shouldReceive('find')->with(123)->andReturn(new Post());\n $mock->shouldReceive('delete')->with(123)->andReturn(true);\n });\n\n $service = resolve(PostsService::class);\n\n $this->expectsEvents(BlogPostWillBeDeleted::class);\n\n $response = $service->delete(123);\n\n $this->assertIsArray($response);\n }", "public function deleteActionPost(): object\n {\n // Connects to db\n $this->app->db->connect();\n\n $contentId = getPost(\"contentId\");\n\n if (!is_numeric($contentId)) {\n return $this->app->response->redirect(\"admin\");\n }\n\n if (hasKeyPost(\"doDelete\")) {\n $contentId = getPost(\"contentId\");\n\n // Executes SQL statement\n $this->admin->deleteBlogpost($contentId);\n\n // Redirects\n return $this->app->response->redirect(\"admin\");\n }\n }", "public function delete() {\r\n\t\tSmsirLogs::where('id',Route::current()->parameters['log'])->delete();\r\n\t\t// return the user back to sms-admin after delete the log\r\n\t\treturn back();\r\n\t}" ]
[ "0.7689148", "0.7158648", "0.70967185", "0.7057911", "0.6769922", "0.676964", "0.676564", "0.67358506", "0.66910696", "0.6658645", "0.6658645", "0.6627241", "0.65390486", "0.6527608", "0.6523617", "0.65225905", "0.6485975", "0.64722925", "0.6468833", "0.64633214", "0.64574295", "0.64248264", "0.64173687", "0.64170957", "0.64170957", "0.64086396", "0.637936", "0.6370152", "0.63676447", "0.6365725", "0.63187253", "0.6315543", "0.6310119", "0.62948835", "0.62831604", "0.62774557", "0.6269046", "0.6265203", "0.6265073", "0.62633425", "0.62575865", "0.62558067", "0.6250318", "0.62468714", "0.624388", "0.62418336", "0.62387127", "0.6231163", "0.62267977", "0.62190664", "0.62164956", "0.62135047", "0.62135047", "0.62135047", "0.62135047", "0.62135047", "0.62135047", "0.62135047", "0.62135047", "0.62135047", "0.62135047", "0.62135047", "0.62135047", "0.62135047", "0.62135047", "0.62135047", "0.62135047", "0.6201478", "0.61932886", "0.61874336", "0.6179939", "0.6175677", "0.61713964", "0.61695546", "0.6157508", "0.6155798", "0.6148163", "0.61423", "0.61413896", "0.6139737", "0.6138359", "0.61360514", "0.6128455", "0.61284345", "0.61256576", "0.6124294", "0.6121842", "0.61217016", "0.61202615", "0.6119117", "0.61121064", "0.61119145", "0.61118436", "0.6109052", "0.6101971", "0.6084781", "0.6083911", "0.60831934", "0.6079492", "0.60791457", "0.6076709" ]
0.0
-1
Log a message if a post is deleted
public function replacePlaceholdersIfNecessary(\TYPO3\Flow\Aop\JoinPointInterface $joinPoint) { $result = $joinPoint->getAdviceChain()->proceed($joinPoint); /* @var $typoScriptView TypoScriptView */ $typoScriptView = $joinPoint->getProxy(); $viewVariables = ObjectAccess::getProperty($typoScriptView, 'variables', TRUE); if (!isset($viewVariables['value']) || !$viewVariables['value']->getNodeType()->isOfType('Sandstorm.Newsletter:Newsletter')) { // No newsletter, so logic does not apply return $result; } /* @var $httpRequest Request */ $httpRequest = $this->controllerContext->getRequest()->getHttpRequest(); $arguments = $httpRequest->getUri()->getArguments(); if (!isset($arguments['hmac'])) { if ($this->securityContext->isInitialized() && $this->securityContext->hasRole('TYPO3.Neos:Editor')) { // Logged into backend, so we don't need to do anything. return $result; } else { // No HMAC sent -- so we return the email INCLUDING placeholders (as per customer's request) return $result; //return '<h1>Error: HMAC not included in the link.</h1>'; } } $actualHmac = $arguments['hmac']; $uriWithoutHmac = str_replace('&hmac=' . $actualHmac, '', (string)$httpRequest->getUri()); $expectedHmac = hash_hmac('sha1', urldecode($uriWithoutHmac), $this->hmacUrlSecret); if ($expectedHmac !== $actualHmac) { return '<h1>Error: Wrong link clicked.</h1>Please contact your administrator for help'; } $result = preg_replace_callback(ReplacePlaceholdersInLiveImplementation::PLACEHOLDER_REGEX, function($element) use($arguments) { return ObjectAccess::getPropertyPath($arguments, $element[1]); }, $result); return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleted(Post $post)\n {\n $post->recordActivity('deleted');\n }", "public function deleteAction() {\n\t\t// if($post->delete()) {\n\t\t// \tSession::message([\"Post <strong>$post->name</strong> deleted!\" , \"success\"]);\n\t\t// \tredirect_to('/posts/index');\n\t\t// } else {\n\t\t// \tSession::message([\"Error saving! \" . $error->get_errors() , \"success\"]);\n\t\t// }\n\t}", "public function deleted_post($post_id)\n {\n }", "public function deleted(Post $post)\n {\n //\n $this->postElasticSearch->deleteDoc($post->id);\n }", "protected function _postDelete() {}", "protected function _postDelete() {}", "public function forceDeleted(Post $post)\n {\n }", "public function deleted(BlogPost $blogPost)\n\t{\n\t\t//\n\t}", "public function destroy(Post $post)\n {\n $post->delete();\n return ['message'=>'Deleted successfully'];\n }", "public function forceDeleted(Post $post)\n {\n //\n }", "public function forceDeleted(Post $post)\n {\n //\n }", "public function delete() {\n\t\t$query = new WP_Query( array(\n\t\t\t'name' => $this->params['post_name'],\n\t\t\t'post_type' => $this->params['post_type']\n\t\t) );\n\n\t\t$post = array_shift( $query->posts );\n\n\t\t// die('<pre>'.var_export($post,true).'</pre>');\n\n\t\tif ( $post ) {\n\t\t\t$current_action = $this->get_current_action();\n\t\t\t$this->action_results[ 'status' ] = 'success';\n\t\t\t$this->action_results[ 'messages' ][ $post->post_type ][ $post->ID ][ 'note' ] = __( 'The information has been deleted', 'kickpress' );\n\t\t\t$this->action_results[ 'data' ][ 'post_id' ] = $post->ID;\n\n\t\t\twp_trash_post( $post->ID );\n\t\t}\n\t}", "function _update_posts_count_on_delete($post_id, $post)\n {\n }", "public function deleted(Post $post)\n {\n Category::where('id', $post->category)\n ->where('num', '>', 0)->decrement('num');\n Tag::whereIn('id', explode(',', $post->tags))\n ->where('num', '>', 0)->decrement('num');\n Archive::where('month', $post->archive)->where('num', '>', 0)->decrement('num');\n Archive::where('num', 0)->forceDelete();\n }", "public function isDeleted() {}", "public function isDeleted() {}", "public function delete($idPost);", "public function delete()\n\n {\n Customers::find($this->deleteId)->delete();\n session()->flash('message', 'Post Deleted Successfully.');\n\n }", "public function destroy($post_id)\n {\n $post = BlogPost::findOrFail($post_id);\n if(Auth::id() == $post->user_id) {\n $post->delete();\n return redirect()->route('posts.index')->withMessage('...and we shall never see it\\'s like again. And now, it\\'s watch has ended.');\n }else{\n return redirect('/')->withWarning(\"Thats not your post, mate.\");\n }\n\n\n\n }", "public function onAfterDelete();", "public function processDelete(): void \n {\n if ($this->delete()) { // The tag is deleted in the database storage.\n auth()->user()->logActivity($this, 'Tags', 'Has deleted an issue tag with the name ' . $this->name);\n flash(\"The ticket tag with the name <strong>{$this->name}</strong> has been deleted in the application.\")->info()->important();\n }\n }", "function Log_remove($post)\r\n {\r\n if(isset($post['action']) && $post['action']=='delete')\r\n {\r\n $table_name=(isset($post['table']) && $post['table']=='Admin_logs') ? 'Admin_logs' : 'User_logs';\r\n //delete certain log\r\n if(isset($post['id']) && intval($post['id'])>0)\r\n {\r\n $query = $this->db->get_where(db_prefix.$table_name, array('id' => $post['id']),1);\r\n $email_list=$query->result_array();\r\n if(count($email_list)>0)\r\n {\r\n if($this->db->delete(db_prefix.$table_name, array('id' => intval($post['id']))) && $this->db->affected_rows()>0)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return \"not_deleted\";\r\n }\r\n }\r\n }\r\n //delete expired log\r\n if(isset($post['limit']) && $post['limit']=='expired')\r\n {\r\n $period = intval(config_get(\"system\",\"config\",\"history_kept\"));\r\n if($period>0)\r\n {\r\n $this->db->where(\"NOW()>DATE_ADD(time,INTERVAL '\".$period.\"' DAY)\");\r\n if($this->db->delete(db_prefix.$table_name) && $this->db->affected_rows()>0)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return \"not_deleted\";\r\n } \r\n } \r\n }\r\n //delete all log\r\n if(isset($post['limit']) && $post['limit']=='all')\r\n {\r\n if($this->db->delete(db_prefix.$table_name) && $this->db->affected_rows()>0)\r\n {\r\n return true;\r\n }\r\n else\r\n {\r\n return \"not_deleted\";\r\n } \r\n }\r\n return \"not_found\";\r\n }\r\n return \"not_found\";\r\n }", "function deletePost($postId)\n{\n $affectedLines = postDelete($postId);\n if ($affectedLines === false) {\n throw new Exception('Impossible de supprimer l\\'article');\n }\n else {\n header('Location: index.php?action=managePosts');\n }\n}", "public function isDeleted();", "public function isDeleted();", "protected function _postDelete()\n\t{\n\t}", "function delete()\n{\n\t$model = $this->getModel('logs');\n\t$read = $model->delete();\n\t$this->view_logs();\n}", "function _update_posts_count_on_delete( $post_id ) {\n\t$post = get_post( $post_id );\n\n\tif ( ! $post || 'publish' !== $post->post_status || 'post' !== $post->post_type ) {\n\t\treturn;\n\t}\n\n\tupdate_posts_count();\n}", "public function delete($post_id) {\n //get user id.\n if (!isset($user_id)) {\n $user_id = $this->Session->read('Auth.User.id');\n }\n //check if is any\n $conditions = array('id' => $post_id, 'uid' => $user_id);\n if ($this->SocialPosts->hasAny($conditions)) {\n $delete_update['SocialPosts']['id'] = $post_id;\n $delete_update['SocialPosts']['deleted'] = 1;\n //remove post from everywhere \n if ($this->SocialPosts->save($delete_update)) {\n //check if any scheduled\n $cond = array('post_id' => $post_id);\n if ($this->SocialScheduled->hasAny($cond)) {\n $delete = array('post_id' => $post_id);\n //remove scheduled\n $this->SocialScheduled->deleteAll($delete);\n }\n $this->Session->setFlash(__(\"Post Succesfully Removed.\"), 'cake-success');\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__(\"Something Went Wrong! Please try again later.\"), 'cake-error');\n $this->redirect(array('action' => 'index'));\n }\n } else {\n //hmmm somebody sending http requests trying to delete posts?!\n $this->Session->setFlash(__(\"You are not authorized to perform this operation!\"), 'cake-error');\n $this->redirect(array('action' => 'index'));\n }\n }", "public function delete_log_entry( $id ) {\n\t\t$post = get_post( $id );\n\n\t\tif ( $this->post_type === $post->post_type ) {\n\t\t\t$r = wp_delete_post( $id );\n\t\t\tif ( ! empty( $r ) || false !== $r ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function destroy(post $post)\n {\n //\n }", "public function interceptDelete()\n\t{\n\t\t$user = $this->getService('com://admin/ninjaboard.model.people')->getMe();\n\t\t$rows = $this->getModel()->getList();\n\t\tforeach($rows as $row)\n\t\t{\n\t\t\t$topic = $this->getService('com://site/ninjaboard.model.topics')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($row->ninjaboard_topic_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\t\t\t$forum = $this->getService('com://site/ninjaboard.model.forums')\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->id($topic->forum_id)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t->getItem();\n\n\t\t\t// @TODO we migth want to add an option later, wether or not to allow users to delete their own post.\n\t\t\tif($forum->post_permissions < 3 && $row->created_by != $user->id) {\n\t\t\t\tJError::raiseError(403, JText::_('COM_NINJABOARD_YOU_DONT_HAVE_THE_PERMISSIONS_TO_DELETE_OTHERS_TOPICS'));\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function handle_deletion_cache( $post_id ) {\n\t\tif ( get_post_status( $post_id ) !== 'publish' ) {\n\t\t\treturn;\n\t\t}\n\n\t\tself::$cache_trigger_url = get_permalink( $post_id );\n\t\tself::$status_before = 'publish';\n\t\tself::$status_after = 'delete';\n\t\tself::$suppress_notification = true;\n\t\tself::$which_cloudflare_method = __METHOD__;\n\n\t\tself::purge_cloudflare_cache();\n\t}", "public function destroy(Post $post)\n {\n $nombre = $post->titulo;\n\n $post->delete();\n\n return \"El post: \" . $nombre . \"ha sido eliminado\";\n }", "public function deleteAction() {\n\n //GET POST SUBJECT\n $post = Engine_Api::_()->core()->getSubject('sitereview_post');\n\n //GET LISTING SUBJECT\n $sitereview = $post->getParent('sitereview_listing');\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n if (!$sitereview->isOwner($viewer) && !$post->isOwner($viewer)) {\n return $this->_helper->requireAuth->forward();\n }\n\n //AUTHORIZATION CHECK\n if (!$this->_helper->requireAuth()->setAuthParams($sitereview, null, \"view_listtype_$sitereview->listingtype_id\")->isValid())\n return;\n\n //MAKE FORM\n $this->view->form = $form = new Sitereview_Form_Post_Delete();\n\n //CHECK METHOD\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n //FORM VALIDATION\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n\n //PROCESS\n $table = Engine_Api::_()->getDbTable('posts', 'sitereview');\n $db = $table->getAdapter();\n $db->beginTransaction();\n $topic_id = $post->topic_id;\n try {\n $post->delete();\n $db->commit();\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n\n //GET TOPIC\n $topic = Engine_Api::_()->getItem('sitereview_topic', $topic_id);\n\n $href = ( null == $topic ? $sitereview->getHref() : $topic->getHref() );\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'closeSmoothbox' => true,\n 'parentRedirect' => $href,\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Post deleted.')),\n ));\n }", "protected function check_delete_permission($post)\n {\n }", "public function destroy(Post $post)\n {\n $post->delete();\n\n return \"ok\";\n }", "function delete_post( $post_id ) {\n\t\t\t$this->model->remove_indexed_entry_for_blog( $post_id, $this->db->blogid );\n\t\t}", "private function deletePost() {\n\t\tif( !isset($_SESSION['id']) ) {\n\t\t\treturn;\n\t\t}\n\t\t// Make sure the user owns this post\n\t\t$postID = $this->dbc->real_escape_string($_GET['postid']);\n\t\t$userID = $_SESSION['id'];\n\t\t$privilege = $_SESSION['privilege'];\n\t\t\n\t\t// If the user is not an admin\n\t\tif( $privilege != 'admin' ) {\n\t\t\t$sql .= \" AND user_id = $userID\";\n\t\t}\n\t\t// Run this query\n\t\t$result = $this->dbc->query($sql);\n\t\t// If the query failed\n\t\t// Either post doesn't exist, or you don't own the post\n\t\tif( !$result || $result->num_rows == 0 ) {\n\t\t\treturn;\n\t\t}\n\t\t$result = $result->fetch_assoc();\n\t\t\n\t\t// Prepare the SQL\n\t\t$sql = \"DELETE FROM posts\n\t\t\t\tWHERE id = $postID\";\n\t\t// Run the query\n\t\t$this->dbc->query($sql);\n\t\t// Redirect the user back to blog\n\t\t// This post is dead :(\n\t\theader('Location: index.php?page=blog');\n\t\tdie();\n\t}", "public function delete(Request $request)\n {\n //checks if the post to delete is users own post\n if (auth()->user() != Post::find($request->post_id)->user) {\n return 'Du kannst nur deine eigenen Posts löschen';\n }\n\n //todo: use Route model binding (here and on similar expressions)\n $post = Post::find(request('post_id'));\n\n //deletes posts body if ist has answers\n if ($post->children->isNotEmpty()) {\n $post->body = '-Inhalt wurde gelöscht-';\n $post->save();\n }\n\n else {\n $post->delete();\n }\n\n return redirect()->back();\n }", "public function destroy(Post $post ,Request $request){\n\n // $this->authorize('delete', $notice);\n\n\n $post->delete();\n\n $request->session()->flash('message', 'Post was deleted');\n\n return back();\n }", "public static function del_auction_logs( $post_id){\n global $wpdb;\n if ( $wpdb->get_var( $wpdb->prepare( 'SELECT auction_id FROM '.$wpdb -> prefix .'wauc_auction_log WHERE auction_id = %d', $post_id ) ) )\n return $wpdb->query( $wpdb->prepare( 'DELETE FROM '.$wpdb -> prefix .'wauc_auction_log WHERE auction_id = %d', $post_id ) );\n\n return true;\n }", "public function destroy(Post $post)\n{\n if ($post->user_id !== auth()->id()) {\n return redirect()->route('posts.index')\n ->with('error', 'You cannot delete this post');\n }\n $post->delete();\n return redirect()->route('posts.index')\n ->with('success', 'Post deleted successfully');\n}", "protected function onDelete() {\n\t\tif (!$this->post = $this->loadPost()) {\n\t\t\treturn null;\n\t\t}\n\t\t$this->post->delete();\n\t\t// $this->onRun();\n\t\treturn Redirect(Request::url());\n\t}", "public function deleting(Post $post)\n {\n //-------we delete picture and comments before deletd post -----------\n\n $post->picture()->delete();\n $post->comments()->delete();\n // delete picture physicly and comments before delete physic post and after post is deleted logic =>(picture,comments was deleted)\n if($post->deleted_at)\n {\n $post->comments()->forceDelete();\n $post->picture()->forceDelete();\n }\n }", "function deletePost($id)\n {\n $userLogged = Auth::check(['administrateur']);\n\n $errors = [];\n \n // we delete the comments linked to the post (if there are any) \n $commentManager = new CommentManager();\n $listCommentsDelete = $commentManager->getListCommentsForPost($id);\n \n if ($listCommentsDelete !== []) {\n foreach($listCommentsDelete as $comment){\n try{\n $commentManager->deleteComment($comment->getId()); //deletion from the database \n } catch (Exception $e) {\n $errors[] = $e->getMessage();\n }\n }\n }\n \n // we delete the media linked to the post (if there is any) \n $mediaManager = new MediaManager();\n $listMediasDelete = $mediaManager->getListMediasForPost($id);// we get the media list for this $ post \n \n if ($listMediasDelete !== []) {\n foreach($listMediasDelete as $media){\n try{\n unlink($media->getPath()); //delete media on the server in the media folder \n $mediaManager->deleteMedia($media->getId()); //deletion from the database \n } catch (Exception $e) {\n $errors[] = $e->getMessage();\n } \n }\n }\n \n // we delete the post \n $postManager = new PostManager();\n try{\n $post = $postManager->deletePost($id);\n } catch (Exception $e) {\n $errors[] = $e->getMessage();\n } \n\n setFlashErrors($errors);\n\n require'../app/Views/backViews/post/backDeletePostView.php';\n }", "public function destroy(Post $post) {\n $this -> authorize('delete', $post); // this will throw an exception and render out status code 403\n $post -> delete();\n\n return back();\n }", "public function destroy(Post $post) {\n //\n }", "public function delete($post_id = NULL) {\n\t\t\n\t\t# Sanitize by ensuring $post_id is numeric \n\t\tif (is_numeric($post_id)) {\n\t\t\t\n\t\t\t# Ensure post to be deleted matches on post_id AND user_id of current user\n\t\t\t# to prevent users from altering URL to delete other people's posts\n\t\t\t$where_condition = \"WHERE\n\t\t\t\tuser_id = \".$this->user->user_id.\"\n\t\t\t\tAND post_id = \".$post_id;\n\t\t\t\t\n\t\t\tDB::instance(DB_NAME)->delete(\"posts\", $where_condition);\n\t\t\t\n\t\t\tRouter::redirect('/posts/stream/yours');\n\t\t}\n\t\telse {\n\t\t\tRouter::redirect('/posts/stream/yours');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "public function deleted() {\n // TODO Implement this\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "public function destroy(Post $post)\n {\n //\n }", "function qa_wall_delete_post($userid, $handle, $cookieid, $message)\n{\n\trequire_once QA_INCLUDE_DIR . 'db/messages.php';\n\n\tqa_db_message_delete($message['messageid']);\n\tqa_db_user_recount_posts($message['touserid']);\n\n\tqa_report_event('u_wall_delete', $userid, $handle, $cookieid, array(\n\t\t'messageid' => $message['messageid'],\n\t\t'oldmessage' => $message,\n\t));\n}", "public function onAfterDelete() {\r\n\t\tparent::onAfterDelete();\r\n\t\t$this->zlog('Delete');\r\n\t}", "public function delete_post($postid)\n {\n hooks()->do_action('before_delete_post', $postid);\n echo json_encode([\n 'success' => $this->mention_model->delete_post($postid),\n ]);\n }", "public function destroy(Post $post)\n {\n $post->delete();\n\n if (Auth::user()->admin && Auth::id() !== $post->user_id) {\n // if Post was deleted by an admin user, send notification to User who posted post\n $post->user->notify(new PostDeletedByAdmin());\n }\n\n return redirect()\n ->route('home')\n ->with('message', 'Post deleted.');\n }", "protected function onDeleted()\n {\n return true;\n }", "function user_can_delete_post($user_id, $post_id, $blog_id = 1)\n {\n }", "public function delete( $post=null, $config=null ) {\n\n $re = $post->delete();\n\n if ( is_success($re) ) success( ['idx' => in('idx') ]);\n else error( $re );\n\n }", "public function onAfterDelete() {\n\t\tparent::onAfterDelete();\n\n\t\tif($this->isPublished()) {\n\t\t\t$this->doUnpublish();\n\t\t}\n\t}", "public function destroy(Post $post)\n {\n $image_one=$post->post_image;\n $path_imgone=('/media/post/'. $image_one);\n $nn=File::delete(public_path($path_imgone));\n $post->delete();\n $notification = array(\n 'message' => 'Data Inserted Successfully', \n 'alert-type' => 'warning');\n return redirect('/blog/post')->with($notification);\n }", "public function delete(User $user, Post $post);", "public function destroy(Post $post)\n {\n if($post->delete()) \n { \n return back()->with('success','Post was deleted');\n } \n else \n { \n return back()->with('error','there was a problem with deleting');\n }\n }", "function block_core_calendar_update_has_published_post_on_delete($post_id)\n {\n }", "public function destroy($post_id)\n {\n\n }", "public function delete_post( $post ) \n\t{\n\t\t$term = new Zend_Search_Lucene_Index_Term( $post->id, 'postid' );\n\t\t$docIds = $this->_index->termDocs( $term );\n\t\tforeach ( $docIds as $id ) {\n\t\t\t$this->_index->delete( $id );\n\t\t}\n\t}", "function admin_delete($id)\n {\n $this->lordModel('Post');\n //$this->Post->delete($id);\n $this->session->setflash('mon contenu a bien ete supprimer');\n $this->redirect('admin/posts/index');\n }", "public function destroy(Post $post)\n {\n/* \n $user = Auth::user();\n if (Gate::forUser($user)->denies('delete-post', $post)) {\n return redirect()->back();\n } */\n\n /* if (Auth::user()->cant('delete', $post)) {\n return redirect()->route('posts.my')->with('message','No tienes permisos para eliminar este post');\n } */\n\n $this->authorize('delete', $post);\n $post->delete();\n \n return redirect()->route('posts.index')->with('message','Post Eliminado');\n \n }", "public function destroy(Request $request, Post $post)\n {\n try {\n $post->update(['updated_by' => Auth::user()->id]);\n $post->delete();\n }catch (\\Exception $exception){\n dd($exception->getMessage());\n }\n\n Session::flash('danger', 'پست مورد نظر با موفقیت پاک شد');\n\n if($request->header('referer') == URL::to('/posts/drafts')) {\n return redirect(route('posts.draft'));\n }\n\n return redirect(route('posts.index'));\n }", "public function deleting(Post $post)\n {\n if ($post->image) {\n Storage::delete([$post->image->url]);\n }\n }", "public function delete($id){\n \n //Check if record id is passed\n if($id){\n \n Post::where('id',$id)->delete();\n session()->flash('message','Post Deleted Successfully');\n }\n }", "public function delete() {\n\t\t$db = self::getDB();\n\t\t$sql = \"DELETE FROM posts \n\t\t\t\tWHERE\n\t\t\t\t\tidPost = :idPost \";\n\t\t$query = $db->prepare($sql);\n\t\t$query->execute([\n\t\t\t':idPost' => $this->getIdPost()\n\t\t]);\n\t}", "protected function _afterDelete()\r\n {\r\n $this->updatePostCommentCount();\r\n parent::_afterDelete();\r\n\r\n }", "public function onBeforeDelete();", "public function delete($id){\n\n if($this->Blog->delete($id)){\n $this->Session->setFlash(__('Your blog and blog posts have been removed'), 'success');\n $this->redirect($this->referer());\n }else{\n $this->Session->setFlash(__('There was a problem removing your blog'), 'error');\n $this->redirect($this->referer());\n }\n\n }", "protected function _postDelete()\n\t{\n\t\t//register events\n\t\t\\Base\\Event::trigger('user.delete',$this->id);\n\t\t//end events\n\t}", "public function destroy(post $post)\n {\n $post->delete();\n return redirect()->route('posts.index')->with('message', 'Deleted successful!');\n }", "public function deleteAction()\n {\n $postId = (int)$this->params()->fromRoute('id', -1);\n \n // Validate input parameter\n if ($postId<0) {\n $this->getResponse()->setStatusCode(404);\n return;\n }\n \n $post = $this->entityManager->getRepository(Post::class)\n ->findOneById($postId); \n if ($post == null) {\n $this->getResponse()->setStatusCode(404);\n return; \n }\n \n if (!$this->access('post.own.delete', ['post'=>$post])) {\n return $this->redirect()->toRoute('not-authorized');\n }\n \n $this->postManager->removePost($post);\n $this->imageManager->removePost($postId);\n $this->videoManager->removePost($postId);\n $this->audioManager->removePost($postId);\n \n // Redirect the user to \"admin\" page.\n return $this->redirect()->toRoute('posts', ['action'=>'admin']); \n \n }", "function edithistory_delete_post($pid)\n{\n\tglobal $db, $mybb;\n\t$db->delete_query(\"edithistory\", \"pid='{$pid}'\");\n}", "public function forceDeleted(Post $post)\n {\n $post->recordActivity('forceDeleted');\n $post->deleteImage($post->image);\n }", "public function destroy($id)\n {\n $post=Post::find($id);\n if($post['user_id']==auth()->user()->id){\n $post->delete();\n return response(['message'=>\"deleted successfully\"]);}\n else {return response(['message'=>'Post is not yours']);}\n\n }", "function admin_delete($id){\n $this->loadModel('Post');\n $this->Post->delete($id);\n $this->Session->setFlash('Le contenu à bien été supprimée');\n\n $this->redirect('admin/posts/index');\n }", "public function deleteFromNotificationList($postID) {\n $sqlQuery = \"delete from laf873.notifications where ntf_postID = ?\";\n\n $statement = $this->_dbHandle->prepare($sqlQuery);\n $statement->execute([$postID]);\n }", "public function deleting(BlogPost $blogPost)\n\t{\n\t\t//\n\t}", "public function deleteActionPost(): object\n {\n // Connects to db\n $this->app->db->connect();\n\n $contentId = getPost(\"contentId\");\n\n if (!is_numeric($contentId)) {\n return $this->app->response->redirect(\"admin\");\n }\n\n if (hasKeyPost(\"doDelete\")) {\n $contentId = getPost(\"contentId\");\n\n // Executes SQL statement\n $this->admin->deleteBlogpost($contentId);\n\n // Redirects\n return $this->app->response->redirect(\"admin\");\n }\n }", "public function testDelete(): void\n {\n $this->markTestSkipped('Skipping as PostsService::delete() is not yet ready for prod/testing');\n $this->mock(PostsRepository::class, static function ($mock) {\n $mock->shouldReceive('find')->with(123)->andReturn(new Post());\n $mock->shouldReceive('delete')->with(123)->andReturn(true);\n });\n\n $service = resolve(PostsService::class);\n\n $this->expectsEvents(BlogPostWillBeDeleted::class);\n\n $response = $service->delete(123);\n\n $this->assertIsArray($response);\n }", "public function delete() {\r\n\t\tSmsirLogs::where('id',Route::current()->parameters['log'])->delete();\r\n\t\t// return the user back to sms-admin after delete the log\r\n\t\treturn back();\r\n\t}" ]
[ "0.76904964", "0.71596354", "0.7098235", "0.70602727", "0.6769632", "0.6769354", "0.67676395", "0.6736038", "0.6692676", "0.6660735", "0.6660735", "0.6628022", "0.65403104", "0.6528944", "0.6523094", "0.6522084", "0.64877915", "0.64719146", "0.64699566", "0.6461624", "0.6455594", "0.6423127", "0.641856", "0.641656", "0.641656", "0.6408761", "0.6377022", "0.637211", "0.636912", "0.6366223", "0.63211846", "0.63148534", "0.6311525", "0.6295746", "0.62847066", "0.6278429", "0.6270501", "0.62672055", "0.6266028", "0.6264355", "0.62587744", "0.62552726", "0.6251116", "0.6248176", "0.6244691", "0.6243456", "0.6240604", "0.6233442", "0.62277645", "0.62180316", "0.6215816", "0.6215816", "0.6215816", "0.6215816", "0.6215816", "0.6215816", "0.6215816", "0.6215816", "0.6215816", "0.6215816", "0.6215816", "0.6215816", "0.6215816", "0.6215816", "0.6215816", "0.6215816", "0.6214655", "0.6199776", "0.61946654", "0.61891085", "0.6179527", "0.61765116", "0.6172595", "0.61698335", "0.6158666", "0.6156587", "0.6149775", "0.6145416", "0.6143424", "0.6140624", "0.61403537", "0.6137555", "0.6130594", "0.6129701", "0.61261487", "0.6125448", "0.61219525", "0.61202264", "0.61192465", "0.6118931", "0.6113931", "0.6113492", "0.6112184", "0.61105037", "0.61026245", "0.6084464", "0.6084453", "0.6084086", "0.60815805", "0.60802704", "0.6073622" ]
0.0
-1